public ActionResult SaveTemplateMustContent(TemplateMustContent entity) { ResponseEntity <int> response; if (entity.Id == 0) { entity.IsDelete = 0; entity.CreateBy = ""; entity.CreateTime = DateTime.Now; entity.UpdateBy = ""; entity.UpdateTime = DateTime.Now; var result = new TemplateMustContentBLL().InsertTemplateMustContent(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.ActionSaveTemplateMustContent, $"{result.Data}"); } else { entity.UpdateBy = ""; entity.UpdateTime = DateTime.Now; var result = new TemplateMustContentBLL().UpdateTemplateMustContent(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.ActionUpdateTemplateMustContent, $"{entity.Id}"); } return(Json(response, JsonRequestBehavior.AllowGet)); }
public ActionResult DeleteTemplateMustContent(int Id) { var result = new TemplateMustContentBLL().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.ActionDeleteTemplateMustContent, $"{Id}"); return(Json(response, JsonRequestBehavior.AllowGet)); }
public ActionResult GetTemplateMustContentById(int Id) { var result = new TemplateMustContentBLL().GetDataById(Id); if (result != null) { var response = new ResponseEntity <TemplateMustContent>(true, ConstantDefine.TipQuerySuccess, result); return(Json(response, JsonRequestBehavior.AllowGet)); } else { var response = new ResponseEntity <TemplateMustContent>(ConstantDefine.TipQueryFail); return(Json(response, JsonRequestBehavior.AllowGet)); } }
public ActionResult GetTemplateMustContentList() { try { var queryParams = new NameValueCollection(); if (!ParamHelper.CheckParaQ(ref queryParams)) { return(Json(new ResponseEntity <int>(RegularFunction.RegularSqlRegexText), JsonRequestBehavior.AllowGet)); } var query = new TemplateMustContentQuery(queryParams); var sqlCondition = new StringBuilder(); sqlCondition.Append("ISNULL(IsDelete,0)!=1"); PageRequest preq = new PageRequest { TableName = " [TemplateMustContent] ", Where = sqlCondition.ToString(), Order = " Id ASC ", IsSelect = true, IsReturnRecord = true, PageSize = query.PageSize, PageIndex = query.PageIndex, FieldStr = "*" }; var result = new TemplateMustContentBLL().GetDataByPage(preq); var response = new ResponseEntity <object>(true, string.Empty, new DataGridResultEntity <TemplateMustContent> { 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)); } }