public WCFAddUpdateResult DelInfo(Sys_FormRightParam param) { this.CheckSession(); WCFAddUpdateResult ret = new WCFAddUpdateResult(); int affect = 0; try { #region 判断 if (param.FormRightID <= 0) { throw new WarnException("请指定要删除的记录!"); } #endregion WhereClip where = Sys_FormRightResult._.FormRightID == param.FormRightID; Sys_FormRightResult oldInfo = this.GetInfo(param); Sys_FormRightResult info = new Sys_FormRightResult(); info.IsDeleted = true; affect = this.Update <Sys_FormRightResult>(info, where); #region 设置返回值 ret.Key = affect; #endregion } catch (WarnException exp) { throw exp; } catch (System.Exception exp) { LogInfoBLL.WriteLog(this.SessionInfo, exp); } return(ret); }
public WCFAddUpdateResult AddOrUpdate(Sys_FormRightResult param) { WCFAddUpdateResult ret = new WCFAddUpdateResult(); ExeResult rst = new ExeResult(); rst = this.Execute("ZNLCRM.BLL.Sys.Sys_FormRightBLL", "AddOrUpdate", param); ret = (rst == null ? new WCFAddUpdateResult() : rst.Result as WCFAddUpdateResult); return(ret); }
object Form_GetEditEntity() { Sys_FormRightResult info = new Sys_FormRightResult(); info.FormRightID = _formrightid; info = this.ConvertControlToEntity <Sys_FormRightResult>(this.grpMain.Controls, info, null); this.SetDataIsChanged <Sys_FormRightResult>(info); return(info); }
private void btnSave_Click(object sender, EventArgs e) { Sys_FormRightResult info = Form_GetEditEntity() as Sys_FormRightResult; if (!this.DataIsChanged) { this.ShowNoChangedMsg(); return; } Sys_FormRightLogic logic = new Sys_FormRightLogic(this); WCFAddUpdateResult pageList = this.AsyncExecute <WCFAddUpdateResult, Sys_FormRightResult>(info, logic.AddOrUpdate, SaveComplete); }
public Sys_FormRightResult GetInfo(Sys_FormRightParam param) { Sys_FormRightResult ret = new Sys_FormRightResult(); ExeResult rst = new ExeResult(); if (param.FormRightID <= 0) { this.ShowMessage("请指定要修改的记录!"); return(ret); } rst = this.Execute("ZNLCRM.BLL.Sys.Sys_FormRightBLL", "GetInfo", param); ret = rst == null ? new Sys_FormRightResult() : rst.Result as Sys_FormRightResult; return(ret); }
public WCFAddUpdateResult AddOrUpdate(Sys_FormRightResult param) { this.CheckSession(); int affect = 0; WCFAddUpdateResult ret = new WCFAddUpdateResult(); try { #region 判断 if (param.FormEngName.ToStringHasNull().Trim() == "") { throw new WarnException("请指定窗体英文名!"); } //if (param.UserControlEngName.ToStringHasNull().Trim() == "") throw new WarnException("请指定用户控件英文名!"); if (param.OprControlEngName.ToStringHasNull().Trim() == "") { throw new WarnException("请指定操作控件英文名!"); } if (param.ActionCode.ToStringHasNull().Trim() == "") { throw new WarnException("请指定对应权限!"); } if (param.FormRightID > 0) { WhereClip where = Sys_FormRightResult._.FormRightID == param.FormRightID; affect = this.Update <Sys_FormRightResult>(param, where); ret.Key = param.FormRightID; } else { Sys_FormRightBLL formrightbll = new Sys_FormRightBLL(); formrightbll.SessionInfo = this.SessionInfo; param.IsDeleted = false; affect = this.Insert <Sys_FormRightResult>(param); ret.Key = this.Select <Sys_FormRightResult>(Sys_FormRight._.NameSpace == param.NameSpace && Sys_FormRight._.OprControlEngName == param.OprControlEngName && Sys_FormRight._.IsDeleted == false).FormRightID; } #endregion } catch (WarnException exp) { throw exp; } catch (System.Exception exp) { LogInfoBLL.WriteLog(this.SessionInfo, exp); } return(ret); }
void LoadData() { if (_formrightid == -1) { return; } Sys_FormRightLogic logic = new Sys_FormRightLogic(this); Sys_FormRightResult rst = logic.GetInfo(new Sys_FormRightParam() { FormRightID = _formrightid }); if (rst == null) { return; } this.ConvertEntityToControl(this.grpMain.Controls, rst, null); this.EditBeforeData = rst; }
public Sys_FormRightResult GetInfo(Sys_FormRightParam param) { this.CheckSession(); Sys_FormRightResult rst = new Sys_FormRightResult(); try { #region 判断 if (param.FormRightID <= 0) { throw new WarnException("请指定关键字GUID!"); } #endregion #region 保存实体 WhereClip where = Sys_FormRight._.FormRightID == param.FormRightID; rst = this.Select <Sys_FormRightResult>(where); if (rst != null) { Sys_ModuleBLL moduleBll = new Sys_ModuleBLL(); moduleBll.SessionInfo = this.SessionInfo; Sys_ModuleResult moduleRst = moduleBll.GetInfo(new Sys_ModuleParam() { ModuleID = rst.ModuleID.ToInt32() }); rst.ModuleName = moduleRst == null ? "" : moduleRst.ModuleName; } #endregion } catch (WarnException exp) { throw exp; } catch (System.Exception exp) { LogInfoBLL.WriteLog(this.SessionInfo, exp); } return(rst); }