Merge branch 'vnext' of https://github.com/pazof/yavsc.git
This commit is contained in:
commit
ef83787da8
10 changed files with 81 additions and 4 deletions
|
|
@ -65,7 +65,6 @@ namespace Yavsc.Controllers
|
||||||
DirectoryInfo di = new DirectoryInfo(_site.UserFiles.DirName);
|
DirectoryInfo di = new DirectoryInfo(_site.UserFiles.DirName);
|
||||||
|
|
||||||
|
|
||||||
ViewBag.Files = estimate.GetFileContent(di.FullName);
|
|
||||||
return View(estimate);
|
return View(estimate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -148,7 +147,9 @@ namespace Yavsc.Controllers
|
||||||
{
|
{
|
||||||
return HttpNotFound();
|
return HttpNotFound();
|
||||||
}
|
}
|
||||||
ViewBag.Files = estimate.GetFileContent(_site.UserFiles.DirName);
|
|
||||||
|
ViewBag.Files = User.GetUserFiles(null);
|
||||||
|
|
||||||
return View(estimate);
|
return View(estimate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ namespace Yavsc.Helpers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public readonly static Replacement[] SpecialCharsToCommands =
|
public readonly static Replacement[] SpecialCharsRendering =
|
||||||
{
|
{
|
||||||
new Replacement("<","\\textless"),
|
new Replacement("<","\\textless"),
|
||||||
new Replacement(">","\\textgreater"),
|
new Replacement(">","\\textgreater"),
|
||||||
|
|
@ -53,7 +53,7 @@ namespace Yavsc.Helpers
|
||||||
string data;
|
string data;
|
||||||
public TeXString(string str) {
|
public TeXString(string str) {
|
||||||
data = str;
|
data = str;
|
||||||
foreach (var r in SpecialCharsToCommands) {
|
foreach (var r in SpecialCharsRendering) {
|
||||||
data = r.Execute(data);
|
data = r.Execute(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
21
Yavsc/Model/Forms/Field.cs
Normal file
21
Yavsc/Model/Forms/Field.cs
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using Yavsc.Model.Forms.Validation;
|
||||||
|
|
||||||
|
namespace Yavsc.Model.Forms
|
||||||
|
{
|
||||||
|
public abstract class Field
|
||||||
|
{
|
||||||
|
[Key,DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
|
public long Id { get; set; }
|
||||||
|
public abstract Method [] ValidationMethods ();
|
||||||
|
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
public string Label { get; set; }
|
||||||
|
public string PlaceHolder { get; set; }
|
||||||
|
|
||||||
|
public string ValueType { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
11
Yavsc/Model/Forms/FieldSet.cs
Normal file
11
Yavsc/Model/Forms/FieldSet.cs
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace Yavsc.Model.Forms
|
||||||
|
{
|
||||||
|
public class FieldSet
|
||||||
|
{
|
||||||
|
public string Legend {get; set;}
|
||||||
|
public List<Field> Fields { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
14
Yavsc/Model/Forms/Form.cs
Normal file
14
Yavsc/Model/Forms/Form.cs
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace Yavsc.Model.Forms
|
||||||
|
{
|
||||||
|
public class Form
|
||||||
|
{
|
||||||
|
[Key]
|
||||||
|
public string Id {get; set;}
|
||||||
|
|
||||||
|
public string Summary { get; set; }
|
||||||
|
public List<IFormNode> Content { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
17
Yavsc/Model/Forms/Validation/Method.cs
Normal file
17
Yavsc/Model/Forms/Validation/Method.cs
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace Yavsc.Model.Forms.Validation
|
||||||
|
{
|
||||||
|
public class Method
|
||||||
|
{
|
||||||
|
[Key]
|
||||||
|
public string Name {get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// TODO localisation ...
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[Required]
|
||||||
|
public string ErrorMessage { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
7
Yavsc/Model/Forms/Validation/Required.cs
Normal file
7
Yavsc/Model/Forms/Validation/Required.cs
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
namespace Yavsc.Model.Forms.Validation
|
||||||
|
{
|
||||||
|
public class Required : Method
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Yavsc.Models.Market {
|
namespace Yavsc.Models.Market {
|
||||||
|
/// <summary>
|
||||||
|
/// Not yet used!
|
||||||
|
/// </summary>
|
||||||
public class Money : IUnit<decimal>
|
public class Money : IUnit<decimal>
|
||||||
{
|
{
|
||||||
public Money(string name, decimal euroExchangeRate)
|
public Money(string name, decimal euroExchangeRate)
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,8 @@ namespace Yavsc.Models.Market
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public decimal? Price { get; set; }
|
public decimal? Price { get; set; }
|
||||||
|
|
||||||
|
// TODO make use of public Money Money { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ namespace Yavsc.Models.Market {
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
public List<IBillingClause> Billing { get; set; }
|
public List<IBillingClause> Billing { get; set; }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue