public ActionResult EntryDuty() { string str = Request.Form["Str"]; string[] strs = str.Split(new char[] { ';' }); for (int i = 0; i < strs.Length - 1; i++) { string[] stu = strs[i].Split(new char[] { ',' }); MODEL.T_OnDuty duty1 = new MODEL.T_OnDuty() { StuNum = stu[1], Week = Convert.ToInt32(stu[0]) }; MODEL.T_OnDuty duty2 = new MODEL.T_OnDuty() { StuNum = stu[2], Week = Convert.ToInt32(stu[0]) }; try { OperateContext.Current.BLLSession.IOnDutyBLL.Add(duty1); OperateContext.Current.BLLSession.IOnDutyBLL.Add(duty2); } catch (Exception ex) { return OperateContext.Current.RedirectAjax("err", "录入失败,请您先查看值日录入表,是否同一周成员被多次录入!", null, null); } } return OperateContext.Current.RedirectAjax("ok", "修改成功", null, null); }
public ActionResult EntryDuty() { string str = Request.Form["Str"]; string[] strs = str.Split(new char[] { ';' }); for (int i = 0; i < strs.Length - 1; i++) { string[] stu = strs[i].Split(new char[] { ',' }); MODEL.T_OnDuty duty1 = new MODEL.T_OnDuty() { StuNum = stu[1], Week = Convert.ToInt32(stu[0]) }; MODEL.T_OnDuty duty2 = new MODEL.T_OnDuty() { StuNum = stu[2], Week = Convert.ToInt32(stu[0]) }; try { OperateContext.Current.BLLSession.IOnDutyBLL.Add(duty1); OperateContext.Current.BLLSession.IOnDutyBLL.Add(duty2); } catch (Exception ex) { return(OperateContext.Current.RedirectAjax("err", "录入失败,请您先查看值日录入表,是否同一周成员被多次录入!", null, null)); } } return(OperateContext.Current.RedirectAjax("ok", "修改成功", null, null)); }