private void GetActStr(Point_List model, int listCount, int i) { StringBuilder actStr = new StringBuilder(); actStr.Append("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"250\"><tr><form name=\"upform\"><td width=\"70\">"); if (i > 0) { actStr.Append($"<select id=\"stepUp{model.Id}\" > "); for (int j = 1; j <= i; j++) { actStr.Append("<option value=\"" + j + "\">" + j + "</option>"); } actStr.Append($"</select><input type=\"button\" name=\"Submit2\" value=\"↑\" class=\"btn btn-default\" onclick=\"SetMove('{model.Id}','{model.ClassId}','up')\"> "); } actStr.Append("</td></form><form name=\"downform\"><td width=\"70\">"); if (i < listCount - 1) { actStr.Append($"<select id=\"stepDown{model.Id}\" > "); for (int j = 1; j <= listCount - i - 1; j++) { actStr.Append("<option value=\"" + j + "\">" + j + "</option>"); } actStr.Append($"</select><input type=\"button\" name=\"Submit2\" value=\"↓\" class=\"btn btn-default\" onclick=\"SetMove('{model.Id}','{model.ClassId}','down')\"> "); } actStr.Append("</td></form></tr></table>"); model.actStr = actStr.ToString(); }
public ActionResult PointEdit(int id = 0) { int pointId = RequestInt("pointId"); Point_Records record = null; if (id > 0) { record = Bll.BllPoint_Records.First(o => o.Id == id); if (record == null) { return(MessageBoxAndReturn("发生错误,记录不存在!")); } pointId = record.PointId.Value; } Point_List pointModel = null; if (pointId > 0) { pointModel = Bll.BllPoint_List.First(o => o.Id == pointId); if (pointModel == null) { return(MessageBoxAndReturn("积分项不存在!")); } } ViewBag.pointId = pointId; ViewBag.pointModel = pointModel; return(View(record)); }
public ActionResult Edit(int id = 0) { Point_List model = null; string classHtml = string.Empty; if (id > 0) { model = Bll.BllPoint_List.First(o => o.Id == id); classHtml = Bll.BllPoint_Class.Instance().ShowClass(0, model.ClassId.Value, true); } else { classHtml = Bll.BllPoint_Class.Instance().ShowClass(0, 0, true); } ViewBag.classHtml = classHtml; return(View(model)); }
public ActionResult Save() { int id = RequestInt("id"); int classid = RequestInt("classid"); string content = RequestString("content"); string pointname = RequestString("pointname"); int pointscore = RequestInt("pointscore"); string scoreremark = RequestString("scoreremark"); string counttime = RequestString("counttime"); bool countbyself = true;//RequestBool("countbyself"); string remark = RequestString("remark"); Point_List model = null; string classHtml = string.Empty; if (id > 0) { model = Bll.BllPoint_List.First(o => o.Id == id); model.ClassId = classid; model.PointName = pointname; model.PointScore = pointscore; model.ScoreRemark = scoreremark; model.CountBySelf = countbyself; model.CountTime = counttime; model.Remark = remark; model.ClassName = Bll.BllSys_Class <Point_Class> .Instance().GetClassName(classid); if (Bll.BllPoint_List.Update(model, o => o.Id == id) > 0) { return(LayerAlertSuccessAndRefresh("修改成功")); } else { return(LayerAlertSuccessAndRefresh("修改失败")); } } else { model = new Point_List(); model.BeLock = false; model.ClassId = classid; model.PointName = pointname; model.PointScore = pointscore; model.ClassName = Bll.BllSys_Class <Point_Class> .Instance().GetClassName(classid); model.CreateTime = DateTime.Now; model.CountBySelf = countbyself; model.CountTime = counttime; model.Remark = remark; model.Sequence = Bll.BllSys_Class <Point_List> .Instance().GetNextSequence("ClassId=" + classid); if (Bll.BllPoint_List.Insert(model) > 0) { return(LayerAlertSuccessAndRefresh("添加成功")); } else { return(LayerAlertSuccessAndRefresh("添加失败")); } } }