//Hiennv public List<ContractsEN> LoadListContractsExpiring(DateTime dateChoose) { try { ReceptionTaskBO aReceptionTaskBO = new ReceptionTaskBO(); List<ContractsEN> aListTemp = aReceptionTaskBO.GetListContractsExpiring(dateChoose); List<ContractsEN> aListContractsEN = new List<ContractsEN>(); ContractsEN aContractsEN; foreach (ContractsEN item in aListTemp) { aContractsEN = new ContractsEN(); aContractsEN.ID = item.ID; aContractsEN.CreatedDate = item.CreatedDate; aContractsEN.ContractDate = item.ContractDate; aContractsEN.NumberContract = item.NumberContract; aContractsEN.NumberTemplateContract = item.NumberTemplateContract; aContractsEN.IDSystemUser = item.IDSystemUser; aContractsEN.Company = item.Company; aContractsEN.StatutoryRepresent = item.StatutoryRepresent; aContractsEN.StatutoryRepresentGender = item.StatutoryRepresentGender; aContractsEN.StatutoryRepresentIdentifier = item.StatutoryRepresentIdentifier; aContractsEN.ContractType = item.ContractType; if (item.ContractType > 0) { aContractsEN.DisplayContractType = CORE.CONSTANTS.SelectedContractType(Convert.ToInt32(item.ContractType)).Name; } aContractsEN.FromDate = item.FromDate; aContractsEN.ToDate = item.ToDate; aContractsEN.SkuTableSalary = item.SkuTableSalary; aContractsEN.Coefficent = item.Coefficent; aContractsEN.SalaryNet = item.SalaryNet; aContractsEN.SalaryCross = item.SalaryCross; aContractsEN.Type = item.Type; aContractsEN.Status = item.Status; aContractsEN.Disable = item.Disable; aContractsEN.Name = item.Name; aContractsEN.Birthday = item.Birthday; aContractsEN.Identifier1 = item.Identifier1; aContractsEN.Phone = item.Phone; aContractsEN.Gender = item.Gender; if (item.Gender > 0) { aContractsEN.DisplayGender = CORE.CONSTANTS.SelectedGender(Convert.ToInt32(item.Gender)).Name; } aListContractsEN.Add(aContractsEN); } return aListContractsEN; } catch (Exception ex) { return null; MessageBox.Show("frmMain.LoadListContractExpiring\n" + ex.ToString(), "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public void ReloadData() { try { SystemUsersBO aSystemUsersBO = new SystemUsersBO(); ContractsBO aContractsBO = new ContractsBO(); colContractDate.DisplayFormat.FormatType = FormatType.DateTime; colContractDate.DisplayFormat.FormatString = "{0:dd/MM/yyyy}"; colFrom.DisplayFormat.FormatType = FormatType.DateTime; colFrom.DisplayFormat.FormatString = "{0:dd/MM/yyyy}"; colTo.DisplayFormat.FormatType = FormatType.DateTime; colTo.DisplayFormat.FormatString = "{0:dd/MM/yyyy}"; colCoefficent.DisplayFormat.FormatType = FormatType.Numeric; colCoefficent.DisplayFormat.FormatString = "{0:0,0}"; colSalaryNet.DisplayFormat.FormatType = FormatType.Numeric; colSalaryNet.DisplayFormat.FormatString = "{0:0,0}"; colSalaryCross.DisplayFormat.FormatType = FormatType.Numeric; colSalaryCross.DisplayFormat.FormatString = "{0:0,0}"; // Load data cho gridview List<ContractsEN> aListContractsEN = new List<ContractsEN>(); List<Contracts> aListTemp = aContractsBO.Select_All(); ContractsEN aContractsEN; for (int i = 0; i < aListTemp.Count; i++) { aContractsEN = new ContractsEN(); aContractsEN.SetValue(aListTemp[i]); aContractsEN.Name = aSystemUsersBO.Select_ByID(aListTemp[i].IDSystemUser).Name; aListContractsEN.Add(aContractsEN); } dgvContracts.DataSource = aListContractsEN; dgvContracts.RefreshDataSource(); } catch (Exception ex) { MessageBox.Show("frmLst_Contracts.ReloadData\n" + ex.ToString(), "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void ReloadGridView(int IDSystemUser) { ContractsBO aContractsBO = new ContractsBO(); SystemUsersBO aSystemUsersBO = new SystemUsersBO(); List<ContractsEN> aListContractsEN = new List<ContractsEN>(); List<Contracts> aListTemp = aContractsBO.Select_ByIDSystemUser(IDSystemUser); ContractsEN aContractsEN; if (aListTemp != null) { for (int i = 0; i < aListTemp.Count; i++) { aContractsEN = new ContractsEN(); aContractsEN.SetValue(aListTemp[i]); aContractsEN.Name = aSystemUsersBO.Select_ByID(aListTemp[i].IDSystemUser).Name; aListContractsEN.Add(aContractsEN); } } dgvContracts.DataSource = aListContractsEN; dgvContracts.RefreshDataSource(); }