Esempio n. 1
0
        /// <summary>
        /// 删除权限
        /// </summary>
        /// <returns></returns>
        public ActionResult DeleteFunction()
        {
            var request = GetParams<List<string>>();

            if (request != null && request.Count > 0)
            {
                foreach (string str in request)
                {
                    Functions entity = new Functions()
                    {
                        SysNo = int.Parse(str),
                        Status = Entity.Enums.CommonStatus.Deleted
                    };
                    this.SetEntityBase(entity, false);
                    FunctionsMgtService.Instance.UpdateFunctionsStatusBySysNo(entity);
                }
            }

            PortalResult result = new PortalResult()
            {
                Code = 0,
                Success = true,
                Data = true,
                Message = ""
            };
            return View(result);
        }
 /// <summary>
 /// 添加权限
 /// </summary>
 /// <param name="entity">权限信息</param>
 /// <returns></returns>
 public static int InsertFunctions(Functions entity)
 {
     DataCommand cmd = DataCommandManager.GetDataCommand("InsertFunctions");
     cmd.SetParameterValue<Functions>(entity);
     cmd.ExecuteNonQuery();
     return Convert.ToInt32(cmd.GetParameterValue("@SysNo"));
 }
 /// <summary>
 /// 根据权限编号更新权限信息
 /// </summary>
 /// <param name="entity">权限信息</param>
 public static void UpdateFunctionsBySysNo(Functions entity)
 {
     DataCommand cmd = DataCommandManager.GetDataCommand("UpdateFunctionsBySysNo");
     cmd.SetParameterValue<Functions>(entity);
     cmd.ExecuteNonQuery();
 }