Exemplo n.º 1
0
        public WCFAddUpdateResult DelInfo(CRM_VisitPlanParam param)
        {
            WCFAddUpdateResult ret = new WCFAddUpdateResult();
            ExeResult          rst = new ExeResult();

            rst = this.Execute("ZNLCRM.BLL.CRM.CRM_VisitPlanBLL", "DelInfo", param);
            ret = (rst == null ? new WCFAddUpdateResult() : rst.Result as WCFAddUpdateResult);
            return(ret);
        }
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 PageList <CRM_VisitPlanResult> GetPageList(CRM_VisitPlanParam param)
        {
            ExeResult rst = new ExeResult();

            rst = this.Execute("ZNLCRM.BLL.CRM.CRM_VisitPlanBLL", "GetPageList", param);
            PageList <CRM_VisitPlanResult> pageList = new PageList <CRM_VisitPlanResult>();

            pageList = (rst == null ? new PageList <CRM_VisitPlanResult>() : rst.Result as PageList <CRM_VisitPlanResult>);
            return(pageList);
        }
Exemplo n.º 4
0
        private void BindDataGridView(int pageIndex)
        {
            CRM_VisitPlanParam param = new CRM_VisitPlanParam();

            param.PlanName  = txtPlanName.Text;
            param.PageIndex = pageIndex;
            param.PageSize  = 100;
            PageList <CRM_VisitPlanResult> pageList = this.AsyncExecute <PageList <CRM_VisitPlanResult>, CRM_VisitPlanParam>(param, planLogic.GetPageList, a =>
            {
                dgvPlan.DataSource = a.ResultList;
                pgPlan.RecordCount = a.TotalCount;
            });
        }
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
        /// <summary>
        /// 获取条件的公共方法
        /// </summary>
        /// <param name="param">条件实体</param>
        /// <returns></returns>
        WhereClip GetWhereClip(CRM_VisitPlanParam param)
        {
            this.CheckSession();
            WhereClip where = CRM_VisitPlan._.IsDeleted == 0;
            if (param.CustVstPlnID != null)
            {
                where = where && CRM_VisitPlan._.CustVstPlnID == param.CustVstPlnID;
            }
            if (param.CustVstPlnGuID != null)
            {
                where = where && CRM_VisitPlan._.CustVstPlnGuID == param.CustVstPlnGuID;
            }
            if (param.PlanName != null)
            {
                where = where && CRM_VisitPlan._.PlanName.Like("%" + param.PlanName + "%");
            }
            where = Sys_EmpDataRightBLL.GetEmpIDInWhere(where, CRM_VisitPlan._.CreatedTime, CRM_VisitPlan._.OpEmpID, CRM_VisitPlan._.OrgID, CRM_VisitPlan._.DeptID, this.SessionInfo);

            return(where);
        }
Exemplo n.º 8
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.º 9
0
        /// <summary>
        /// 查询记录,并返回分页列表
        /// </summary>
        /// <param name="param">查询条件实体</param>
        /// <returns></returns>
        public PageList <CRM_VisitPlanResult> GetPageList(CRM_VisitPlanParam param)
        {
            this.CheckSession();
            PageList <CRM_VisitPlanResult> rst = new PageList <CRM_VisitPlanResult>();

            WhereClip where = GetWhereClip(param);
            List <Field> lstField = new List <Field>()
            {
                CRM_VisitPlan._.All
            };

            rst = this.SelectList <CRM_VisitPlanResult>(param.PageIndex.GetValueOrDefault(1), param.PageSize.GetValueOrDefault(50), lstField, where, CRM_VisitPlan._.CreatedTime.Desc);
            Guid?[] arrCompanyID = rst.ResultList.Select(a => a.CompanyGuID).ToArray().Distinct().ToArray();
            List <CRM_CompanyResult> lstCompany = new List <CRM_CompanyResult>();
            CRM_CompanyBLL           companyBll = new CRM_CompanyBLL();

            companyBll.SessionInfo = this.SessionInfo;
            if (arrCompanyID.Length > 0)
            {
                lstCompany = companyBll.GetComapnyListByFilter(new List <Field>()
                {
                    CRM_Company._.CompanyName, CRM_Company._.CompanyGuID
                }, CRM_Company._.CompanyGuID.In(arrCompanyID));
            }
            CRM_CompanyResult findCompany;

            foreach (CRM_VisitPlanResult info in rst.ResultList)
            {
                findCompany = lstCompany.Find(a => a.CompanyGuID == info.CompanyGuID);
                if (findCompany != null)
                {
                    info.CompanyName = findCompany.CompanyName;
                }
            }
            // rst.ResultList = Sys_EmpDataRightBLL.SetRecIsEdit<CRM_VisitPlanResult>(rst.ResultList, "BeLongEmpID", "", "OrgID", this.SessionInfo);
            return(rst);
        }