/// <summary> /// 增高页面 /// </summary> /// <param name="d"></param> /// <param name="nd"></param> /// <returns></returns> public ActionResult zg(string d, string nd) { //CommonViewAreasByTemplateName(d, nd, "zg.txt", true); //CommonViewAreasByTemplateName(d, nd, "zg1.txt", false); //CommonView(d, nd); ViewBag.TemplateConntent = TemplateBLL.GetTemplate(DN.WeiAd.Business.Config.AppConfig.TemplatePath); return(View()); }
/// <summary> /// 获取加密模版文件 /// </summary> /// <param name="filename"></param> /// <returns></returns> public string GetTemplateByNameEncode(string filename) { string filepath = Server.MapPath(string.Format("/Resources/Template/{0}", filename)); string html = ""; html = TemplateBLL.GetTemplate(filepath); return(html); }
public ActionResult DeleteTemplate(int Id) { var result = new TemplateBLL().DeleteDataById(Id); var response = new ResponseEntity <int>(result.Success, result.Message, result.Data); new LogBLL().LogEvent(CurrenUserInfo.LoginName, GDS.Entity.Constant.ConstantDefine.ModuleTemplate, GDS.Entity.Constant.ConstantDefine.TypeDelete, GDS.Entity.Constant.ConstantDefine.ActionDeleteTemplate, $"{Id}"); return(Json(response, JsonRequestBehavior.AllowGet)); }
public ActionResult VerifyAduitRight(int TemplateId) { var ok = new TemplateBLL().VerifyAduitRight(CurrenUserInfo.LoginName, CurrenUserInfo.UserType, TemplateId); if (ok) { return(Json(new ResponseEntity <object>(0, "", true), JsonRequestBehavior.AllowGet)); } else { return(Json(new ResponseEntity <object>(-999, "权限不足", false), JsonRequestBehavior.AllowGet)); } }
public ActionResult GetTemplateById(int Id) { var result = new TemplateBLL().GetDataById(Id); if (result != null) { var response = new ResponseEntity <Template>(true, ConstantDefine.TipQuerySuccess, result); return(Json(response, JsonRequestBehavior.AllowGet)); } else { var response = new ResponseEntity <Template>(ConstantDefine.TipQueryFail); return(Json(response, JsonRequestBehavior.AllowGet)); } }
/// <summary> /// 增高 /// </summary> /// <param name="d"></param> /// <param name="nd"></param> /// <returns></returns> public ActionResult zg(string d, string nd) { //CommonView(d, nd); //skey edit 2017-11-20 string html = TemplateBLL.GetTemplate(DN.WeiAd.Business.Config.AppConfig.TemplatePathDynamic); if (!string.IsNullOrEmpty(d)) { var adinfo = AdPageInfoBLL.Instance.GetModelById(int.Parse(d)); if (adinfo != null) { html = html.Replace("@ViewBag.QcodeImg2", adinfo.QcodeImg2); } } ViewBag.TemplateConntent = html; return(View()); }
public ActionResult SaveTemplate(Template entity) { ResponseEntity <int> response; if (entity.Id == 0) { // var list = new TemplateBLL().GetDataByName(entity.Name); if (list != null && list.Count > 0) { return(Json(new ResponseEntity <object>(-999, "项目模板名称已存在", ""), JsonRequestBehavior.AllowGet)); } entity.IsDelete = 0; entity.CreateBy = CurrenUserInfo.LoginName; entity.CreateTime = DateTime.Now; entity.UpdateBy = ""; entity.UpdateTime = DateTime.Now; var result = new TemplateBLL().InsertTemplate(entity); response = new ResponseEntity <int>(result.Success, result.Message, result.Data); new LogBLL().LogEvent(CurrenUserInfo.LoginName, GDS.Entity.Constant.ConstantDefine.ModuleTemplate, GDS.Entity.Constant.ConstantDefine.TypeAdd, GDS.Entity.Constant.ConstantDefine.ActionSaveTemplate, $"{result.Data}"); } else { entity.UpdateBy = CurrenUserInfo.LoginName; entity.UpdateTime = DateTime.Now; var result = new TemplateBLL().UpdateTemplate(entity); response = new ResponseEntity <int>(result.Success, result.Message, result.Data); new LogBLL().LogEvent(CurrenUserInfo.LoginName, GDS.Entity.Constant.ConstantDefine.ModuleTemplate, GDS.Entity.Constant.ConstantDefine.TypeUpdate, GDS.Entity.Constant.ConstantDefine.ActionUpdateTemplate, $"{entity.Id}"); } return(Json(response, JsonRequestBehavior.AllowGet)); }
public ActionResult UpdateStatus(int Id, int Status) { //var entity = new TemplateBLL().GetDataById(Id); //if (entity != null && entity.Status == Status) //{ // return Json(new ResponseEntity<object>(0, "不能重复设置模板状态", ""), JsonRequestBehavior.AllowGet); //} var ok = new TemplateBLL().VerifyAduitRight(CurrenUserInfo.LoginName, CurrenUserInfo.UserType, Id); if (!ok) { return(Json(new ResponseEntity <object>(-999, "权限不足", ""), JsonRequestBehavior.AllowGet)); } var result = new TemplateBLL().UpdateStatus(Id, Status); var response = new ResponseEntity <int>(result.Success, result.Message, result.Data); new LogBLL().LogEvent(CurrenUserInfo.LoginName, GDS.Entity.Constant.ConstantDefine.ModuleTemplate, GDS.Entity.Constant.ConstantDefine.TypeUpdate, GDS.Entity.Constant.ConstantDefine.ActionAudit, $"{Id}"); return(Json(response, JsonRequestBehavior.AllowGet)); }
public string GetTemplateText(string templateTypeName) { var template = TemplateBLL.GetFirstByTypeName(templateTypeName); return(template == null ? string.Empty : template.TemplateText); }
public ActionResult GetApprovalList() { try { var queryParams = new NameValueCollection(); if (!ParamHelper.CheckParaQ(ref queryParams)) { return(Json(new ResponseEntity <int>(RegularFunction.RegularSqlRegexText), JsonRequestBehavior.AllowGet)); } var query = new TemplateQuery(queryParams); var sqlCondition = new StringBuilder(); sqlCondition.Append("ISNULL(IsDelete,0)!=1 and status=0");//Status审批状态为0(草稿),1同意,2拒绝 int userType = CurrenUserInfo.UserType; string loginName = CurrenUserInfo.LoginName; if (userType != GDS.Entity.Constant.ConstantDefine.Admin) //验证审批权限 { var departmentList = new DepartmentBLL().GetDepartmentByAuditor(loginName); if (departmentList != null && departmentList.Count > 0) { sqlCondition.Append($" and DepartId in ({string.Join(",", departmentList.Select(x => x.Id))}) "); } else { return(Json(new ResponseEntity <dynamic>(10, "权限不足", null), JsonRequestBehavior.AllowGet)); } } if (!string.IsNullOrEmpty(query.DepartId) && query.DepartId != "0") { sqlCondition.Append($" and DepartId = {query.DepartId}"); } if (!string.IsNullOrEmpty(query.ProjectType)) { sqlCondition.Append($" and ProjectType = {query.ProjectType}"); } if (!string.IsNullOrEmpty(query.Name)) { sqlCondition.Append($" and Name like '%{query.Name}%'"); } if (!string.IsNullOrEmpty(query.CreateBy)) { sqlCondition.Append($" and CreateBy like '%{query.CreateBy}%'"); } PageRequest preq = new PageRequest { TableName = " [View_Template] ", Where = sqlCondition.ToString(), Order = " Id DESC ", IsSelect = true, IsReturnRecord = true, PageSize = query.PageSize, PageIndex = query.PageIndex, FieldStr = "*" }; var result = new TemplateBLL().GetView_TemplateByPage(preq); result.ForEach(template => { template.CreateTimeStr = template.CreateTime.HasValue ? template.CreateTime.Value.ToString("yyyy-MM-dd") : string.Empty; }); var response = new ResponseEntity <object>(true, string.Empty, new DataGridResultEntity <View_Template> { TotalRecords = preq.Out_AllRecordCount, DisplayRecords = preq.Out_PageCount, ResultData = result }); return(Json(response, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { return(Json(new ResponseEntity <object>(-999, string.Empty, ""), JsonRequestBehavior.AllowGet)); } }
public ActionResult GetTemplateList() { try { var queryParams = new NameValueCollection(); if (!ParamHelper.CheckParaQ(ref queryParams)) { return(Json(new ResponseEntity <int>(RegularFunction.RegularSqlRegexText), JsonRequestBehavior.AllowGet)); } var query = new TemplateQuery(queryParams); var sqlCondition = new StringBuilder(); sqlCondition.Append("ISNULL(IsDelete,0)!=1 and Status=1"); if (!string.IsNullOrEmpty(query.DepartId)) { sqlCondition.Append($" and DepartId = {query.DepartId}"); } if (!string.IsNullOrEmpty(query.ProjectType)) { sqlCondition.Append($" and ProjectType = {query.ProjectType}"); } if (!string.IsNullOrEmpty(query.Name)) { sqlCondition.Append($" and Name like '%{query.Name}%'"); } if (!string.IsNullOrEmpty(query.CreateBy)) { sqlCondition.Append($" and CreateBy like '%{query.CreateBy}%'"); } PageRequest preq = new PageRequest { TableName = " [View_Template] ", Where = sqlCondition.ToString(), Order = " Id DESC ", IsSelect = true, IsReturnRecord = true, PageSize = query.PageSize, PageIndex = query.PageIndex, FieldStr = "*" }; var result = new TemplateBLL().GetView_TemplateByPage(preq); result.ForEach(template => { template.CreateTimeStr = template.CreateTime.HasValue ? template.CreateTime.Value.ToString("yyyy-MM-dd") : string.Empty; }); var response = new ResponseEntity <object>(true, string.Empty, new DataGridResultEntity <View_Template> { TotalRecords = preq.Out_AllRecordCount, DisplayRecords = preq.Out_PageCount, ResultData = result }); return(Json(response, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { return(Json(new ResponseEntity <object>(-999, string.Empty, ""), JsonRequestBehavior.AllowGet)); } }
private List <View_Template> getTemplateApprovalList(NameValueCollection queryParams, List <Department> departmentList) { try { var query = new TemplateQuery(queryParams); var sqlCondition = new StringBuilder(); sqlCondition.Append("ISNULL(IsDelete,0)!=1 and status=0");//Status审批状态为0(草稿),1同意,2拒绝 if (departmentList != null && departmentList.Count > 0) { sqlCondition.Append($" and DepartId in ({string.Join(",", departmentList.Select(x => x.Id))}) "); } //if (userType != GDS.Entity.Constant.ConstantDefine.Admin) //验证审批权限 //{ // var departmentList = new DepartmentBLL().GetDepartmentByAuditor(loginName); // if (departmentList != null && departmentList.Count > 0) // { // sqlCondition.Append($" and DepartId in ({string.Join(",", departmentList.Select(x => x.Id))}) "); // } // else // { // return Json(new ResponseEntity<dynamic>(10, "权限不足", null), JsonRequestBehavior.AllowGet); // } //} if (!string.IsNullOrEmpty(query.DepartId) && query.DepartId != "0") { sqlCondition.Append($" and DepartId = {query.DepartId}"); } if (!string.IsNullOrEmpty(query.ProjectType)) { sqlCondition.Append($" and ProjectType = {query.ProjectType}"); } if (!string.IsNullOrEmpty(query.Name)) { sqlCondition.Append($" and Name like '%{query.Name}%'"); } if (!string.IsNullOrEmpty(query.CreateBy)) { sqlCondition.Append($" and CreateBy like '%{query.CreateBy}%'"); } PageRequest preq = new PageRequest { TableName = " [View_Template] ", Where = sqlCondition.ToString(), Order = " Id DESC ", IsSelect = true, IsReturnRecord = true, PageSize = query.PageSize, PageIndex = query.PageIndex, FieldStr = "*" }; var result = new TemplateBLL().GetView_TemplateByPage(preq); result.ForEach(template => { template.CreateTimeStr = template.CreateTime.HasValue ? template.CreateTime.Value.ToString("yyyy-MM-dd") : string.Empty; }); //var response = new ResponseEntity<object>(true, string.Empty, // new DataGridResultEntity<View_Template> // { // TotalRecords = preq.Out_AllRecordCount, // DisplayRecords = preq.Out_PageCount, // ResultData = result // }); return(result); //Json(response, JsonRequestBehavior.AllowGet); } catch (Exception ex) { return(new List <View_Template>()); } }