public JObject Edit(JObject pagerParas) { StudentSignBLL studentSignBLL = new StudentSignBLL(); studentSignBLL.Add(pagerParas); return(new JObject()); }
/// <summary> /// 微信端提交勾班数据 /// </summary> /// <param name="value"></param> /// <returns></returns> public JObject Greate(JObject value) { JObject reslut = new JObject(); int signID = value["signID"].Value <int>(); value.Remove("signID"); EF.StudentSignInfo info = new EF.StudentSignInfo(); var studentInfo = new StudentBLL().GetCurrentStudent(Request); StudentSignBLL bll = new StudentSignBLL(); if (studentInfo != null && signID > -1) { //如果已经保存过了则直接返回 if (bll.Find(item => item.SignID == signID && item.StudentID == studentInfo.ID).Any()) { reslut["msg"] = "保存无效,不能再许改!"; return(reslut); } var list = value["list"].ToObject <List <bool> >(); info.FirstDay_Morning = list[0]; info.FirstDay_Afternoon = list[1]; info.FirstDay_Evening = list[2]; info.SecondDay_Morning = list[3]; info.SecondDay_Afternoon = list[4]; info.SecondDay_Evening = list[5]; info.ThirdDay_Morning = list[6]; info.ThirdDay_Afternoon = list[7]; info.ThirdDay_Evening = list[8]; info.FourthDay_Morning = list[9]; info.FourthDay_Afternoon = list[10]; info.FourthDay_Evening = list[11]; info.FifthDay_Morning = list[12]; info.FifthDay_Afternoon = list[13]; info.FifthDay_Evening = list[14]; info.SixthDay_Morning = list[15]; info.SixthDay_Afternoon = list[16]; info.SixthDay_Evening = list[17]; info.SeventhDay_Morning = list[18]; info.SeventhDay_Afternoon = list[19]; info.SeventhDay_Evening = list[20]; info.SignID = signID; info.StudentID = studentInfo.ID; info.CreateTime = DateTime.Now; if (bll.Add(info) == 1) { reslut["status"] = true; return(reslut); } reslut["msg"] = "保存出错!"; return(reslut); } return(null); }
public string Add(JObject pagerParas) { var id = HttpContext.Current.Request.QueryString["id"]; //var form = HttpContext.Current.Request.Form; StudentSignBLL studentSignBLL = new StudentSignBLL(); if (id != null && Int32.Parse(id) > 0) { studentSignBLL.Updata(pagerParas, Int32.Parse(id)); } else { try { pagerParas.Remove("ID"); } catch (Exception ex) { } studentSignBLL.Add(pagerParas); } return("1"); }