public ActionResult RemoveItem(long id) { Func<ExtResult> removeFun = () => { dalItem.Delete(id); var ret = new ExtResult(); ret.success = true; return ret; }; return base.Remove(removeFun); }
public ActionResult Remove(long id) { Func<ExtResult> fun = () => { ExtResult ret = new ExtResult(); dalHandlingTasks.Delete(id); ret.success = true; return ret; }; return base.Remove(fun); }
public ActionResult Remove(long id) { Func<ExtResult> fun = () => { ExtResult ret = new ExtResult(); dalBusinessConstraints.Delete(id); ret.success = true; return ret; }; return base.Remove(fun); }
public ActionResult Save(IMS_WT_ZXZ ent) { Func<ExtResult> fun = () => { ExtResult ret = new ExtResult(); dalExecutor.SaveOrUpdate(ent); ret.success = true; return ret; }; return base.Save(fun); }
public ActionResult RemoveContainerType(string id) { // id =>LXBH Func<ExtResult> removeFun = () => { dalContainerType.Delete(id); var ret = new ExtResult(); ret.success = true; return ret; }; return base.Remove(removeFun); }
public ActionResult Save(IMS_VC_YWYS ent) { Func<ExtResult> fun = () => { ExtResult ret = new ExtResult(); ent.XGSJ = System.DateTime.Now; dalBusinessConstraints.SaveOrUpdate(ent); ret.success = true; return ret; }; return base.Save(fun); }
public ActionResult Save(IMS_WT_YWRW ent) { Func<ExtResult> fun = () => { if (ent.ID == 0) { ent.CJR = CurrentUser.GetCurrentUser().UserInfo.YHID; ent.CJSJ = System.DateTime.Now; } ExtResult ret = new ExtResult(); dalBusinessTasks.SaveOrUpdate(ent); ret.success = true; return ret; }; return base.Save(fun); }
public ActionResult SaveItem(IMS_CB_WL entity) { Func<ExtResult> saveFun = () => { if (entity.ID == 0) { string filter = string.Format("WLBH = \"{0}\" ", entity.WLBH); //if (dalItem.Exists(f => f.WLBH.Equals(entity.WLBH, StringComparison.CurrentCultureIgnoreCase))) if (dalItem.Exists(filter)) throw new JsMiracleException("物料编号不得重覆"); // 创建人 entity.CJR = CurrentUser.GetCurrentUser().UserInfo.YHID; entity.CJSJ = System.DateTime.Now; } else { string filter = string.Format("WLBH = \"{0}\" && ID != {1} ", entity.WLBH, entity.ID); if (dalItem.Exists(filter)) throw new JsMiracleException("物料编号不得重覆"); } // 修改人 entity.XGR = CurrentUser.GetCurrentUser().UserInfo.YHID; entity.XGSJ = System.DateTime.Now; dalItem.SaveOrUpdate(entity); ExtResult ret = new ExtResult(); ret.success = true; return ret; }; return base.Save(saveFun); }
/// <summary> /// 重新从数据库的系统表载入数据更新对象表 /// </summary> /// <param name="tablename">表名</param> /// <returns></returns> public ActionResult ReSaveObjectDat(string tablename) { ExtResult ret = new ExtResult(); try { dalObjectData.ReSaveObjectData(tablename , CurrentUser.GetCurrentUser().UserInfo.YHID); ret.success = true; ret.msg = "处理成功"; } catch (Exception ex) { ret.success = false; if (ex is JsMiracleException) ret.msg = ex.Message; else { ret.msg = string.Format("{0}:{1}", ex.Message, ex.StackTrace); } } return this.JsonFormat(ret); }
public ActionResult SaveLocationType(IMS_CB_WZLX entity) { //if (entity.ID == 0) // entity.CJR = CurrentUser.GetCurrentUser().UserInfo.YHID; Func<ExtResult> saveFun = () => { if (!string.IsNullOrEmpty(entity.LXDM)) { string filter = string.Format("LXDM = \"{0}\" && ID != {1} ", entity.LXDM, entity.ID ); if (dalLocationType.Exists(filter)) throw new JsMiracleException("位置类型编号不得重覆"); } //entity.CJR = CurrentUser.GetCurrentUser().UserInfo.YHID; dalLocationType.SaveOrUpdate(entity); var ret = new ExtResult(); ret.success = true; return ret; }; return base.Save(saveFun); }
public ActionResult RemoveLocationType(string id) { // id ==> lxdm Func<ExtResult> removeFun = () => { dalLocationType.Delete(id); var ret = new ExtResult(); ret.success = true; return ret; }; return base.Remove(removeFun); }
//[AuthViewPage] //public ActionResult ShowLocation(string wxbh) //{ // var ent = dalContainer.GetAllEntites( // n => n.DQWZ.Equals(wxbh, StringComparison.CurrentCultureIgnoreCase)) // .FirstOrDefault(); // return View(ent); //} public ActionResult SaveLocation(IMS_CB_WZ entity) { Func<ExtResult> saveFun = () => { if (!string.IsNullOrEmpty(entity.WXBH)) { var filter = string.Format("WXBH = \"{0}\" && ID != {1} " , entity.WXBH , entity.ID); if (dalLocation.Exists(filter)) throw new JsMiracleException("位置编号不得重覆"); } if (entity.ID == 0) { entity.CJR = CurrentUser.GetCurrentUser().UserInfo.YHID; entity.CJSJ = System.DateTime.Now; } dalLocation.SaveOrUpdate(entity); var ret = new ExtResult(); ret.success = true; return ret; }; return base.Save(saveFun); }
public ActionResult SaveZP(IMS_WT_YWRW entity) { Func<ExtResult> fun = () => { ExtResult ret = new ExtResult(); var userid = CurrentUser.GetCurrentUser().UserInfo.YHID; dalBusinessTasks.ZPIn(entity.ID, userid, entity.SKU, entity.ZPSL, entity.RQBH); return ret; }; return base.Save(fun); }
public ActionResult SaveCondition(IMS_CM_YHDX entity) { Func<ExtResult> saveFun = () => { entity.XGRQ = System.DateTime.Now; entity.YHID = CurrentUser.GetCurrentUser().UserInfo.YHID; dalUserObj.SaveOrUpdate(entity); ExtResult ret = new ExtResult(); ret.success = true; ret.msg = "保存成功"; ret.retString = entity.DXTJ; return ret; }; return base.Save(saveFun); }
/// <summary> /// 保存数据实体操作 /// </summary> /// <param name="saveAction">保存的操作方法</param> /// <returns>返回操作结果 Json</returns> protected virtual ActionResult Save(Func<ExtResult> saveAction) { //var ret = new ExtResult(); ExtResult ret; try { if (ModelState.IsValid) { ret = saveAction(); if (string.IsNullOrEmpty(ret.msg)) ret.msg = "保存成功"; } else { StringBuilder sb = new StringBuilder(); var errs = ModelState.Values.SelectMany(v => v.Errors); foreach (var err in errs) { sb.AppendFormat("{0}</br>", err.ErrorMessage); } ret = new ExtResult(); ret.success = false; ret.msg = sb.ToString(); } } catch (Exception ex) { ret = new ExtResult(); ret.success = false; if (ex is JsMiracleException) { ret.msg = ex.Message; } else { Exception innerExp = ex; while (innerExp.InnerException != null) { innerExp = innerExp.InnerException; } ret.msg = string.Format("{0}-{1}", ex.Message, innerExp.Message); } } return this.JsonFormat(ret); }
public ActionResult OrderDataState(long id, EnumOrderDataState state) { ExtResult ret = new ExtResult(); try { var userid = CurrentUser.GetCurrentUser().UserInfo.YHID; dalorderdata.UpdateOrderData(id,userid, state); ret.success = true; } catch (Exception ex) { ret.success = false; ret.msg = ex.Message; } return this.JsonFormat(ret); }
public ActionResult SaveOrderData(IMS_VC_DJH ent) { Func<ExtResult> fun = () => { ExtResult ret = new ExtResult(); ent.CJR = CurrentUser.GetCurrentUser().UserInfo.YHID; ent.CJSJ = System.DateTime.Now; dalorderdata.SaveOrUpdate(ent); ret.success = true; return ret; }; return base.Save(fun); }
public ActionResult SaveRole(IMS_UP_JS module) { Func<ExtResult> saveFun = () => { if (string.IsNullOrEmpty(module.JSID)) { module.JSID = Guid.NewGuid().ToString(); } dalRole.SaveOrUpdate(module); ExtResult ret = new ExtResult(); ret.success = true; return ret; }; return base.Save(saveFun); }
public ActionResult ChangePassword(ChangePasswordModule module) { var user = dalUser.GetEntity(module.ID); user.MM = IMS_UP_YH.GetPwdMD5(module.NewPassword); Func<ExtResult> saveFun = () => { dalUser.SaveOrUpdate(user); ExtResult ret = new ExtResult(); ret.success = true; return ret; }; return base.Save(saveFun); }
public ActionResult Registion(IMS_UP_YH user) { Func<ExtResult> saveFun = () => { // 新增用户,密码需要md5一下 user.MM = IMS_UP_YH.GetPwdMD5(user.MM); dalUser.SaveOrUpdate(user); ExtResult ret = new ExtResult(); ret.success = true; return ret; }; return base.Save(saveFun); }
public ActionResult SaveRelationship(IMS_CB_WZGX entity) { Func<ExtResult> saveFun = () => { dalLocationRelationship.SaveOrUpdate(entity); var ret = new ExtResult(); ret.success = true; return ret; }; return base.Save(saveFun); }
public ActionResult SaveModule(IMS_UP_MK module) { Func<ExtResult> saveFun = () => { if (string.IsNullOrEmpty(module.QY)) { module.URL = Url.Action(module.HDMC, module.KZMC); } else { module.URL = Url.Action(module.HDMC, module.KZMC, new { area = module.QY }); } dalModule.SaveOrUpdate(module); var parentModule = dalModule.GetEntityByModuleID(module.FMKID); long pid = -1; if (parentModule != null) pid = parentModule.ID; ActionPermission.ResetCache(); var ret = new ExtResult(); ret.success = true; ret.id = pid; ret.parentid = module.FMKID; return ret; }; return base.Save(saveFun); }
public ActionResult RemoveOrderForm(long id) { Func<ExtResult> fun = () => { ExtResult ret = new ExtResult(); dalorderform.Delete(id); ret.success = true; return ret; }; return base.Remove(fun); }
protected virtual ActionResult Remove(Func<ExtResult> removeAction) { ExtResult ret; try { ret = removeAction(); if (string.IsNullOrEmpty(ret.msg)) ret.msg = "删除成功"; } catch (Exception ex) { ret = new ExtResult(); ret.success = false; if (ex is JsMiracleException) ret.msg = ex.Message; else ret.msg = string.Format("{0}-{1}", ex.Message, ex.InnerException); } return this.JsonFormat(ret); }
public ActionResult SaveCode(IMS_CM_DM entity) { Func<ExtResult> saveFun = () => { if (entity.ID == 0) { string filter = string.Format(" LXDM = \"{0}\" && (DM = \"{1}\" || SZ = {2} ) " , entity.LXDM , entity.DM , entity.SZ); if (dalCode.Exists(filter)) throw new JsMiracleException(string.Format("类型'{0}'已存在代码'{1}',数值'{2}'" , entity.LXDM, entity.DM, entity.SZ)); } else { string filter = string.Format(" LXDM = \"{0}\" && (DM = \"{1}\" || SZ = {2} ) && ID != {3} " , entity.LXDM, entity.DM, entity.SZ, entity.ID); if (dalCode.Exists(filter)) throw new JsMiracleException(string.Format("类型'{0}'已存在代码'{1}',数值'{2}'" , entity.LXDM, entity.DM, entity.SZ)); } //entity.CJR = CurrentUser.GetCurrentUser().UserInfo.YHID; entity.XGR = CurrentUser.GetCurrentUser().UserInfo.YHID; entity.XGRQ = System.DateTime.Now; if (entity.LXDM == CodeTypeEnum.TableName.ToString()) entity.DM = entity.DM.ToUpperInvariant(); dalCode.SaveOrUpdate(entity); ExtResult ret = new ExtResult(); ret.success = true; ret.msg = "保存成功"; var codeTypeEnt = dalCodeType.GetEntityBylxdm(entity.LXDM); if (codeTypeEnt != null) ret.parentid = codeTypeEnt.LXDM; return ret; }; return base.Save(saveFun); }
public ActionResult SaveCodeType(IMS_CM_DMLX ent) { Func<ExtResult> saveFun = () => { // 是否为新增 if (ent.ID == 0) { string filter = string.Format("LXDM = \"{0}\" ", ent.LXDM); if (dalCodeType.Exists(filter)) throw new JsMiracleException("代码编号不得重覆"); } else { string filter = string.Format("LXDM = \"{0}\" && ID != {1} ", ent.LXDM, ent.ID); if (dalCodeType.Exists(filter)) throw new JsMiracleException("代码编号不得重覆"); } ent.CJSJ = System.DateTime.Now; //ent.CJR = CurrentUser.GetCurrentUser().UserInfo.YHID; dalCodeType.SaveOrUpdate(ent); ExtResult ret = new ExtResult(); ret.success = true; ret.msg = "保存成功"; ret.parentid = ent.ID; return ret; }; return base.Save(saveFun); }
public ActionResult SaveContainer(IMS_CB_RQ entity) { Func<ExtResult> saveFun = () => { if (entity.ID == 0) { var filter = string.Format(" RQBH = \"{0}\" ", entity.RQBH); //if (dalContainer.Exists(f => f.RQBH.Equals(entity.RQBH, StringComparison.CurrentCultureIgnoreCase))) if (dalContainer.Exists(filter)) throw new JsMiracleException("容器类型编号不得重覆"); } else { var filter = string.Format(" RQBH = \"{0}\" && ID != {1} ", entity.RQBH, entity.ID); //if (dalContainer.Exists(f => f.RQBH.Equals(entity.RQBH, StringComparison.CurrentCultureIgnoreCase) // && f.ID != entity.ID)) if (dalContainer.Exists(filter)) throw new JsMiracleException("容器类型编号不得重覆"); } entity.ZCSJ = System.DateTime.Now; dalContainer.SaveOrUpdate(entity); var ret = new ExtResult(); ret.success = true; return ret; }; return base.Save(saveFun); }
public ActionResult SaveObjectData(IMS_CM_DXXX entity) { Func<ExtResult> saveFun = () => { //entity.XGR = CurrentUser.GetCurrentUser().UserInfo.YHID; entity.XGRQ = System.DateTime.Now; dalObjectData.SaveOrUpdate(entity); ExtResult ret = new ExtResult(); ret.success = true; ret.msg = "保存成功"; return ret; }; return base.Save(saveFun); }
public ActionResult SaveContainerType(IMS_CB_RQLX entity) { Func<ExtResult> saveFun = () => { if (entity.ID == 0) { string filter = string.Format(" LXBH = \"{0}\" ", entity.LXBH); if (dalContainerType.Exists(filter)) throw new JsMiracleException("容器类型编号不得重覆"); } else { string filter = string.Format(" LXBH = \"{0}\" && ID != {1} ", entity.LXBH, entity.ID); if (dalContainerType.Exists(filter)) throw new JsMiracleException("容器类型编号不得重覆"); } //// 创建人 //entity.CJR = CurrentUser.GetCurrentUser().UserInfo.YHID; dalContainerType.SaveOrUpdate(entity); var ret = new ExtResult(); ret.success = true; return ret; }; return base.Save(saveFun); }
public ActionResult SaveFunction(IMS_UP_MKGN module) { Func<ExtResult> saveFun = () => { dalFunction.SaveOrUpdate(module); ActionPermission.ResetCache(); ExtResult ret = new ExtResult(); ret.success = true; return ret; }; return base.Save(saveFun); }