public void InitData() { if (custVstPlnGuID != Guid.Empty) { CRM_VisitPlanResult planInfo = planLogic.GetInfo(new CRM_VisitPlanParam { CustVstPlnGuID = custVstPlnGuID }); this.ConvertEntityToControl <CRM_VisitPlanResult>(this.grpVisitPlan.Controls, planInfo, null); this.ConvertEntityToControl <CRM_VisitPlanResult>(this.grpVisitResult.Controls, planInfo, null); companyGuID = planInfo.CompanyGuID; } if (custVstPlnLineID > 0) { CRM_VisitPlanLineResult planLineInfo = planLineLogic.GetInfo(new CRM_VisitPlanLineParam { CustVstPlnLineID = custVstPlnLineID }); this.ConvertEntityToControl <CRM_VisitPlanLineResult>(this.grpVisitResult.Controls, planLineInfo, null); txtLineVstText.BodyInnerHTML = planLineInfo.VstText; companyGuID = planLineInfo.CompanyGuID; } else { txtRptEmpName.Text = this.SessionInfo.UserName; txtRptEmpID.Text = this.SessionInfo.UserID.ToStringHasNull(); txtVstDate.Text = ZNLCRM.UI.Logic.Sys.Common.GetServerNow(); txtVstName.Text = txtPlanName.Text; } if (companyGuID != Guid.Empty) { CRM_CompanyResult companyInfo = companyLogic.GetCustInfo(new CRM_CompanyParam { CompanyGuID = companyGuID }); this.ConvertEntityToControl <CRM_CompanyResult>(this.grpVisitResult.Controls, companyInfo, null); } }
public CRM_VisitPlanLineResult GetInfo(CRM_VisitPlanLineParam param) { CRM_VisitPlanLineResult ret = new CRM_VisitPlanLineResult(); ExeResult rst = new ExeResult(); rst = this.Execute("ZNLCRM.BLL.CRM.CRM_VisitPlanLineBLL", "GetInfo", param); ret = rst == null ? new CRM_VisitPlanLineResult() : rst.Result as CRM_VisitPlanLineResult; return(ret); }
public WCFAddUpdateResult AddOrUpdate(CRM_VisitPlanLineResult param) { WCFAddUpdateResult ret = new WCFAddUpdateResult(); ExeResult rst = new ExeResult(); rst = this.Execute("ZNLCRM.BLL.CRM.CRM_VisitPlanLineBLL", "AddOrUpdate", param); ret = (rst == null ? new WCFAddUpdateResult() : rst.Result as WCFAddUpdateResult); return(ret); }
object Form_GetEditEntity() { CRM_VisitPlanLineResult info = new CRM_VisitPlanLineResult(); info.CustVstPlnLineID = custVstPlnLineID; info = this.ConvertControlToEntity <CRM_VisitPlanLineResult>(this.grpVisitPlan.Controls, info, null); info = this.ConvertControlToEntity <CRM_VisitPlanLineResult>(this.grpVisitResult.Controls, info, null); info.VstText = txtLineVstText.BodyInnerHTML; this.SetDataIsChanged <CRM_VisitPlanLineResult>(info); return(info); }
private void btnSave_Click(object sender, EventArgs e) { CRM_VisitPlanLineResult info = Form_GetEditEntity() as CRM_VisitPlanLineResult; if (!this.DataIsChanged) { this.ShowNoChangedMsg(); return; } WCFAddUpdateResult result = this.AsyncExecute <WCFAddUpdateResult, CRM_VisitPlanLineResult>(info, planLineLogic.AddOrUpdate, (a) => { if (a.Key > 0) { custVstPlnLineID = a.Key; this.SetDataIsNoChanged(); InitData(); } }); }
/// <summary> /// 获取一条信息记录 /// </summary> /// <param name="param"></param> /// <returns></returns> public CRM_VisitPlanLineResult GetInfo(CRM_VisitPlanLineParam param) { this.CheckSession(); CRM_VisitPlanLineResult rst = new CRM_VisitPlanLineResult(); #region 判断 if (param.CustVstPlnLineID == null) { throw new WarnException("请指定拜访明细ID!"); } #endregion #region 保存实体 WhereClip where = GetWhereClip(param); rst = this.Select <CRM_VisitPlanLineResult>(where); //Sys_EmpDataRightBLL.SetRecIsEdit<CRM_VisitPlanLineResult>(rst, "BeLongEmpID", "", "OrgID", this.SessionInfo); #endregion return(rst); }
/// <summary> /// 删除实体 /// </summary> /// <param name="param">删除条件实体</param> /// <returns></returns> public WCFAddUpdateResult DelInfo(CRM_VisitPlanLineParam param) { this.CheckSession(); WCFAddUpdateResult ret = new WCFAddUpdateResult(); int affect = 0; try { #region 判断 if (param.CustVstPlnLineID == null) { throw new WarnException("请指定要删除的记录!"); } #endregion WhereClip where = GetWhereClip(param); //CRM_VisitPlanLineResult oldInfo = this.GetInfo(param); //oldInfo = Sys_EmpDataRightBLL.SetRecIsEdit<CRM_VisitPlanLineResult>(oldInfo, "BeLongEmpID", "", "OrgID", this.SessionInfo); //if (oldInfo.RecStatu != 2) //{ // throw new WarnException("您无权删除当前记录!"); //} CRM_VisitPlanLineResult info = new CRM_VisitPlanLineResult(); info.IsDeleted = true; info.UpdatedTime = DateTime.Now; info.UpdatedEmpID = this.SessionInfo.UserID; info.UpdatedEmpName = this.SessionInfo.UserName; affect = this.Update <CRM_VisitPlanLineResult>(info, where); #region 设置返回值 ret.Key = affect; #endregion } catch (WarnException exp) { throw exp; } catch (System.Exception exp) { LogInfoBLL.WriteLog(this.SessionInfo, exp); throw exp; } return(ret); }
/// <summary> /// 添加和新增修改 /// </summary> /// <param name="param">新增或修改的实体</param> /// <returns></returns> public WCFAddUpdateResult AddOrUpdate(CRM_VisitPlanLineResult param) { this.CheckSession(); WCFAddUpdateResult ret = new WCFAddUpdateResult(); try { int affect = 0; #region 判断 if (param.CompanyGuID == Guid.Empty) { throw new WarnException("请选择跟进的客户!"); } if (string.IsNullOrEmpty(param.VstName)) { throw new WarnException("请指定跟进主题!"); } if (string.IsNullOrEmpty(param.VstText)) { throw new WarnException("请填写跟进内容!"); } if (string.IsNullOrEmpty(param.VstTyp)) { throw new WarnException("请选择跟进类型!"); } if (param.VstDate == null) { throw new WarnException("请选择跟进时间!"); } #endregion #region 系统默认值 if (param.CustVstPlnLineID.ToInt32() > 0) { WhereClip where = CRM_VisitPlanLine._.CustVstPlnLineID == param.CustVstPlnLineID; param.GCompanyGuID = this.SessionInfo.CompanyID; param.UpdatedEmpID = this.SessionInfo.UserID; param.UpdatedEmpName = this.SessionInfo.UserName; param.UpdatedTime = DateTime.Now; affect = this.Update <CRM_VisitPlanLineResult>(param, where); } else { param.GCompanyGuID = this.SessionInfo.CompanyID; param.CustVstPlnLineGuID = Guid.NewGuid(); param.CreatedEmpID = this.SessionInfo.UserID; param.CreatedEmpName = this.SessionInfo.UserName; param.CreatedTime = DateTime.Now; param.IsDeleted = false; affect = this.Insert <CRM_VisitPlanLineResult>(param); param = this.Select <CRM_VisitPlanLineResult>(new List <Field>() { CRM_VisitPlanLine._.CustVstPlnLineID }, CRM_VisitPlanLine._.CustVstPlnLineGuID == param.CustVstPlnLineGuID); } #region 设置返回值 ret.Key = param.CustVstPlnLineID; ret.CreatedTime = param.CreatedTime; ret.CreatedEmpID = param.CreatedEmpID; ret.CreatedEmpName = param.CreatedEmpName; ret.UpdatedEmpID = param.UpdatedEmpID; ret.UpdatedEmpName = param.UpdatedEmpName; ret.UpdatedTime = param.UpdatedTime; #endregion #endregion } catch (WarnException exp) { throw exp; } catch (System.Exception exp) { LogInfoBLL.WriteLog(this.SessionInfo, exp); throw exp; } return(ret); }