private void InitController() { var type = typeof(hr_SalaryBoardInfo); var props = type.GetProperties(); var lstColumnCode = new List <SalaryBoardInfoColumnCodeModel>(); var index = 0; foreach (var item in props) { if (item.Name != "Id" && item.Name != "SalaryBoardId" && item.Name != "RecordId" && item.Name != "CreatedDate" && item.Name != "EditedDate") { index++; var columnModel = new SalaryBoardInfoColumnCodeModel() { Id = index, Name = item.Name }; lstColumnCode.Add(columnModel); } } cbxChoseFieldFixedStore.DataSource = lstColumnCode; cbxChoseFieldFixedStore.DataBind(); if (string.IsNullOrEmpty(hdfConfigId.Text)) { btnAdd.Disabled = true; btnEdit.Disabled = true; btnDelete.Disabled = true; wdConfigList.Show(); } else { var payroll = sal_PayrollConfigServices.GetById(Convert.ToInt32(hdfConfigId.Text)); if (payroll != null) { gridSalaryConfig.Title = payroll.Name; } } }
/// <summary> /// /// </summary> private void InitController() { var type = typeof(hr_SalaryBoardInfo); var props = type.GetProperties(); var lstColumnCode = new List <SalaryBoardInfoColumnCodeModel>(); var lstColumnCodeFormula = new List <SalaryBoardInfoColumnCodeModel>(); var index = 0; //from field formula //add column TotalIncome lstColumnCodeFormula.Add(new SalaryBoardInfoColumnCodeModel() { Id = 0, Name = Constant.TotalIncome }); //add column IndividualTax lstColumnCodeFormula.Add(new SalaryBoardInfoColumnCodeModel() { Id = 1, Name = Constant.IndividualTax }); //add column IndividualTax lstColumnCodeFormula.Add(new SalaryBoardInfoColumnCodeModel() { Id = 2, Name = Constant.EnterpriseSocialInsurance }); //add column LaborerSocialInsurance lstColumnCodeFormula.Add(new SalaryBoardInfoColumnCodeModel() { Id = 3, Name = Constant.LaborerSocialInsurance }); //add column ActualSalary lstColumnCodeFormula.Add(new SalaryBoardInfoColumnCodeModel() { Id = 4, Name = Constant.ActualSalary }); cbxChoseFieldFormulaStore.DataSource = lstColumnCodeFormula; cbxChoseFieldFormulaStore.DataBind(); //from field value foreach (var item in props) { if (item.Name != "Id" && item.Name != "SalaryBoardId" && item.Name != "RecordId" && item.Name != "CreatedDate" && item.Name != "EditedDate") { index++; var columnModel = new SalaryBoardInfoColumnCodeModel() { Id = index, Name = item.Name }; lstColumnCode.Add(columnModel); } } cbxChoseFieldFixedStore.DataSource = lstColumnCode; cbxChoseFieldFixedStore.DataBind(); if (string.IsNullOrEmpty(hdfConfigId.Text)) { btnAdd.Disabled = true; btnEdit.Disabled = true; btnDelete.Disabled = true; //wdConfigList.Show(); } else { var payroll = sal_PayrollConfigServices.GetById(Convert.ToInt32(hdfConfigId.Text)); if (payroll != null) { gridSalaryConfig.Title = payroll.Name; } } }