public ActionResult Details(string id) { try { var qserial = DaoDetailserial.GetEntity("SERIALID", id); qserial.SYS_QUEUESERIAL = DaoQueueserial.GetEntity("Q_SERIALID", qserial.SSQUEUESERIALID); qserial.SYS_DLSERIAL = DaoDlserial.GetEntity("DLS_SERIALID", qserial.SSDLSERIALID); return(View(qserial)); } catch (Exception ex) { LogHelper.ErrorLog("系统出错!", ex); return(Redirect("/Home/Error")); } }
public ActionResult Delete(string id) { try { var arrid = id.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries); foreach (var _id in arrid) { DaoDetailserial.DeleteObject(DaoDetailserial.GetEntity("SERIALID", _id)); } return(RedirectToAction("/")); } catch (Exception ex) { LogHelper.ErrorLog("系统出错!", ex); return(Redirect("/Home/Error")); } }
private SYS_DETAILSERIAL GetEdtModel(string id) { try { var detailSerial = DaoDetailserial.GetEntity("SERIALID", id); var list1 = new SelectList(DaoDlserial.FindList(), "DLS_SERIALID", "DLS_SERIALNAME", detailSerial.SSDLSERIALID); ViewData["DLSERIAL"] = list1; var list2 = new SelectList(DaoQueueserial.FindList(), "Q_SERIALID", "Q_SERIALNAME", detailSerial.SSQUEUESERIALID); ViewData["QUSERIAL"] = list2; return(detailSerial); } catch (Exception ex) { LogHelper.ErrorLog("系统出错!", ex); return(null); } }
private void CHKValid(SYS_DETAILSERIAL detailSerial, bool isEdit = false) { if (string.IsNullOrEmpty(detailSerial.SERIALID)) { ModelState.AddModelError("SERIALID", "事项编码不能为空!"); } else if (!isEdit && DaoDetailserial.GetEntity("SERIALID", detailSerial.SERIALID) != null) { ModelState.AddModelError("SERIALID", "事项编码已经存在!"); } if (string.IsNullOrEmpty(detailSerial.SERIALNAME)) { ModelState.AddModelError("SERIALNAME", "业务名称不能为空!"); } else { SYS_DETAILSERIAL exist = DaoDetailserial.GetEntity("SERIALNAME", detailSerial.SERIALNAME); if (!isEdit) { if (exist != null) { ModelState.AddModelError("SERIALNAME", "业务名称已经存在!"); } } else { if (exist != null && exist.SERIALID != detailSerial.SERIALID) { ModelState.AddModelError("SERIALNAME", "业务名称已经存在!"); } } } if (string.IsNullOrEmpty(detailSerial.SSQUEUESERIALID)) { ModelState.AddModelError("SSQUEUESERIALID", "所属排队队列不能为空!"); } if (string.IsNullOrEmpty(detailSerial.SSDLSERIALID)) { ModelState.AddModelError("SSDLSERIALID", "所属大类业务不能为空!"); } }