public ActionResult Add(ADM_USER model) { try { if (ModelState.IsValid) { model.PASSWORD = Com.Mxm.EncryptionHelper.EncodeMD5(model.PASSWORD); etMgr.AddToADM_USER(model); if (etMgr.SaveChanges() != 0) { return(RedirectToAction("Index")); } else { return(RedirectToAction("Add")); } } else { return(RedirectToAction("Add")); } } catch (Exception ex) { Com.Mxm.WriteTxt.WriteText(DateTime.Now.ToString() + "\t\n" + ex.Message + ex.StackTrace); return(View()); } }
public ActionResult Add(CUSTOMER model) { try { if (ModelState.IsValid) { etMgr.AddToCUSTOMER(model); if (etMgr.SaveChanges() != 0) { return(RedirectToAction("CusList")); } else { return(RedirectToAction("Add")); } } else { return(RedirectToAction("Add")); } } catch (Exception ex) { Com.Mxm.WriteTxt.WriteText(DateTime.Now.ToString() + "\t\n" + ex.Message + ex.StackTrace); return(View()); } }
public ActionResult Add(MESSAGE_HISTORY model) { try { // 增加数据 if (ModelState.IsValid) { //etMgr.AddToMESSAGE_HISTORY(msg); if (etMgr.SaveChanges() != 0) { return(RedirectToAction("Index")); } else { return(RedirectToAction("Add")); } } return(RedirectToAction("Add")); } catch (Exception ex) { Com.Mxm.WriteTxt.WriteText(ex.Message + ex.StackTrace); return(View()); } }