//添加保存 public ActionResult SaveAdd(ITC_Organization_M model) { model.Organization_createdtime = DateTime.Now; model.Organization_Oprt = UserContext.UserName; if (!uifo.Exists(model.Orga_ID)) { if (uifo.Add(model)) { OrgaContext.InitCache(); EventContext.Add(MenuID, string.Format("添加:{0}", model.Orga_ID)); return(Content("保存成功!")); } else { return(Content("保存失败!")); } } else { return(Content("保存失败! 编码[" + model.Orga_ID + "]已存在!")); } }
/// <summary> /// 编码是否存在(数据库) /// </summary> /// <param name="code"></param> /// <returns></returns> public static bool ExistsByDB(string id) { ITC_Organization bll = new ITC_Organization(); return(bll.Exists(id)); }