//Author : Hiennv
 public int Update(SystemUsers_Divisions aSystemUsers_Divisions)
 {
     try
     {
         aDatabaseDA.SystemUsers_Divisions.AddOrUpdate(aSystemUsers_Divisions);
         return aDatabaseDA.SaveChanges();
     }
     catch (Exception ex)
     {
         throw new Exception(string.Format("SystemUsers_DivisionsBO.Update :"+ ex.Message.ToString()));
     }
 }
        //Author : Hiennv
        public void InsertSystemUsersToDivisions(SystemUsers_DivisionsEN aSystemUsers_DivisionsEN)
        {
            try
            {
                SystemUsers_DivisionsBO aSystemUsers_DivisionsBO;
                List<SystemUsers_Divisions> aListTemp;
                SystemUsers_Divisions aSystemUsers_Divisions = new SystemUsers_Divisions();
                aSystemUsers_Divisions.CreatedDate = DateTime.Now;
                aSystemUsers_Divisions.AvaiableDate = aSystemUsers_DivisionsEN.AvaiableDate;
                aSystemUsers_Divisions.Type = aSystemUsers_DivisionsEN.Type;
                aSystemUsers_Divisions.Status = aSystemUsers_DivisionsEN.Status;
                aSystemUsers_Divisions.Disable = aSystemUsers_DivisionsEN.Disable;
                aSystemUsers_Divisions.ExpireDate = aSystemUsers_DivisionsEN.ExpireDate;

                for (int i = 0; i < aSystemUsers_DivisionsEN.aListDivisionsEN.Count; i++)
                {
                    aSystemUsers_Divisions.IDDivision = aSystemUsers_DivisionsEN.aListDivisionsEN[i].ID;

                    for (int j = 0; j < aSystemUsers_DivisionsEN.aListDivisionsEN[i].aListSystemUsers.Count; j++)
                    {
                        aSystemUsers_DivisionsBO = new SystemUsers_DivisionsBO();
                        aSystemUsers_Divisions.IDSystemUser = aSystemUsers_DivisionsEN.aListDivisionsEN[i].aListSystemUsers[j].ID;
                        aListTemp = new List<SystemUsers_Divisions>();
                        aListTemp = aSystemUsers_DivisionsBO.Select_ByIDSystemUsersAndIDDivisionAndDisable(aSystemUsers_DivisionsEN.aListDivisionsEN[i].ID, aSystemUsers_DivisionsEN.aListDivisionsEN[i].aListSystemUsers[j].ID, false);
                        if (aListTemp.Count > 0)
                        {
                            foreach (SystemUsers_Divisions item in aListTemp)
                            {

                                SystemUsers_Divisions aTemp = aSystemUsers_DivisionsBO.Select_ByID(item.ID);
                                aTemp.Disable = true;
                                aSystemUsers_DivisionsBO.Update(aTemp);
                            }
                        }
                        aDatabaseDA.SystemUsers_Divisions.Add(aSystemUsers_Divisions);
                        aDatabaseDA.SaveChanges();
                    }
                }

            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("ReceptionTaskBO.InsertSystemUsersToDivisions :" + ex.Message.ToString()));
            }
        }