Exemplo n.º 1
0
        private void InitializeData()
        {
            UnitOfWork = new SoheilEdmContext();
            PartWarehouseGroupDataService = new PartWarehouseGroupDataService(UnitOfWork);
            PartWarehouseDataService = new PartWarehouseDataService(UnitOfWork);
            PartWarehouseDataService.PartWarehouseAdded += OnPartWarehouseAdded;
            PartWarehouseGroupDataService.PartWarehouseGroupAdded += OnPartWarehouseGroupAdded;


            ColumnHeaders = new List<ColumnInfo> 
            { 
                new ColumnInfo("Code",0), 
                new ColumnInfo("Name",1), 
                new ColumnInfo("Quantity","txtQuantity",2,true), 
                new ColumnInfo("TotalCost","txtCost",3,true),
                new ColumnInfo("Status",4) ,
                new ColumnInfo("Mode",5,true) 
            };

            AddCommand = new Command(Add, CanAdd);RefreshCommand = new Command(CreateItems);
            AddGroupCommand = new Command(AddGroup);
            ViewCommand = new Command(View, CanView);

            CreateItems(null);
        }
Exemplo n.º 2
0
 private void InitializeData(PartWarehouseDataService dataService, PartWarehouseGroupDataService groupDataService, CostDataService costDataService)
 {
     PartWarehouseDataService = dataService;
     GroupDataService = groupDataService;
     CostDataService = costDataService;
     SaveCommand = new Command(Save, CanSave);
 }
Exemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PartWarehouseVM"/> class.
 /// </summary>
 /// <param name="entity">The entity.</param>
 /// <param name="access"></param>
 /// <param name="dataService"></param>
 /// <param name="groupDataService"></param>
 /// <param name="costDataService"></param>
 public PartWarehouseVM(PartWarehouse entity, AccessType access, PartWarehouseDataService dataService, PartWarehouseGroupDataService groupDataService, CostDataService costDataService)
     : base(access)
 {
     _model = entity;
     InitializeData(dataService, groupDataService, costDataService);
     Groups = new ListCollectionView(new ObservableCollection<PartWarehouseGroupVM>());
 }
Exemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PartWarehouseVM"/> class from the model.
 /// </summary>
 /// <param name="entity">The model.</param>
 /// <param name="groupItems">The group view models.</param>
 /// <param name="access"></param>
 /// <param name="dataService"></param>
 /// <param name="groupDataService"></param>
 /// <param name="costDataService"></param>
 public PartWarehouseVM(PartWarehouse entity, ListCollectionView groupItems, AccessType access, PartWarehouseDataService dataService, PartWarehouseGroupDataService groupDataService, CostDataService costDataService)
     : base(access)
 {
     InitializeData(dataService, groupDataService, costDataService);
     _model = entity;
     Groups = groupItems;
     foreach (PartWarehouseGroupVM groupVm in groupItems)
     {
         if (groupVm.Id == entity.PartWarehouseGroup.Id)
         {
             SelectedGroupVM = groupVm;
             break;
         }
     }
 }
Exemplo n.º 5
0
 public static PartWarehouseGroup CreateNew(PartWarehouseGroupDataService dataService)
 {
     int id = dataService.AddModel(new PartWarehouseGroup { Name = "گروه جدید" });
     return dataService.GetSingle(id);
 }
Exemplo n.º 6
0
 private void InitializeData(PartWarehouseGroupDataService dataService)
 {
     PartWarehouseGroupDataService = dataService;
     SaveCommand = new Command(Save, CanSave);
 }
Exemplo n.º 7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PartWarehouseGroupVM"/> class initialized with default values.
 /// </summary>
 public PartWarehouseGroupVM(AccessType access, PartWarehouseGroupDataService dataService):base(access)
 {
     InitializeData(dataService);
 }
Exemplo n.º 8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PartWarehouseVM"/> class from the model.
 /// </summary>
 /// <param name="entity">The model.</param>
 /// <param name="access"></param>
 /// <param name="dataService"></param>
 public PartWarehouseGroupVM(PartWarehouseGroup entity, AccessType access, PartWarehouseGroupDataService dataService)
     : base(access)
 {
     InitializeData(dataService);
     _model = entity;
 }