public int UpdateOfficeGroup(OfficeGroup OfficeGroup)
        {
            try
            {
                int ReturnValue = 0;

                SqlCommand sqlCmd = new SqlCommand();
                sqlCmd.CommandType = CommandType.StoredProcedure;

                sqlCmd.Parameters.Add(GetParameter("@ReturnValue", SqlDbType.Int, ReturnValue)).Direction = ParameterDirection.Output;

                sqlCmd.Parameters.Add(GetParameter("@OfficeGroupID", SqlDbType.Int, OfficeGroup.OfficeGroupID));
                sqlCmd.Parameters.Add(GetParameter("@OfficeGroupName", SqlDbType.VarChar, OfficeGroup.OfficeGroupName));
                sqlCmd.Parameters.Add(GetParameter("@OfficeGroupDescription", SqlDbType.VarChar, OfficeGroup.OfficeGroupDescription));
                sqlCmd.Parameters.Add(GetParameter("@ModifiedBy", SqlDbType.Int, Micro.Commons.Connection.LoggedOnUser.UserID));

                sqlCmd.CommandText = "pADM_OfficeGroups_Update";

                ExecuteStoredProcedure(sqlCmd);

                return(int.Parse(sqlCmd.Parameters[0].Value.ToString()));
            }
            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 static int InsertOfficeGroup(OfficeGroup OfficeGroup)
 {
     try
     {
         return(OfficeGroupsDataAccess.GetInstance.InsertOfficeGroup(OfficeGroup));
     }
     catch (Exception ex)
     {
         throw (new Exception(MethodBase.GetCurrentMethod().DeclaringType.ToString() + "." + (new System.Diagnostics.StackFrame()).GetMethod().Name, ex));
     }
 }
        public static OfficeGroup ConvertFromDatarowToObject(DataRow dataRow)
        {
            try
            {
                OfficeGroup OfficeGroup = new OfficeGroup();

                if (dataRow != null)
                {
                    OfficeGroup.OfficeGroupID          = int.Parse(dataRow["OfficeGroupID"].ToString());
                    OfficeGroup.OfficeGroupName        = dataRow["OfficeGroupName"].ToString();
                    OfficeGroup.OfficeGroupDescription = dataRow["OfficeGroupDescription"].ToString();
                    OfficeGroup.IsActive  = (bool)dataRow["IsActive"];
                    OfficeGroup.IsDeleted = (bool)dataRow["IsDeleted"];
                }
                return(OfficeGroup);
            }
            catch (Exception ex)
            {
                throw (new Exception(MethodBase.GetCurrentMethod().DeclaringType.ToString() + "." + (new System.Diagnostics.StackFrame()).GetMethod().Name, ex));
            }
        }