Example #1
0
 public string AddAuthoritys()
 {
     string auth_code = Request["auth_code"];
     string auth_name = Request["auth_name"];
     string auth_remark = Request["auth_remark"];
     var b_Authority = new AutekInfo.BLL.Emp_Authority();
     var list = b_Authority.GetModelList(String.Format("auth_code='{0}' or auth_name='{1}'", auth_code, auth_name));
     if (list.Count > 0)
     {
         return "该权限已存在!";
     }
     var m = new AutekInfo.Model.Emp_Authority();
     m.auth_code = auth_code;
     m.auth_name = auth_name;
     m.auth_remark = auth_remark;
     return b_Authority.Add(m).ToString();
 }
Example #2
0
        public ActionResult OutPutAuthoritys()
        {
            List<AutekInfo.Common.ExcTitvsFeilds> list_excelTitle = new List<AutekInfo.Common.ExcTitvsFeilds>();

            list_excelTitle.Add(new AutekInfo.Common.ExcTitvsFeilds() { title = "ID", feild = "auth_id" });
            list_excelTitle.Add(new AutekInfo.Common.ExcTitvsFeilds() { title = "权限代码", feild = "auth_code" });
            list_excelTitle.Add(new AutekInfo.Common.ExcTitvsFeilds() { title = "权限描述", feild = "auth_remark" });

            var b_Authority = new AutekInfo.BLL.Emp_Authority();
            List<AutekInfo.Model.Emp_Authority> list_m = b_Authority.GetModelList("");
            // return b_Authority.DeleteList(ids).ToString().ToLower();
            string temp_filepath = AutekInfo.Common.ExcelHelper.OutputList(list_excelTitle, list_m);
            return File(temp_filepath, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "导出Authoritys.xlsx");
        }
Example #3
0
 public string GetAuthoritys()
 {
     var b_Authority = new AutekInfo.BLL.Emp_Authority();
     var list = b_Authority.GetModelList("");
     return JsonConvert.SerializeObject(list);
 }
Example #4
0
 public string EditAuthoritys()
 {
     int auth_id = int.Parse(Request["auth_id"].ToString());
     string auth_code = Request["auth_code"].ToString();
     string auth_name = Request["auth_name"].ToString();
     string auth_remark = Request["auth_remark"].ToString();
     var b_Authority = new AutekInfo.BLL.Emp_Authority();
     var m_Authority = b_Authority.GetModel(auth_id);
     if (m_Authority.auth_code != auth_code || m_Authority.auth_name != auth_name)
     {
         var _list = b_Authority.GetModelList(String.Format(" auth_name='{0}' or auth_code='(1)' ", auth_name, auth_code));
         if (_list.Count > 0)
         {
             return "权限名或代码重复!";
         }
     }
     m_Authority.auth_code = auth_code;
     m_Authority.auth_name = auth_name;
     m_Authority.auth_remark = auth_remark;
     return b_Authority.Update(m_Authority).ToString().ToLower();
 }