Exemplo n.º 1
0
 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);
     }
 }
Exemplo n.º 2
0
        public CRM_VisitPlanResult GetInfo(CRM_VisitPlanParam param)
        {
            CRM_VisitPlanResult ret = new CRM_VisitPlanResult();
            ExeResult           rst = new ExeResult();

            rst = this.Execute("ZNLCRM.BLL.CRM.CRM_VisitPlanBLL", "GetInfo", param);
            ret = rst == null ? new CRM_VisitPlanResult() : rst.Result as CRM_VisitPlanResult;
            return(ret);
        }
Exemplo n.º 3
0
        public WCFAddUpdateResult AddOrUpdate(CRM_VisitPlanResult param)
        {
            WCFAddUpdateResult ret = new WCFAddUpdateResult();
            ExeResult          rst = new ExeResult();

            rst = this.Execute("ZNLCRM.BLL.CRM.CRM_VisitPlanBLL", "AddOrUpdate", param);
            ret = (rst == null ? new WCFAddUpdateResult() : rst.Result as WCFAddUpdateResult);
            return(ret);
        }
Exemplo n.º 4
0
        object Form_GetEditEntity()
        {
            CRM_VisitPlanResult info = new CRM_VisitPlanResult();

            info.CustVstPlnID = custVstPlnID;
            info = this.ConvertControlToEntity <CRM_VisitPlanResult>(this.grpBase.Controls, info, null);
            info = this.ConvertControlToEntity <CRM_VisitPlanResult>(this.grpVst.Controls, info, null);
            if (!string.IsNullOrEmpty(important))
            {
                info.Important = important;
            }
            this.SetDataIsChanged <CRM_VisitPlanResult>(info);
            return(info);
        }
Exemplo n.º 5
0
        /// <summary>
        /// 获取一条信息记录
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public CRM_VisitPlanResult GetInfo(CRM_VisitPlanParam param)
        {
            this.CheckSession();
            CRM_VisitPlanResult rst = new CRM_VisitPlanResult();

            #region 判断
            if (param.CustVstPlnID == null && param.CustVstPlnGuID == null)
            {
                throw new WarnException("请指定拜访计划主单ID或者GUID!");
            }
            #endregion
            #region 保存实体
            WhereClip where = GetWhereClip(param);

            rst = this.Select <CRM_VisitPlanResult>(where);
            if (rst.CompanyGuID != null)
            {
                CRM_CompanyBLL companyBLL = new CRM_CompanyBLL();
                companyBLL.SessionInfo = this.SessionInfo;
                CRM_CompanyResult companyRst = companyBLL.GetCustInfo(new CRM_CompanyParam {
                    CompanyGuID = rst.CompanyGuID
                });
                if (companyRst != null)
                {
                    rst.CrmCompany = companyRst;
                }
                CRM_VisitPlanLineBLL visitPlanLineBLL = new CRM_VisitPlanLineBLL();
                visitPlanLineBLL.SessionInfo = this.SessionInfo;
                DateTime?lastVistTime = visitPlanLineBLL.GetLastVisitTime(new CRM_VisitPlanLineParam()
                {
                    CustVstPlnGuID = rst.CustVstPlnGuID
                });
                if (lastVistTime != null)
                {
                    rst.LastVisitTime = lastVistTime.ToStringHasNull();
                }
                rst.TotalVisitCount = visitPlanLineBLL.GetTotalVisitCount(new CRM_VisitPlanLineParam()
                {
                    CustVstPlnGuID = rst.CustVstPlnGuID
                });
            }
            //Sys_EmpDataRightBLL.SetRecIsEdit<CRM_VisitPlanResult>(rst, "BeLongEmpID", "", "OrgID", this.SessionInfo);
            #endregion
            return(rst);
        }
Exemplo n.º 6
0
        /// <summary>
        /// 删除实体
        /// </summary>
        /// <param name="param">删除条件实体</param>
        /// <returns></returns>
        public WCFAddUpdateResult DelInfo(CRM_VisitPlanParam param)
        {
            this.CheckSession();
            WCFAddUpdateResult ret = new WCFAddUpdateResult();
            int affect             = 0;

            try
            {
                #region 判断
                if (param.CustVstPlnID == null)
                {
                    throw new WarnException("请指定要删除的记录!");
                }
                #endregion
                WhereClip where = GetWhereClip(param);
                //CRM_VisitPlanResult oldInfo = this.GetInfo(param);
                //oldInfo = Sys_EmpDataRightBLL.SetRecIsEdit<CRM_VisitPlanResult>(oldInfo, "BeLongEmpID", "", "OrgID", this.SessionInfo);
                //if (oldInfo.RecStatu != 2)
                //{
                //    throw new WarnException("您无权删除当前记录!");
                //}
                CRM_VisitPlanResult info = new CRM_VisitPlanResult();
                info.IsDeleted      = true;
                info.UpdatedTime    = DateTime.Now;
                info.UpdatedEmpID   = this.SessionInfo.UserID;
                info.UpdatedEmpName = this.SessionInfo.UserName;
                affect = this.Update <CRM_VisitPlanResult>(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);
        }
Exemplo n.º 7
0
        private void tsbDelVisitPlan_Click(object sender, EventArgs e)
        {
            CRM_VisitPlanParam param = new CRM_VisitPlanParam();

            param.CustVstPlnID = custVstPlnID;

            CRM_VisitPlanResult rst = planLogic.GetInfo(param);

            if (rst != null)
            {
                if (MessageBox.Show("请确认是否要删除拜访计划:【" + rst.PlanName + "】", "操作提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                {
                    WCFAddUpdateResult result = this.AsyncExecute <WCFAddUpdateResult, CRM_VisitPlanParam>(param, planLogic.DelInfo, a => { BindDataGridView(pgPlan.PageIndex); });
                }
            }
            else
            {
                this.ShowMessage("请选择需要删除的拜访计划!");
            }
        }
Exemplo n.º 8
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            CRM_VisitPlanResult info = Form_GetEditEntity() as CRM_VisitPlanResult;

            if (!this.DataIsChanged)
            {
                this.ShowNoChangedMsg();
                return;
            }
            WCFAddUpdateResult result = this.AsyncExecute <WCFAddUpdateResult, CRM_VisitPlanResult>(info, cvpLogic.AddOrUpdate, (a) =>
            {
                if (a.Key > 0)
                {
                    this.SetDataIsNoChanged();
                    custVstPlnID   = a.Key;
                    custVstPlnGuID = a.KeyGuid.ToGuid();
                    InitData();
                }
            });
        }
Exemplo n.º 9
0
        public void InitData()
        {
            if (custVstPlnID > 0)
            {
                CRM_VisitPlanResult info = cvpLogic.GetInfo(new CRM_VisitPlanParam {
                    CustVstPlnID = custVstPlnID
                });
                this.ConvertEntityToControl <CRM_VisitPlanResult>(this.grpBase.Controls, info, null);
                this.ConvertEntityToControl <CRM_VisitPlanResult>(this.grpVst.Controls, info, null);
                CRM_CompanyResult crmCompany = info.CrmCompany;
                if (crmCompany != null)
                {
                    txtCompanyName.Text = crmCompany.CompanyName;
                    txtWebSite.Text     = crmCompany.WebSite;
                    txtEmail.Text       = crmCompany.Email;
                }
                switch (info.Important)
                {
                case "高":
                    rdoHight.Checked = true;
                    break;

                case "普通":
                    rdoCommon.Checked = true;
                    break;

                case "低":
                    rdoLow.Checked = true;
                    break;
                }
            }
            else
            {
                this.txtOpEmpID.Text   = this.SessionInfo.UserID.ToStringHasNull();
                this.txtOpEmpName.Text = this.SessionInfo.UserName;
                txtStartDate.Text      = Common.GetServerNow();
            }
            BindLineDataGridView();
            BindFeeDataGridView();
        }
Exemplo n.º 10
0
        /// <summary>
        /// 添加和新增修改
        /// </summary>
        /// <param name="param">新增或修改的实体</param>
        /// <returns></returns>
        public WCFAddUpdateResult AddOrUpdate(CRM_VisitPlanResult param)
        {
            this.CheckSession();
            WCFAddUpdateResult ret = new WCFAddUpdateResult();

            try
            {
                int affect = 0;
                #region 判断
                if (param.CompanyGuID == Guid.Empty)
                {
                    throw new WarnException("请选择跟踪的客户!");
                }
                if (string.IsNullOrEmpty(param.PlanName))
                {
                    throw new WarnException("请指定跟踪主题!");
                }
                if (string.IsNullOrEmpty(param.VstText))
                {
                    throw new WarnException("请填写拜访内容!");
                }
                if (string.IsNullOrEmpty(param.VstTyp))
                {
                    throw new WarnException("请选择拜访类型!");
                }
                if (param.OpEmpID.ToInt32() <= 0)
                {
                    throw new WarnException("请选择所属人!");
                }
                if (param.StartDate == null)
                {
                    throw new WarnException("请选择开始时间!");
                }
                #endregion
                #region 系统默认值
                if (param.CustVstPlnID.ToInt32() > 0)
                {
                    WhereClip where      = CRM_VisitPlan._.CustVstPlnID == param.CustVstPlnID;
                    param.GCompanyGuID   = this.SessionInfo.CompanyID;
                    param.UpdatedEmpID   = this.SessionInfo.UserID;
                    param.UpdatedEmpName = this.SessionInfo.UserName;
                    param.UpdatedTime    = DateTime.Now;
                    affect = this.Update <CRM_VisitPlanResult>(param, where);
                }
                else
                {
                    Sys_CodeRulerBLL codeRulerBll = new Sys_CodeRulerBLL();
                    codeRulerBll.SessionInfo = this.SessionInfo;
                    param.BillNo             = param.BillNo = codeRulerBll.GetBillNo(new Entity.UserModel.Sys.SYS_CredentialCodeRuleParam()
                    {
                        BillDate = DateTime.Today, TableName = "CRM_VisitPlan"
                    });
                    param.GCompanyGuID   = this.SessionInfo.CompanyID;
                    param.CustVstPlnGuID = Guid.NewGuid();
                    param.CreatedEmpID   = this.SessionInfo.UserID;
                    param.CreatedEmpName = this.SessionInfo.UserName;
                    param.CreatedTime    = DateTime.Now;
                    param.TraceStatus    = "计划跟踪";
                    param.IsDeleted      = false;
                    param.IsRead         = false;
                    affect = this.Insert <CRM_VisitPlanResult>(param);
                    param  = this.Select <CRM_VisitPlanResult>(new List <Field>()
                    {
                        CRM_VisitPlan._.CustVstPlnID, CRM_VisitPlan._.CustVstPlnGuID
                    }, CRM_VisitPlan._.CustVstPlnGuID == param.CustVstPlnGuID);
                }
                #region 设置返回值
                ret.Key            = param.CustVstPlnID;
                ret.KeyGuid        = param.CustVstPlnGuID;
                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);
        }