SelectedCriteria SetCriteriaControlValue(BalanceColumn objBalanceColumn, CriteriaControl crControl) { SelectedCriteria objSelectedCriteria = crControl.DataContext as SelectedCriteria; objSelectedCriteria.CriteriaName = objBalanceColumn._Name; objSelectedCriteria.Journal = objBalanceColumn._InclJournal; objSelectedCriteria.BudgetModel = objBalanceColumn._BudgetId; objSelectedCriteria.FromDate = objBalanceColumn._FromDate; objSelectedCriteria.ToDate = objBalanceColumn._ToDate; objSelectedCriteria.dimval1 = objBalanceColumn.Dims1; objSelectedCriteria.dimval2 = objBalanceColumn.Dims2; objSelectedCriteria.dimval3 = objBalanceColumn.Dims3; objSelectedCriteria.dimval4 = objBalanceColumn.Dims4; objSelectedCriteria.dimval5 = objBalanceColumn.Dims5; objSelectedCriteria.NotifyPropertyChanged("Dim1"); objSelectedCriteria.NotifyPropertyChanged("Dim2"); objSelectedCriteria.NotifyPropertyChanged("Dim3"); objSelectedCriteria.NotifyPropertyChanged("Dim4"); objSelectedCriteria.NotifyPropertyChanged("Dim5"); objSelectedCriteria.balanceColumnFormat = objBalanceColumn.ColumnFormatEnum; objSelectedCriteria.balanceColumnMethod = objBalanceColumn.ColumnMethodEnum; objSelectedCriteria.ShowDebitCredit = objBalanceColumn._ShowDebitCredit; objSelectedCriteria.InvertSign = objBalanceColumn._InvertSign; objSelectedCriteria.InclPrimo = objBalanceColumn._InclPrimo; objSelectedCriteria.ColA = objBalanceColumn._ColA; objSelectedCriteria.ColB = objBalanceColumn._ColB; objSelectedCriteria.Account100 = objBalanceColumn._Account100; if (objBalanceColumn._ForCompanyId > 0) { objSelectedCriteria.ForCompany = companies?.Where(x => x.CompanyId == objBalanceColumn._ForCompanyId).FirstOrDefault() as Company; } else { objSelectedCriteria.ForCompany = null; } objSelectedCriteria.Hide = objBalanceColumn._Hide; setColNameAndNumber(objSelectedCriteria, objCriteria.selectedCriteria.Count + 1); return(objSelectedCriteria); }
BalanceColumn CreateUpdateRow(SelectedCriteria objColCriteria, BalanceColumn row) { row._InclJournal = objColCriteria.AllJournals == true ? null : objColCriteria.journal; row._Name = objColCriteria.criteriaName; row._BudgetId = objColCriteria.budgetModel; row._FromDate = objColCriteria.frmdateval; row._ToDate = objColCriteria.todateval; row.ColumnFormatEnum = objColCriteria.balcolFormat; row.ColumnMethodEnum = objColCriteria.balcolMethod; row._ShowDebitCredit = objColCriteria._ShowDebitCredit; row._InvertSign = objColCriteria._InvertSign; row._InclPrimo = objColCriteria._InclPrimo; row._ColA = (byte)objColCriteria.colA; row._ColB = (byte)objColCriteria.colB; row.Dims1 = objColCriteria.dimval1; row.Dims2 = objColCriteria.dimval2; row.Dims3 = objColCriteria.dimval3; row.Dims4 = objColCriteria.dimval4; row.Dims5 = objColCriteria.dimval5; row._ForCompanyId = objColCriteria.ForCompany == null ? 0 : objColCriteria.ForCompany.CompanyId; row._Hide = objColCriteria._Hide; row._Account100 = objColCriteria.account100; return(row); }