//Author : Hiennv
        public int Insert(Contracts_AllowancesEN aContracts_AllowancesEN)
        {
            try
            {
                Contracts_Allowances aContracts_Allowances = new Contracts_Allowances();

                aContracts_Allowances.RealSalaryPlus = aContracts_AllowancesEN.RealSalaryPlus;
                aContracts_Allowances.CreatedDate = DateTime.Now;
                aContracts_Allowances.ApplyDate = aContracts_AllowancesEN.ApplyDate;
                aContracts_Allowances.Type = aContracts_AllowancesEN.Type;
                aContracts_Allowances.Status = aContracts_AllowancesEN.Status;
                aContracts_Allowances.Disable = aContracts_AllowancesEN.Disable;

                for (int i = 0; i < aContracts_AllowancesEN.aListAllowances.Count; i++)
                {
                    aContracts_Allowances.IDAllowance = aContracts_AllowancesEN.aListAllowances[i].ID;
                    for (int j = 0; j < aContracts_AllowancesEN.aListAllowances[i].aListContracts.Count; j++)
                    {
                        aContracts_Allowances.IDContract = aContracts_AllowancesEN.aListAllowances[i].aListContracts[j].ID;
                        aDatabaseDA.Contracts_Allowances.Add(aContracts_Allowances);
                        return aDatabaseDA.SaveChanges();
                    }
                }
                return 0;
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("Contracts_AllowancesBO.Insert :"+ ex.Message.ToString()));
            }
        }
 //Author : Hiennv
 public int Update(Contracts_Allowances aContracts_Allowances)
 {
     try
     {
         aDatabaseDA.Contracts_Allowances.AddOrUpdate(aContracts_Allowances);
         return aDatabaseDA.SaveChanges();
     }
     catch (Exception ex)
     {
         throw new Exception(string.Format("Contracts_AllowancesBO.Update :"+ ex.Message.ToString()));
     }
 }