Exemple #1
0
        public void SaveMainRow()
        {
            if (SelectedMainRow != null)
            {
                var valiationCollection = new List <ValidationResult>();

                var isvalid = Validator.TryValidateObject(SelectedMainRow, new ValidationContext(SelectedMainRow, null, null), valiationCollection, true);

                if (isvalid)
                {
                    var saveRow = new AuthService.TblAuthUser();
                    saveRow.InjectFrom(SelectedMainRow);
                    AuthClient.SaveUserAsync(saveRow, MainRowList.IndexOf(SelectedMainRow));
                    Loading = true;
                }
            }
        }
Exemple #2
0
        public void AddNewMainRow()
        {
            var newRow = new TblStyleTNAStatusDetailModel
            {
                UserPerRow =
                {
                    Iserial  = LoggedUserInfo.Iserial,
                    UserName = LoggedUserInfo.WFM_UserName,
                    Ename    = LoggedUserInfo.Ename
                },
                TblAuthUser       = LoggedUserInfo.Iserial,
                TblStyleTNAHeader = TempStyleViewModel.SelectedTnaRow.Iserial,
                RequestDate       = DateTime.Now,
            };

            MainRowList.Add(newRow);
        }
Exemple #3
0
 public void DeleteMainRow()
 {
     if (SelectedMainRows != null)
     {
         var res = MessageBox.Show("Are You To Delete SelectedRecords From Database ?", "Delete",
                                   MessageBoxButton.OKCancel);
         if (res == MessageBoxResult.OK)
         {
             foreach (var row in SelectedMainRows)
             {
                 var record = new TblAttachment();
                 record.InjectFrom(row);
                 assistanceClient.DeleteAttachmentAsync(record, MainRowList.IndexOf(row));
             }
         }
     }
 }
Exemple #4
0
        public void SaveMainRow()
        {
            if (SelectedMainRow != null)
            {
                var valiationCollection = new List <ValidationResult>();

                var isvalid = Validator.TryValidateObject(SelectedMainRow, new ValidationContext(SelectedMainRow, null, null), valiationCollection, true);

                if (isvalid)
                {
                    var save    = SelectedMainRow.Iserial == 0;
                    var saveRow = new TblFabricBom();
                    saveRow.InjectFrom(SelectedMainRow);
                    Client.UpdateOrInsertTblFabricBomAsync(saveRow, save, MainRowList.IndexOf(SelectedMainRow));
                }
            }
        }
Exemple #5
0
        public void SaveMainRow()
        {
            if (SelectedMainRow != null)
            {
                var valiationCollection = new List <ValidationResult>();

                var isvalid = Validator.TryValidateObject(SelectedMainRow, new ValidationContext(SelectedMainRow, null, null), valiationCollection, true);
                isvalid &= UserWarehouseList.Any(uw =>
                                                 uw.WarehouseIserial == SelectedMainRow.WarehouseFrom ||
                                                 uw.WarehouseIserial == SelectedMainRow.WarehouseTo);
                if (isvalid)
                {
                    var saveRow = new TblTransferHeader()
                    {
                        DocDate        = DateTime.Now,
                        CreatedBy      = 1,
                        CreationDate   = DateTime.Now,
                        Approved       = false,
                        LastChangeDate = DateTime.Now,
                        CodeFrom       = "",
                        CodeTo         = "",
                    };
                    saveRow.InjectFrom(SelectedMainRow);
                    saveRow.TblTransferDetails = new ObservableCollection <TblTransferDetail>();
                    foreach (var item in SelectedMainRow.TblTransferDetails)
                    {
                        var detailTemp = new TblTransferDetail();
                        detailTemp.InjectFrom(item);
                        detailTemp.ItemTransfer = new Web.DataLayer.ItemDimensionSearchModel();
                        saveRow.TblTransferDetails.Add(detailTemp);
                    }

                    var mainRowIndex = MainRowList.IndexOf(SelectedMainRow);
                    if (mainRowIndex < 0)
                    {
                        MainRowList.Insert(mainRowIndex + 1, SelectedMainRow); mainRowIndex++;
                    }
                    WarehouseClient.UpdateOrInsertTransferHeaderAsync(saveRow, mainRowIndex, LoggedUserInfo.Iserial);
                }
                else
                {
                    MessageBox.Show("Please Choose one of your assigned warehouses");
                }
            }
        }
Exemple #6
0
        internal void SaveOrUpdate()
        {
            Loading = true;

            if (SelectedMainRow != null)
            {
                var save = SelectedMainRow.Iserial == 0;

                if (AllowUpdate != true && !save)
                {
                    MessageBox.Show(strings.AllowUpdateMsg);
                    return;
                }
                var saveRow = new GenericTable();
                saveRow.InjectFrom(SelectedMainRow);
                Glclient.GenericUpdateOrInsertAsync(TablEname, saveRow, MainRowList.IndexOf(SelectedMainRow), LoggedUserInfo.DatabasEname);
            }
        }
Exemple #7
0
        public void DeleteMainRow(TblStyleImageViewModel row)
        {
            var res = MessageBox.Show("Are You To Delete SelectedRecords From Database ?", "Delete",
                                      MessageBoxButton.OKCancel);

            if (res == MessageBoxResult.OK)
            {
                if (row.Iserial == 0)
                {
                    MainRowList.Remove(row);
                }
                else
                {
                    Client.DeleteTblStyleImageAsync(
                        (TblStyleImage) new TblStyleImage().InjectFrom(row), MainRowList.IndexOf(row));
                }
            }
        }
Exemple #8
0
        public void SaveMainRow()
        {
            if (SelectedMainRows != null)
            {
                var valiationCollection = new List <ValidationResult>();

                var isvalid = Validator.TryValidateObject(SelectedMainRows, new ValidationContext(SelectedMainRows, null, null), valiationCollection, true);

                if (isvalid)
                {
                    var save = SelectedMainRow.Iserial == 0;
                    SelectedMainRow.Emplid = LoggedUserInfo.Code;
                    var saveRow = new TblMission();
                    saveRow.InjectFrom(SelectedMainRow);

                    AttService.UpdateAndInsertTblMissionAsync(saveRow, save, MainRowList.IndexOf(SelectedMainRow), LoggedUserInfo.Iserial);
                }
            }
        }
Exemple #9
0
        public void SaveMainRow()
        {
            foreach (var row in MainRowList.Where(x => x.Iserial == 0))
            {
                var isvalid = Validator.TryValidateObject(row,
                                                          new ValidationContext(row, null, null), null, true);

                if (isvalid)
                {
                    var saveRow = new ProductionService.TblStyleTNAStatusDetail();

                    saveRow.InjectFrom(row);
                    int x = MainRowList.IndexOf(row);
                    ProductionClient.UpdateOrInsertTblStyleTNAStatusDetailAsync(saveRow, MainRowList.IndexOf(row));
                    TempStyleViewModel.Loading = true;
                    Loading = true;
                }
            }
        }
Exemple #10
0
        internal void SaveMainRow()
        {
            if (SelectedMainRow == null)
            {
                return;
            }
            var saveRow = new _Proxy.GenericTable();

            saveRow.InjectFrom(SelectedMainRow);
            var save = SelectedMainRow.Iserial == 0;

            if (AllowUpdate != true && !save)
            {
                MessageBox.Show(strings.AllowUpdateMsg);
                return;
            }
            Loading = true;
            Client.GenericUpdateOrInsertAsync(TablEname, saveRow, MainRowList.IndexOf(SelectedMainRow));
        }
Exemple #11
0
        public void AddNewMainRow(GenericTable row)
        {
            var newRow = new TblApprovalViewModel
            {
                UserPerRow =
                {
                    Iserial  = LoggedUserInfo.Iserial,
                    AxId     = LoggedUserInfo.AxId,
                    UserName = LoggedUserInfo.WFM_UserName
                },
                TblAuthUser    = LoggedUserInfo.Iserial,
                TblSalesOrder  = Salesorder,
                ApprovalDate   = DateTime.Now,
                ApprovalType   = row.Iserial,
                ApprovalPerRow = row
            };

            MainRowList.Add(newRow);
        }
Exemple #12
0
        public void AddNewMainRow(bool checkLastRow)
        {
            var currentRowIndex = (MainRowList.IndexOf(SelectedMainRow));

            if (!checkLastRow || currentRowIndex == (MainRowList.Count - 1))
            {
                if (checkLastRow && SelectedMainRow != null)
                {
                    var valiationCollection = new List <ValidationResult>();
                    var isvalid             = Validator.TryValidateObject(SelectedMainRow, new ValidationContext(SelectedMainRow, null, null), valiationCollection, true);
                    if (!isvalid)
                    {
                        return;
                    }
                }
                SelectedMainRow = new TblStoreCommission();
                MainRowList.Insert(currentRowIndex + 1, SelectedMainRow);
            }
        }
        public void SaveMainRow()
        {
            if (AllowAdd != true)
            {
                MessageBox.Show(strings.AllowAddMsg);
                return;
            }
            var detailsl = new ObservableCollection <TblIssueJournalDetail>();

            if (SelectedMainRow != null)
            {
                var valiationCollection = new List <ValidationResult>();

                var isvalid = Validator.TryValidateObject(SelectedMainRow, new ValidationContext(SelectedMainRow, null, null), valiationCollection, true);

                foreach (var variable in SelectedMainRow.DetailList)
                {
                    var valiationCollectiondetail = new List <ValidationResult>();

                    var isvalidDetails = Validator.TryValidateObject(variable, new ValidationContext(variable, null, null), valiationCollectiondetail, true);

                    if (isvalidDetails)
                    {
                        variable.RemQty = variable.Qty;
                        detailsl.Add(new TblIssueJournalDetail().InjectFrom(variable) as TblIssueJournalDetail);
                    }
                    else
                    {
                        return;
                    }
                }

                if (isvalid)
                {
                    var save    = SelectedMainRow.Iserial == 0;
                    var saveRow = new TblIssueJournalHeader();
                    saveRow.InjectFrom(SelectedMainRow);
                    saveRow.TblIssueJournalDetails = detailsl;
                    Loading = true;
                    Client.UpdateOrInsertTblIssueJournalHeaderAsync(saveRow, save, MainRowList.IndexOf(SelectedMainRow), LoggedUserInfo.Iserial);
                }
            }
        }
Exemple #14
0
        public void SaveMainRow()
        {
            if (SelectedMainRow != null)
            {
                var valiationCollection = new List <ValidationResult>();

                var isvalid = Validator.TryValidateObject(SelectedMainRow, new ValidationContext(SelectedMainRow, null, null), valiationCollection, true);

                if (!isvalid)
                {
                }
                else
                {
                    var save    = SelectedMainRow.Iserial == 0;
                    var saveRow = new tbl_lkp_AccessoryGroup();
                    saveRow.InjectFrom(SelectedMainRow);
                    Client.UpdateOrInsertTblAccessoriesGroupAsync(saveRow, save, MainRowList.IndexOf(SelectedMainRow));
                }
            }
        }
Exemple #15
0
        public BankDepositViewModel()
        {
            if (!DesignerProperties.IsInDesignTool)
            {
                GetItemPermissions(PermissionItemName.BankDepositApproval.ToString());

                Client.GetTblBankDepositCompleted += (s, sv) =>
                {
                    foreach (var row in sv.Result)
                    {
                        var newrow = new TblBankDepositViewModel();

                        newrow.InjectFrom(row);
                        MainRowList.Add(newrow);
                    }
                    Loading   = false;
                    FullCount = sv.fullCount;
                };
            }
        }
Exemple #16
0
        public void AddNewMainRow(bool checkLastRow)
        {
            var currentRowIndex = (MainRowList.IndexOf(SelectedMainRow));

            if (!checkLastRow || currentRowIndex == (MainRowList.Count - 1))
            {
                if (checkLastRow)
                {
                    var valiationCollection = new List <ValidationResult>();

                    var isvalid = Validator.TryValidateObject(SelectedMainRow, new ValidationContext(SelectedMainRow, null, null), valiationCollection, true);

                    if (!isvalid)
                    {
                        return;
                    }
                }

                MainRowList.Insert(currentRowIndex + 1, new TblFactoryDeliveryViewModel());
            }
        }
Exemple #17
0
        public void SaveMainRow()
        {
            foreach (var row in MainRowList.Where(x => x.Iserial == 0))
            {
                var isvalid = Validator.TryValidateObject(row,
                                                          new ValidationContext(row, null, null), null, true);

                if (isvalid)
                {
                    var saveRow = new TblApproval();
                    saveRow.InjectFrom(row);

                    //CheckTNA
                    if (saveRow.ApprovalType == 1 && saveRow.ApprovedStatus == 1)
                    {
                        LkpData.LkpDataClient _client = new LkpData.LkpDataClient();
                        _client.CheckTNAAsync(SelectedMainRow.TblSalesOrder, LoggedUserInfo.WFM_UserJob.Value);
                        _client.CheckTNACompleted += (s, sv) =>
                        {
                            if (sv.Result == true)
                            {
                                Client.UpdateOrInsertTblApprovalAsync(saveRow, MainRowList.IndexOf(row), Perm);
                                TempStyleViewModel.Loading = true;
                                Loading = true;
                            }
                            else
                            {
                                MessageBox.Show("Kindly Check TNA");
                            }
                        };
                    }
                    else
                    {
                        Client.UpdateOrInsertTblApprovalAsync(saveRow, MainRowList.IndexOf(row), Perm);
                        TempStyleViewModel.Loading = true;
                        Loading = true;
                    }
                }
            }
        }
        public override void Search()
        {
            MainRowList.Clear();
            SearchHeader();
            if (SearchWindow == null)
            {
                SearchWindow = new GenericSearchWindow(GetSearchModel());
            }
            GenericSearchViewModel <TblDyeingOrderInvoiceHeaderViewModel> vm =
                new GenericSearchViewModel <TblDyeingOrderInvoiceHeaderViewModel>()
            {
                Title = "Dyeing Order Invoice"
            };

            vm.FilteredItemsList = MainRowList;
            vm.ItemsList         = MainRowList;
            vm.ResultItemsList.CollectionChanged += (s, e) =>
            {
                if (e.Action == NotifyCollectionChangedAction.Add)
                {
                    SelectedMainRow = vm.ResultItemsList[e.NewStartingIndex];
                }
                GetDetailData();
                // RaisePropertyChanged(nameof(IsReadOnly));
            };
            vm.GetDataCommand = new SilverlightCommands.RelayCommand((o) =>
            {
                Filter        = vm.Filter;
                ValuesObjects = vm.ValuesObjects;
                SearchHeader();
            },
                                                                     (o) =>
            {
                return(true);//هنا الصلاحيات
            });
            SearchWindow.DataContext = vm;
            base.Search();
        }
Exemple #19
0
        public void SaveMainRow()
        {
            if (SelectedMainRow != null)
            {
                var valiationCollection = new List <ValidationResult>();

                var isvalid = Validator.TryValidateObject(SelectedMainRow, new ValidationContext(SelectedMainRow, null, null), valiationCollection, true);

                if (isvalid)
                {
                    var save = SelectedMainRow.Iserial == 0;
                    if (save)
                    {
                        if (AllowAdd != true)
                        {
                            MessageBox.Show(strings.AllowAddMsg);
                            return;
                        }
                    }
                    else
                    {
                        if (AllowUpdate != true)
                        {
                            MessageBox.Show(strings.AllowUpdateMsg);
                            return;
                        }
                    }
                    var saveRow = new TblAssetGroup();

                    saveRow.InjectFrom(SelectedMainRow);
                    Glclient.UpdateOrInsertTblAssetGroupAsync(saveRow, save, MainRowList.IndexOf(SelectedMainRow), LoggedUserInfo.DatabasEname);
                }
                else
                {
                    MessageBox.Show("Data Was Not Saved");
                }
            }
        }
Exemple #20
0
        public void SaveMainRow()
        {
            if (SelectedMainRow != null)
            {
                var valiationCollection = new List <ValidationResult>();

                var isvalid = Validator.TryValidateObject(SelectedMainRow, new ValidationContext(SelectedMainRow, null, null), valiationCollection, true);

                if (isvalid)
                {
                    var save = SelectedMainRow.Iserial == 0;
                    if (AllowUpdate != true)
                    {
                        MessageBox.Show(strings.AllowAddMsg);
                        return;
                    }

                    var saveRow = new LkpData.TblFamily();
                    saveRow.InjectFrom(SelectedMainRow);
                    lkpClient.UpdateOrInsertTblFamilyAsync(saveRow, save, MainRowList.IndexOf(SelectedMainRow));
                }
            }
        }
Exemple #21
0
 public void DeleteMainRow()
 {
     if (SelectedMainRows != null)
     {
         var res = MessageBox.Show("Are You To Delete SelectedRecords From Database ?", "Delete",
                                   MessageBoxButton.OKCancel);
         if (res == MessageBoxResult.OK)
         {
             foreach (var row in SelectedMainRows)
             {
                 if (row.GlSerial != 0)
                 {
                     Client.DeleteFingerPrintTransactionAsync(
                         (FingerPrintTransaction) new FingerPrintTransaction().InjectFrom(row), MainRowList.IndexOf(row));
                 }
                 else
                 {
                     MainRowList.Remove(row);
                 }
             }
         }
     }
 }
 public void DeleteMainRow()
 {
     if (SelectedMainRows != null)
     {
         var res = MessageBox.Show("Are You To Delete SelectedRecords From Database ?", "Delete",
                                   MessageBoxButton.OKCancel);
         if (res == MessageBoxResult.OK)
         {
             foreach (var row in SelectedMainRows)
             {
                 if (row.Iserial != 0)
                 {
                     Client.DeleteTblCheckListMailAsync(
                         (TblCheckListMail) new TblCheckListMail().InjectFrom(row), MainRowList.IndexOf(row));
                 }
                 else
                 {
                     MainRowList.Remove(row);
                 }
             }
         }
     }
 }
Exemple #23
0
 public void DeleteMainRow()
 {
     if (SelectedMainRows != null)
     {
         var res = MessageBox.Show("Are You To Delete SelectedRecords From Database ?", "Delete",
                                   MessageBoxButton.OKCancel);
         if (res == MessageBoxResult.OK)
         {
             foreach (var row in SelectedMainRows)
             {
                 if (row.Iserial != 0)
                 {
                     AuthClient.DeleteUserAsync(row.Iserial);
                     Loading = true;
                 }
                 else
                 {
                     MainRowList.Remove(row);
                 }
             }
         }
     }
 }
Exemple #24
0
        public void AddNewMainRow(bool checkLastRow)
        {
            var currentRowIndex = (MainRowList.IndexOf(SelectedMainRow));

            if (!checkLastRow || currentRowIndex == (MainRowList.Count - 1))
            {
                if (checkLastRow)
                {
                    var valiationCollection = new List <ValidationResult>();

                    var isvalid = Validator.TryValidateObject(SelectedMainRow, new ValidationContext(SelectedMainRow, null, null), valiationCollection, true);

                    if (!isvalid)
                    {
                        return;
                    }
                }

                MainRowList.Insert(currentRowIndex + 1, new TblStyleImageViewModel
                {
                    TblRequestForSample = RequestForSample.Iserial
                });
            }
        }
Exemple #25
0
        public void AddNewMainRow(bool checkLastRow)
        {
            if (AllowAdd != true)
            {
                MessageBox.Show(strings.AllowAddMsg);
                return;
            }
            var currentRowIndex = (MainRowList.IndexOf(SelectedMainRow));

            if (checkLastRow)
            {
                var valiationCollection = new List <ValidationResult>();
                var isvalid             = Validator.TryValidateObject(SelectedMainRow,
                                                                      new ValidationContext(SelectedMainRow, null, null), valiationCollection, true);
                if (!isvalid)
                {
                    return;
                }
            }
            var newrow = new TblEmpLeavingTransactionViewModel();

            MainRowList.Insert(currentRowIndex + 1, newrow);
            SelectedMainRow = newrow;
        }
Exemple #26
0
        public override void Search()
        {
            MainRowList.Clear();
            GetMaindata();
            if (SearchWindow == null)
            {
                SearchWindow = new GenericSearchWindow(GetSearchModel());
            }
            GenericSearchViewModel <TradeAgreementTransaction> vm =
                new GenericSearchViewModel <TradeAgreementTransaction>()
            {
                Title = "Trade Agreement Search"
            };

            vm.FilteredItemsList = MainRowList;
            vm.ItemsList         = MainRowList;
            vm.ResultItemsList.CollectionChanged += (s, e) =>
            {
                if (e.Action == NotifyCollectionChangedAction.Add)
                {
                    SelectedMainRow = vm.ResultItemsList[e.NewStartingIndex];
                }
            };
            vm.GetDataCommand = new SilverlightCommands.RelayCommand((o) =>
            {
                Filter        = vm.Filter;
                ValuesObjects = vm.ValuesObjects;
                GetMaindata();
            },
                                                                     (o) =>
            {
                return(true);//هنا الصلاحيات
            });
            SearchWindow.DataContext = vm;
            base.Search();
        }
        public void AddNewMainRow(bool checkLastRow)
        {
            var currentRowIndex = (MainRowList.IndexOf(SelectedMainRow));

            if (!checkLastRow || currentRowIndex == (MainRowList.Count - 1))
            {
                if (checkLastRow)
                {
                    var valiationCollection = new List <ValidationResult>();

                    var isvalid = Validator.TryValidateObject(SelectedMainRow, new ValidationContext(SelectedMainRow, null, null), valiationCollection, true);

                    if (!isvalid)
                    {
                        return;
                    }
                }
                var newRow = new TblBrandSectionMailViewModel {
                    TblBrand = Brand, TblLkpBrandSection = BrandSection
                };

                MainRowList.Insert(currentRowIndex + 1, newRow);
            }
        }
        public void AddNewMainRow(bool checkLastRow)
        {
            var currentRowIndex = (MainRowList.IndexOf(SelectedMainRow));

            if (checkLastRow)
            {
                var valiationCollection = new List <ValidationResult>();

                var isvalid = Validator.TryValidateObject(SelectedMainRow, new ValidationContext(SelectedMainRow, null, null), valiationCollection, true);

                if (!isvalid)
                {
                    return;
                }
            }
            var newrow = new TblDepreciationTransactionHeaderViewModel
            {
                CreatedBy = LoggedUserInfo.Iserial,
                TransDate = DateTime.Now,
            };

            MainRowList.Insert(currentRowIndex + 1, newrow);
            SelectedMainRow = newrow;
        }
        public void SaveMainRow()
        {
            if (AllowUpdate != true)
            {
                MessageBox.Show(strings.AllowAddMsg);
                return;
            }
            if (SelectedMainRow != null)
            {
                var valiationCollection = new List <ValidationResult>();

                var isvalid = Validator.TryValidateObject(SelectedMainRow, new ValidationContext(SelectedMainRow, null, null), valiationCollection, true);

                if (isvalid && !Loading)//&& !SelectedMainRow.LockedRow)
                {
                    var save    = SelectedMainRow.Iserial == 0;
                    var saveRow = new TblSeasonalMasterList();
                    saveRow.InjectFrom(SelectedMainRow);
                    saveRow.TblSeasonalMasterListDetails = SelectedMainRow.SeasonalMasterListDetail;
                    Loading = true;
                    Client.UpdateOrInsertTblSmlAsync(saveRow, save, MainRowList.IndexOf(SelectedMainRow));
                }
            }
        }
        public void AddNewMainRow(bool checkLastRow)
        {
            var currentRowIndex = (MainRowList.IndexOf(SelectedMainRow));

            if (checkLastRow)
            {
                var valiationCollection = new List <ValidationResult>();

                var isvalid = Validator.TryValidateObject(SelectedMainRow,
                                                          new ValidationContext(SelectedMainRow, null, null), valiationCollection, true);

                if (!isvalid)
                {
                    return;
                }
            }

            var newrow = new TblUserCheckListViewModel {
                TblAuthUser = LoggedUserInfo.Iserial
            };

            MainRowList.Insert(currentRowIndex + 1, newrow);
            SelectedMainRow = newrow;
        }