Ejemplo n.º 1
0
        /// <summary>
        /// 修改部门
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool UpdateDepart(AuthorityDepartmentModel model)
        {
            string        sql          = @" UPDATE AuthorityDepartment set DepartName=@DepartName where id=@id ";
            IDbParameters dbParameters = DbHelper.CreateDbParameters();

            dbParameters.AddWithValue("id", model.Id);
            dbParameters.AddWithValue("DepartName", model.DepartName);
            int i = DbHelper.ExecuteNonQuery(SuperMan_Write, sql, dbParameters);

            return(i > 0);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 修改部门
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool UpdateDepartment(AuthorityDepartmentModel model)
        {
            bool reslut;

            try
            {
                reslut = authoritySetDao.UpdateDepart(model);
            }
            catch (Exception ex)
            {
                reslut = false;
                LogHelper.LogWriterFromFilter(ex);
            }
            return(reslut);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 增加部门
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool AddDepart(AuthorityDepartmentModel model)
        {
            string        sql          = @" INSERT INTO AuthorityDepartment (ParId,DepartName,BeLock) VALUES (@ParId,@DepartName,@BeLock);select @@IDENTITY as InsertId; ";
            IDbParameters dbParameters = DbHelper.CreateDbParameters();

            dbParameters.AddWithValue("ParId", model.ParId);
            dbParameters.AddWithValue("DepartName", model.DepartName);
            dbParameters.AddWithValue("BeLock", model.BeLock);
            object i = DbHelper.ExecuteScalar(SuperMan_Write, sql, dbParameters);

            if (i != null)
            {
                return(int.Parse(i.ToString()) > 0);
            }
            return(false);
        }
        public JsonResult UpdateDepart(AuthorityDepartmentModel mod)
        {
            bool b = _iAuhority.UpdateDepartment(mod);

            return(Json(b ? new ResultModel(true, string.Empty) : new ResultModel(false, "修改失败!"), JsonRequestBehavior.AllowGet));
        }