Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class CreateBatchViewModel
- {
- private readonly List<GenericIdNameType> lines;
- public bool IsWizard { get; set; }
- public int ProductionOrderId { get; set; }
- public string ProductionOrderName { get; set; }
- [Display(Name = "BatchLine", ResourceType = typeof(Resources.Resources))]
- [Required(ErrorMessageResourceType = typeof(Resources.Resources),
- ErrorMessageResourceName = "BatchLineRequired")]
- public byte SelectedLineId { get; set; }
- public IEnumerable<SelectListItem> LineItems
- {
- get { return new SelectList(lines, "Id", "Name"); }
- }
- public List<Data.Batch> Batches { get; set; }
- public CreateBatchViewModel(bool isWizard) : this()
- {
- IsWizard = isWizard;
- }
- public CreateBatchViewModel()
- {
- lines = new List<GenericIdNameType>();
- }
- public CreateBatchViewModel(List<Data.Line> dataLines, bool isWizard)
- {
- IsWizard = isWizard;
- if (dataLines == null)
- throw new ArgumentNullException("dataLines");
- lines = new List<GenericIdNameType>(dataLines.Count);
- GenericIdNameType genericType = new GenericIdNameType()
- {
- Id = null,
- Name = string.Empty
- };
- lines.Add(genericType);
- foreach (Data.Line line in dataLines)
- {
- genericType = new GenericIdNameType()
- {
- Id = line.LineId.ToString(),
- Name = line.Name
- };
- lines.Add(genericType);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement