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 && !save) { MessageBox.Show(strings.AllowUpdateMsg); return; } var saveRow = new TblCostCenter(); saveRow.InjectFrom(SelectedMainRow); if (!Loading) { Loading = true; Glclient.UpdateOrInsertTblCostCentersAsync(saveRow, save, MainRowList.IndexOf(SelectedMainRow), LoggedUserInfo.DatabasEname); } } } }
public void SaveOldRow(TblIncomeStatmentDesignHeaderViewModel oldRow) { if (oldRow != null) { var valiationCollection = new List <ValidationResult>(); var isvalid = Validator.TryValidateObject(oldRow, new ValidationContext(oldRow, null, null), valiationCollection, true); if (isvalid) { var save = oldRow.Iserial == 0; if (AllowUpdate != true && !save) { MessageBox.Show(strings.AllowUpdateMsg); return; } var saveRow = new TblIncomeStatmentDesignHeader(); saveRow.InjectFrom(oldRow); if (!Loading) { Loading = true; Glclient.UpdateOrInsertTblIncomeStatmentDesignHeaderAsync(saveRow, save, MainRowList.IndexOf(oldRow), LoggedUserInfo.DatabasEname); } } } }
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) { if (AllowDelete != true) { MessageBox.Show(strings.AllowDeleteMsg); return; } Glclient.DeleteTblGlRuleHeaderAsync((TblGlRuleHeader) new TblGlRuleHeader().InjectFrom(row), 0, LoggedUserInfo.DatabasEname); } else { MainRowList.Remove(row); if (!MainRowList.Any()) { AddNewMainRow(false); } } } } } }
public void SaveDetailRow() { if (SelectedDetailRow != null) { var valiationCollection = new List <ValidationResult>(); var isvalid = Validator.TryValidateObject(SelectedDetailRow, new ValidationContext(SelectedDetailRow, null, null), valiationCollection, true); if (SelectedDetailRow.Type.StartsWith("Account") && string.IsNullOrWhiteSpace(SelectedDetailRow.Description)) { isvalid = false; } if (isvalid) { var save = SelectedDetailRow.Iserial == 0; if (SelectedDetailRow.TblIncomeStatmentDesignHeader == 0) { SelectedDetailRow.TblIncomeStatmentDesignHeader = SelectedMainRow.Iserial; } if (AllowUpdate != true && !save) { MessageBox.Show(strings.AllowUpdateMsg); return; } var rowToSave = new TblIncomeStatmentDesignDetail(); rowToSave.InjectFrom(SelectedDetailRow); Glclient.UpdateOrInsertIncomeStatmentDesignDetailAsync(rowToSave, save, SelectedMainRow.DetailsList.IndexOf(SelectedDetailRow), LoggedUserInfo.DatabasEname); } } }
public void SaveDetailRow() { if (SelectedDetailRow != null) { var valiationCollection = new List <ValidationResult>(); var isvalid = Validator.TryValidateObject(SelectedDetailRow, new ValidationContext(SelectedDetailRow, null, null), valiationCollection, true); if (isvalid) { var save = SelectedDetailRow.Iserial == 0; if (AllowUpdate != true) { return; } var rowToSave = new TblGlPeriodLine(); rowToSave.InjectFrom(SelectedDetailRow); if (!Loading) { Loading = true; Glclient.UpdateOrInsertCspPeriodLineAsync(rowToSave, save, SelectedMainRow.TblPeriodLineList.IndexOf(SelectedDetailRow), LoggedUserInfo.DatabasEname, LoggedUserInfo.Iserial); } } } }
public void SaveDetailRow() { if (SelectedDetailRow != null) { var valiationCollection = new List <ValidationResult>(); var isvalid = Validator.TryValidateObject(SelectedDetailRow, new ValidationContext(SelectedDetailRow, null, null), valiationCollection, true); if (isvalid) { var save = SelectedDetailRow.Iserial == 0; if (SelectedDetailRow.TblGlRuleHeader == 0) { SelectedDetailRow.TblGlRuleHeader = SelectedMainRow.Iserial; } if (AllowUpdate != true && !save) { MessageBox.Show(strings.AllowUpdateMsg); return; } var rowToSave = new TblGlRuleMainDetail(); rowToSave.InjectFrom(SelectedDetailRow); Glclient.UpdateOrInsertTblGlRuleMainDetailsAsync(rowToSave, save, SelectedMainRow.DetailsList.IndexOf(SelectedDetailRow), LoggedUserInfo.DatabasEname); } } }
public void DeleteSubDetailRow() { if (SelectedSubDetailRows != null) { var res = MessageBox.Show("Are You To Delete SelectedRecords From Database ?", "Delete", MessageBoxButton.OKCancel); if (res == MessageBoxResult.OK) { foreach (var row in SelectedSubDetailRows) { if (row.Iserial != 0) { if (AllowDelete != true) { MessageBox.Show(strings.AllowDeleteMsg); return; } Loading = true; Glclient.DeleteTblGlRuleDetailAsync( (TblGlRuleDetail) new TblGlRuleDetail().InjectFrom(row), 1, LoggedUserInfo.DatabasEname); } else { SelectedDetailRow.DetailsList.Remove(SelectedSubDetailRow); if (!SelectedDetailRow.DetailsList.Any()) { AddNewSubDetailRow(false); } } } } } }
// ReSharper disable once InconsistentNaming public LedgerAttachmentViewModel(TblLedgerHeaderViewModel Row) { HeaderRow = Row; MainRowList = new SortableCollectionView <GlLedgerAttachmentViewModel>(); SelectedMainRow = new GlLedgerAttachmentViewModel(); Glclient.GetTblLedgerHeaderAttachmentCompleted += (s, sv) => { MainRowList.Clear(); foreach (var row in sv.Result) { var newrow = new GlLedgerAttachmentViewModel(); newrow.InjectFrom(row); MainRowList.Add(newrow); } Loading = false; }; Glclient.GetTblLedgerHeaderAttachmentAsync(HeaderRow.Iserial); Glclient.UpdateOrInsertTblLedgerHeaderAttachmentCompleted += (s, x) => Glclient.GetTblLedgerHeaderAttachmentAsync(HeaderRow.Iserial); Glclient.DeleteTblLedgerHeaderAttachmentCompleted += (s, ev) => { if (ev.Error != null) { throw ev.Error; } var oldrow = MainRowList.FirstOrDefault(x => x.Iserial == ev.Result); if (oldrow != null) { MainRowList.Remove(oldrow); } }; }
public void SaveOldSubDetailRow(TblGlRuleDetailViewModel oldRow) { if (oldRow != null) { var valiationCollection = new List <ValidationResult>(); var isvalid = Validator.TryValidateObject(oldRow, new ValidationContext(oldRow, null, null), valiationCollection, true); if (isvalid) { var save = oldRow.Iserial == 0; if (AllowUpdate != true && !save) { MessageBox.Show(strings.AllowUpdateMsg); return; } if (Loading == false) { Loading = true; var saveRow = new TblGlRuleDetail(); saveRow.InjectFrom(oldRow); Glclient.UpdateOrInsertTblGlRuleDetailsAsync(saveRow, save, SelectedDetailRow.DetailsList.IndexOf(oldRow), LoggedUserInfo.DatabasEname); } } } }
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 && !save) { MessageBox.Show(strings.AllowUpdateMsg); return; } var costdimist = new ObservableCollection <TblCostDimDetail>(); foreach (var tblCostDimDetailViewModel in MainRowList) { costdimist.Add(new TblCostDimDetail().InjectFrom(tblCostDimDetailViewModel) as TblCostDimDetail); } var saveRow = new TblCostDimDetail(); saveRow.InjectFrom(SelectedMainRow); Glclient.SaveTblCostDimHeaderAsync((int)LedgerHeaderViewModel.SelectedDetailRow.TblJournalAccountType, costdimist, LoggedUserInfo.DatabasEname); } } }
internal void Delete() { var res = MessageBox.Show("Are You To Delete SelectedRecords From Database ?", "Delete", MessageBoxButton.OKCancel); if (res == MessageBoxResult.OK) { Loading = true; foreach (var item in SelectedMainRows) { if (item.Iserial == 0) { MainRowList.Remove(item); if (!MainRowList.Any()) { AddNewMainRow(false); } } else { if (AllowDelete != true) { MessageBox.Show(strings.AllowDeleteMsg); return; } Loading = true; Glclient.DeleteGenericAsync(TablEname, item.Iserial.ToString(CultureInfo.InvariantCulture), LoggedUserInfo.DatabasEname); } } } }
public void DeleteSubDetailRow() { if (SelectedSubDetailRows != null) { var res = MessageBox.Show("Are You To Delete SelectedRecords From Database ?", "Delete", MessageBoxButton.OKCancel); if (res == MessageBoxResult.OK) { var ListInt = SelectedSubDetailRows.Select(w => w.Iserial).ToList(); var ObsInt = new ObservableCollection <int>(); foreach (var item in ListInt) { ObsInt.Add(item); } if (AllowDelete != true) { MessageBox.Show(strings.AllowDeleteMsg); return; } Glclient.DeleteTblJournalSettingCostCenterAsync(ObsInt, LoggedUserInfo.DatabasEname); foreach (var row in SelectedSubDetailRows.Where(w => w.Iserial == 0).ToList()) { SelectedMainRow.SubDetailList.Remove(row); } if (!SelectedMainRow.SubDetailList.Any()) { AddNewDetailRow(false); } } } }
public void GetMaindata() { if (SortBy == null) { SortBy = "it.Iserial"; } Glclient.GetTblPeriodAsync(MainRowList.Count, PageSize, SortBy, Filter, ValuesObjects, LoggedUserInfo.DatabasEname); }
public void GetMaindata() { if (SortBy == null) { SortBy = "it.Iserial"; } Loading = true; Glclient.GetTblBankTransactionTypeAsync(MainRowList.Count, PageSize, SortBy, Filter, ValuesObjects, LoggedUserInfo.DatabasEname); }
public void GetDetailRow() { if (SortBy == null) { SortBy = "it.Iserial"; } Loading = true; Glclient.GetTblBankChequeAsync(SelectedMainRow.DetailsList.Count, int.MaxValue, SelectedMainRow.Iserial, SortBy, DetailFilter, DetailValuesObjects, LoggedUserInfo.DatabasEname, 4); }
public void GetMaindata() { if (SortBy == null) { SortBy = "it.Iserial"; } Loading = true; Glclient.GetTblCostCenterOrganizationUnitAsync(MainRowList.Count, PageSize, SortBy, Filter, ValuesObjects, LoggedUserInfo.DatabasEname); }
public void GetMaindata() { if (SortBy == null) { SortBy = "it.Iserial desc"; } Loading = true; Glclient.GetTblChequeTransactionDetailNotLinkedAsync(Vendor, LoggedUserInfo.DatabasEname); }
public void GetSubDetailData() { Loading = true; if (SelectedMainRow != null) { Glclient.GetTblGlRuleDetailAsync(SelectedDetailRow.DetailsList.Count, PageSize, SelectedDetailRow.Iserial, "it.Iserial", DetailSubFilter, DetailSubValuesObjects, LoggedUserInfo.DatabasEname); } }
public void GetMaindata() { if (SortBy == null) { SortBy = "it.Iserial"; } Loading = true; Glclient.GetGenericAsync(TablEname, Code, Ename, Aname, SortBy, Direction, LoggedUserInfo.DatabasEname); }
public void GetMaindata() { if (SortBy == null) { SortBy = "it.Iserial"; } Loading = true; Glclient.GetTblAccountAsync(MainRowList.Count, PageSize, SortBy, Filter, ValuesObjects, LoggedUserInfo.DatabasEname, ChildOnly); }
public void GetMaindata() { if (SortBy == null) { SortBy = "it.Iserial"; } Loading = true; Glclient.GetTblCostDimSetupHeaderForAccountAsync((int)LedgerHeaderViewModel.SelectedDetailRow.TblJournalAccountType, LedgerHeaderViewModel.SelectedDetailRow.TblCostDimHeader , LoggedUserInfo.DatabasEname); }
public void GetMaindata() { if (SortBy == null) { SortBy = "it.Iserial"; } Loading = true; Glclient.GetTblContractHeaderForChequeAsync(TblJournalAccountType, EntityAccount, LoggedUserInfo.DatabasEname); }
public void GetFullMainData() { if (SortBy == null) { SortBy = "it.Iserial"; } Loading = true; Export = true; Glclient.GetTblGlExpensisAsync(MainRowList.Count, PageSize, SortBy, Filter, ValuesObjects, LoggedUserInfo.DatabasEname); }
public void GetMaindata() { if (SortBy == null) { SortBy = "it.Iserial"; } Loading = true; Glclient.GetTblCostCenterAsync(MainRowList.Count, PageSize, CostCenterType, SortBy, Filter, ValuesObjects, LoggedUserInfo.DatabasEname, LoggedUserInfo.Iserial, EntityAccount, EntityAccountType); }
public void GetMaindata() { if (SortBy == null) { SortBy = "it.Iserial"; } Loading = true; Glclient.GetTblGlGenEntityGroupAsync(MainRowList.Count, PageSize, MainJournalAccoutType.Iserial, SortBy, Filter, ValuesObjects, LoggedUserInfo.DatabasEname); }
public void GetMaindata() { if (SortBy == null) { SortBy = "it.Iserial"; } Loading = true; Glclient.GetTblBankChequeAsync(MainRowList.Count, PageSize, Bank, SortBy, Filter, ValuesObjects, LoggedUserInfo.DatabasEname, ChequeStatusPerRow.Iserial); }
public void GetMaindata() { if (SortBy == null) { SortBy = "it.Iserial"; } Loading = true; Glclient.GetTblIncomeStatmentDesignHeaderAsync(MainRowList.Count, PageSize, SortBy, Filter, ValuesObjects, LoggedUserInfo.DatabasEname); }
internal void GetLedgerDetail() { if (DetailSortBy == null) { DetailSortBy = "it.Iserial"; } Loading = true; Glclient.GetTblLedgerDetailForDepreciationAsync(0, 100, true, DetailSortBy, DetailFilter, DetailValuesObjects, LoggedUserInfo.DatabasEname); }
public void GetDetailData() { SelectedMainRow.DetailList.Clear(); if (SortBy == null) { SortBy = "it.Iserial"; } Loading = true; Glclient.GetTblDepreciationTransactionDetailAsync(SelectedMainRow.Iserial, LoggedUserInfo.DatabasEname); }
public void SaveMainRow() { Loading = true; var observableCollectionIserials = new ObservableCollection <int>(); foreach (var item in MainRowList.Where(w => w.Saved == true).Select(w => w.Iserial).ToList()) { observableCollectionIserials.Add(item); } Glclient.UpdateorInsertClosingAdvanceVendorPaymentsAsync(PostDate, observableCollectionIserials, LoggedUserInfo.Iserial, LoggedUserInfo.DatabasEname); }