コード例 #1
0
        //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);
            }
        }