public ActionResult DeleteForWhere(string Where) { SystemParamModel.Delete(Where); LogDAL.AppendSQLLog(MTConfig.CurrentUserID, typeof(SystemParamModel)); return(JsonSuccess(DeleteSuccess)); }
public ActionResult SystemParamEdit(SystemParamModel model) { if (model.OrderNo != null && model.ParamName != null && model.ParamValue != null) { if (string.IsNullOrEmpty(model.ParamID)) { ViewData[EditFlag] = true; if (model.Insert() != null) { LogDAL.AppendSQLLog(MTConfig.CurrentUserID, typeof(SystemParamModel)); return(JsonSuccess("保存成功")); } return(JsonError("保存失败")); } else { ViewData[EditFlag] = true; if (model.Update() > 0) { LogDAL.AppendSQLLog(MTConfig.CurrentUserID, typeof(SystemParamModel)); return(JsonSuccess("保存成功")); } return(JsonError("保存失败")); } } else { return(JsonError("请填写完整信息")); } }
public ActionResult Delete(string id) { SystemParamModel.Delete(" where ParamID in (" + id + ")"); LogDAL.AppendSQLLog(MTConfig.CurrentUserID, typeof(SystemParamModel)); return(JsonSuccess(DeleteSuccess)); }
public ActionResult SystemParamDetails(object id) { ViewData[EditFlag] = true; var item = SystemParamModel.SingleOrDefault(id); return(View(item)); }
//------------------------------------------- 系统参数设定 lipl public IList <SystemParamModel> BuildSystemParamModels(IEnumerable <SystemParamInfo> systemParamInfos) { List <SystemParamModel> list = new List <SystemParamModel>(); foreach (SystemParamInfo info in systemParamInfos) { SystemParamModel item = new SystemParamModel { IDX = info.IDX, ITEM_CD = info.ITEM_CD, SLOT_TY = info.SLOT_TY, SLOT_SITE = info.SLOT_SITE, SLOT_X_DOT = info.SLOT_X_DOT, SLOT_Y_DOT = info.SLOT_Y_DOT, SLOT_Z_DOT = info.SLOT_Z_DOT, SLOT_U_DOT = info.SLOT_U_DOT, LIGHT_1 = info.LIGHT_1, LIGHT_2 = info.LIGHT_2, LIGHT_3 = info.LIGHT_3, LIGHT_4 = info.LIGHT_4, MO = info.MO, CRT_ID = info.CRT_ID, CRT_DT = info.CRT_DT, UPT_ID = info.UPT_ID, UPT_DT = info.UPT_DT }; list.Add(item); } return(list); }
public ActionResult SystemParamEdit(object id, int actiontype = 0) { ViewData[EditFlag] = true; if (actiontype == 1) { SystemParamModel model = new SystemParamModel(); return(View(model)); } else { SystemParamModel model = SystemParamModel.SingleOrDefault(id); return(View(model)); } }
public ActionResult SystemParamIndex(Page <SystemParamModel> model, string orderby) { ViewBag.orderby = orderby; if (model.CurrentPage <= 0) { model.CurrentPage = 1; } StringBuilder where = new StringBuilder(" where 1=1 "); if (model.Item != null) { if (model.Item.ParamID != null) { where.AppendFormat(" and ParamID = {0} ", model.Item.ParamID); } if (!string.IsNullOrEmpty(model.Item.ParamName)) { where.AppendFormat(" and ParamName like '%{0}%' ", model.Item.ParamName.Trim()); } if (model.Item.OrderNo != null) { where.AppendFormat(" and OrderNo = {0} ", model.Item.OrderNo); } } if (string.IsNullOrEmpty(orderby)) { where.AppendFormat(" Order by OrderNo desc"); } else { where.AppendFormat(" order by " + orderby); } var page = SystemParamModel.Page(model.CurrentPage, MTConfig.ItemsPerPage, where.ToString(), model.Item); page.Item = model.Item; LogDAL.AppendSQLLog(MTConfig.CurrentUserID, typeof(SystemParamModel)); return(View(page)); }