Beispiel #1
0
        /// <summary>
        /// 添加公司部门
        /// </summary>
        /// <param name="companyDept"></param>
        /// <returns></returns>
        public static int AddCompanyDept(Model.CompanyDeptModel companyDept)
        {
            int i = -1;

            try
            {
                SqlParameter[] paras = new SqlParameter[] {
                    GetSqlParameter("@Dept", SqlDbType.NVarChar, companyDept.Dept),
                    GetSqlParameter("@AddDate", SqlDbType.DateTime, companyDept.Adddate)
                };
                i = DBHelper.ExecuteNonQuery("AddCompanyDept", paras, CommandType.StoredProcedure);
            }
            catch (SqlException)
            {
                throw new Exception("添加公司部门信息产生异常!");
            }
            return(i);
        }
Beispiel #2
0
        /// <summary>
        /// ds2012
        /// 修改部门信息
        /// </summary>
        /// <param name="companyDept">部门信息</param>
        /// <returns></returns>
        public static int UptCompanyDept(Model.CompanyDeptModel companyDept)
        {
            int i = -1;

            try
            {
                SqlParameter[] paras = new SqlParameter[] {
                    GetSqlParameter("@Dept", SqlDbType.NVarChar, companyDept.Dept),
                    GetSqlParameter("@ID", SqlDbType.Int, companyDept.Id)
                };
                i = DBHelper.ExecuteNonQuery("UptCompanyDept", paras, CommandType.StoredProcedure);
            }
            catch (SqlException)
            {
                throw new Exception("修改公司部门信息产生异常!");
            }
            return(i);
        }