public List <OfficeGroup> GetOfficeGroupsAll(bool showDeleted = false)
 {
     try
     {
         return(OfficeGroupIntegration.GetOfficeGroupsAll(showDeleted));
     }
     catch (Exception ex)
     {
         throw (new Exception(MethodBase.GetCurrentMethod().DeclaringType.ToString() + "." + (new System.Diagnostics.StackFrame()).GetMethod().Name, ex));
     }
 }
 public OfficeGroup GetOfficeGroupByOfficeGroupID(int OfficeGroupID)
 {
     try
     {
         return(OfficeGroupIntegration.GetOfficeGroupByOfficeGroupID(OfficeGroupID));
     }
     catch (Exception ex)
     {
         throw (new Exception(MethodBase.GetCurrentMethod().DeclaringType.ToString() + "." + (new System.Diagnostics.StackFrame()).GetMethod().Name, ex));
     }
 }
        //#region Data Fill Mathods( Fill Data Into DevxDataGrid,DevxLookupEdit)

        //public Boolean FillOfficeGroupsAll(Control Cnt, bool showDeleted = false)
        //{
        //    try
        //    {
        //        if (Cnt is DevExpress.XtraEditors.LookUpEdit)
        //        {
        //            ((DevExpress.XtraEditors.LookUpEdit)Cnt).Properties.DataSource = GetOfficeGroupsAll();
        //            ((DevExpress.XtraEditors.LookUpEdit)Cnt).Properties.ValueMember = "OfficeGroupName";
        //            ((DevExpress.XtraEditors.LookUpEdit)Cnt).Properties.DisplayMember = "OfficeGroupName";
        //            ((DevExpress.XtraEditors.LookUpEdit)Cnt).EditValue = "";
        //        }
        //        else if (Cnt is DevExpress.XtraGrid.GridControl)
        //        {
        //            ((DevExpress.XtraGrid.GridControl)Cnt).DataSource = GetOfficeGroupsAll(); ; ;
        //        }

        //        return true;
        //    }
        //    catch (Exception ex)
        //    {
        //        return false;
        //        throw (new Exception(MethodBase.GetCurrentMethod().DeclaringType.ToString() + "." + (new System.Diagnostics.StackFrame()).GetMethod().Name, ex));
        //    }
        //}

        //public Boolean FillOfficeGroupsByComapnyID(Control Cnt, int CompanyID = -1)
        //{
        //    try
        //    {
        //        if (Cnt is DevExpress.XtraEditors.LookUpEdit)
        //        {
        //            ((DevExpress.XtraEditors.LookUpEdit)Cnt).Properties.DataSource = GetOfficeGroupsByCompanyID(CompanyID);
        //            ((DevExpress.XtraEditors.LookUpEdit)Cnt).Properties.ValueMember = "OfficeGroupName";
        //            ((DevExpress.XtraEditors.LookUpEdit)Cnt).Properties.DisplayMember = "OfficeGroupName";
        //            ((DevExpress.XtraEditors.LookUpEdit)Cnt).EditValue = "";
        //        }
        //        else if (Cnt is DevExpress.XtraGrid.GridControl)
        //        {
        //            ((DevExpress.XtraGrid.GridControl)Cnt).DataSource = GetOfficeGroupsByCompanyID(CompanyID);
        //        }

        //        return true;
        //    }
        //    catch (Exception ex)
        //    {
        //        return false;
        //        throw (new Exception(MethodBase.GetCurrentMethod().DeclaringType.ToString() + "." + (new System.Diagnostics.StackFrame()).GetMethod().Name, ex));
        //    }
        //}

        //#endregion
        #endregion


        #region Office Group Template
        #region Declaration
        //public string DisplayMember = "OfficeGroupDescription";
        //public string ValueMember = "OfficeGroupID";
        #endregion

        #region Transactional Mathods(Insert,Update,Delete)

        public int InsertOfficeGroupTemplate(OfficeGroupTemplate officeGroupTemplate)
        {
            try
            {
                return(OfficeGroupIntegration.InsertOfficeGroupTemplate(officeGroupTemplate));
            }
            catch (Exception ex)
            {
                throw (new Exception(MethodBase.GetCurrentMethod().DeclaringType.ToString() + "." + (new System.Diagnostics.StackFrame()).GetMethod().Name, ex));
            }
        }
 public int UpdateOfficeGroup(OfficeGroup TheOfficeGroup)
 {
     try
     {
         return(OfficeGroupIntegration.UpdateOfficeGroup(TheOfficeGroup));
     }
     catch (Exception ex)
     {
         throw (new Exception(MethodBase.GetCurrentMethod().DeclaringType.ToString() + "." + (new System.Diagnostics.StackFrame()).GetMethod().Name, ex));
     }
 }
 public List <OfficeGroup> GetOfficeGroupsByCompanyID(int ComapnyID = -1)
 {
     try
     {
         return(OfficeGroupIntegration.GetOfficeGroupsByCompanyID(ComapnyID));
     }
     catch (Exception ex)
     {
         throw (new Exception(MethodBase.GetCurrentMethod().DeclaringType.ToString() + "." + (new System.Diagnostics.StackFrame()).GetMethod().Name, ex));
     }
 }