Exemple #1
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <returns></returns>
        private string PageSave()
        {
            string msg = string.Empty;

            #region 获取表单
            string   type        = Utils.GetFormValue("sltType");
            DateTime txtDateTime = Utils.GetDateTime(Utils.GetFormValue("txtDateTime"), DateTime.Now);
            decimal  txtSource   = Utils.GetDecimal(Utils.GetFormValue("txtSource"));
            string   txtRemarks  = Utils.GetFormValue("txtRemarks");
            string   crmId       = Utils.GetQueryStringValue("crmId");
            #endregion

            EyouSoft.Model.CrmStructure.MJiFenInfo model = new EyouSoft.Model.CrmStructure.MJiFenInfo();
            EyouSoft.BLL.CrmStructure.BCrmMember   bll   = new EyouSoft.BLL.CrmStructure.BCrmMember();
            model.CrmId          = crmId;
            model.IssueTime      = DateTime.Now;
            model.JiFen          = txtSource;
            model.JiFenShiJian   = txtDateTime;
            model.OperatorId     = SiteUserInfo.UserId;
            model.Remark         = txtRemarks;
            model.ZengJianLeiBie = type == "1" ? EyouSoft.Model.EnumType.CrmStructure.JiFenZengJianLeiBie.增加 : EyouSoft.Model.EnumType.CrmStructure.JiFenZengJianLeiBie.减少;
            if (bll.SetJiFen(model))
            {
                msg = UtilsCommons.AjaxReturnJson("1", "操作成功!");
            }
            else
            {
                msg = UtilsCommons.AjaxReturnJson("0", "操作失败!");
            }
            return(msg);
        }
Exemple #2
0
        /// <summary>
        /// 添加订单
        /// </summary>
        /// <param name="order">订单、游客、游客保险组合的实体</param>
        /// <returns>
        ///1:修改后的订单人数超过计划剩余人数
        ///2:合同未领用
        ///3:添加成功
        ///4:添加失败
        ///-----------
        ///--5:自动客满
        ///--6:自动停收
        ///--7:手动客满
        ///--8:手动停收
        ///(5,6,7,8用于分销商订单报名时的计划状态判断)
        /// ----------
        ///王磊: 2012-08-20
        /// --9:销售员超限
        ///--10:客户超限
        ///--11:销售员客户单位均超限
        /// </returns>
        public int AddTourOrderExpand(MTourOrderExpand order)
        {
            //计划状态封团不允许添加订单
            //收客客满
            //计划停收
            //订单人数超出了剩余人数
            //合同号未领用
            //添加失败
            //添加失败
            //关于订单的金额

            //order.SumPrice可手动输入
            order.SettlementMoney        = order.PeerAdultPrice * order.Adults + order.PeerChildPrice * order.Childs;
            order.ConfirmSettlementMoney = order.SettlementMoney + order.PeerAddCost - order.PeerReduceCost;
            order.ConfirmMoney           = order.SumPrice + order.SumPriceAddCost - order.SumPriceReduceCost;
            order.SalerIncome            = order.SumPrice - order.GuideIncome;

            int flg = dal.AddTourOrderExpand(order);

            if (flg == 3)
            {
                //添加操作日志
                StringBuilder str = new StringBuilder();
                str.AppendFormat("新增订单,订单编号:{0}", order.OrderId);
                EyouSoft.BLL.SysStructure.BSysLogHandle.Insert(str.ToString());
            }

            if (flg == 3 && order.IsJiFen == 1)
            {
                decimal jiFenBiLi = 0;
                var     setting   = EyouSoft.Security.Membership.UserProvider.GetComSetting(order.CompanyId);
                if (setting != null)
                {
                    jiFenBiLi = (decimal)setting.IntegralProportion / 100M;
                }

                if (jiFenBiLi > 0)
                {
                    var jiFenInfo = new EyouSoft.Model.CrmStructure.MJiFenInfo();
                    EyouSoft.BLL.CrmStructure.BCrmMember bll = new EyouSoft.BLL.CrmStructure.BCrmMember();
                    jiFenInfo.CrmId          = order.BuyCompanyId;
                    jiFenInfo.IssueTime      = System.DateTime.Now;
                    jiFenInfo.JiFen          = order.SumPrice * jiFenBiLi;
                    jiFenInfo.JiFenShiJian   = System.DateTime.Now;
                    jiFenInfo.OperatorId     = order.OperatorId;
                    jiFenInfo.Remark         = string.Empty;
                    jiFenInfo.ZengJianLeiBie = EyouSoft.Model.EnumType.CrmStructure.JiFenZengJianLeiBie.增加;
                    jiFenInfo.OrderId        = order.OrderId;
                    jiFenInfo.OrderJinE      = order.SumPrice;
                    jiFenInfo.JiFenBiLi      = jiFenBiLi;

                    new EyouSoft.BLL.CrmStructure.BCrmMember().SetJiFen(jiFenInfo);
                }
            }

            return(flg);
        }
Exemple #3
0
        /// <summary>
        /// 保存按钮点击事件执行方法
        /// </summary>
        void Save()
        {
            EyouSoft.Model.CrmStructure.MCrmPersonalInfo info = new EyouSoft.Model.CrmStructure.MCrmPersonalInfo();

            #region get form value
            if (IsEdit)
            {
                info.CrmId = Utils.GetQueryStringValue("crmid");
            }
            info.Birthday       = Utils.GetDateTimeNullable(Utils.GetFormValue(txtBirthday.UniqueID));
            info.BriefCode      = Utils.GetFormValue(txtBrevityCode.UniqueID);
            info.CityId         = Utils.GetInt(Utils.GetFormValue(ddlCity.UniqueID));
            info.CompanyId      = CurrentUserCompanyID;
            info.CountryId      = Utils.GetInt(Utils.GetFormValue(ddlCountry.UniqueID));
            info.DanWei         = Utils.GetFormValue(txtWorkUnit.UniqueID);
            info.DanWeiAddress  = Utils.GetFormValue(txtUnitAddress.UniqueID);
            info.DistrictId     = Utils.GetInt(Utils.GetFormValue(ddlCounty.UniqueID));
            info.Email          = Utils.GetFormValue(txtEMail.UniqueID);
            info.Gender         = Utils.GetEnumValue <EyouSoft.Model.EnumType.GovStructure.Gender>(Utils.GetFormValue(ddlGender.UniqueID), EyouSoft.Model.EnumType.GovStructure.Gender.男);
            info.HomeAddress    = Utils.GetFormValue(txtHomeAddress.UniqueID);
            info.HuiFei         = Utils.GetDecimal(Utils.GetFormValue(txtMemberDues.UniqueID));
            info.IdCardCode     = Utils.GetFormValue(txtIdNumber.UniqueID);
            info.IsTiXing       = Utils.GetFormValue(this.chbIsRemind.UniqueID) == "on";
            info.JoinTime       = Utils.GetDateTimeNullable(Utils.GetFormValue(txtJoinTime.UniqueID));
            info.JoinType       = Utils.GetFormValue(txtApplicationType.UniqueID);
            info.MemberCardCode = Utils.GetFormValue(txtMemberCardNumber.UniqueID);
            info.MemberStatus   = Utils.GetEnumValue <EyouSoft.Model.EnumType.CrmStructure.CrmMemberState>(Utils.GetFormValue(ddlMemberState.UniqueID), EyouSoft.Model.EnumType.CrmStructure.CrmMemberState.普通);
            info.MemberTypeId   = Utils.GetInt(Utils.GetFormValue(ddlMemberType.UniqueID));
            info.Mobile         = Utils.GetFormValue(txtMobilePhone.UniqueID);
            info.Name           = Utils.GetFormValue(txtName.UniqueID);
            info.National       = Utils.GetFormValue(txtNational.UniqueID);
            info.OperatorId     = SiteUserInfo.UserId;
            info.ProvinceId     = Utils.GetInt(Utils.GetFormValue(ddlProvince.UniqueID));
            info.QQ             = Utils.GetFormValue(txtQQ.UniqueID);
            info.Remark         = Utils.GetFormValue(txtRemark.UniqueID);
            info.Telephone      = Utils.GetFormValue(txtContactPhone.UniqueID);
            info.ZipCode        = Utils.GetFormValue(txtZipCode.UniqueID);
            info.SellerId       = Utils.GetFormValue(Seller1.SellsIDClient);
            #endregion

            //validate form

            int retcode = 0;

            if (IsAdd)
            {
                retcode = new EyouSoft.BLL.CrmStructure.BCrmMember().Insert(info);
            }
            if (IsEdit)
            {
                retcode = new EyouSoft.BLL.CrmStructure.BCrmMember().Update(info);
            }

            AjaxResponse(UtilsCommons.AjaxReturnJson(retcode == 1 ? "1" : "0"));
        }
Exemple #4
0
        /// <summary>
        /// 页面初始化
        /// </summary>
        private void PageInit(string crmId)
        {
            pageIndex = Utils.GetInt(Utils.GetQueryStringValue("Page"), 1);
            IList <EyouSoft.Model.CrmStructure.MJiFenInfo> list = new EyouSoft.BLL.CrmStructure.BCrmMember().GetJiFens(crmId, pageSize, pageIndex, ref recordCount);

            if (list != null && list.Count > 0)
            {
                this.rptList.DataSource = list;
                this.rptList.DataBind();
                BindPage();
            }
            else
            {
                this.rptList.Controls.Add(new Literal()
                {
                    Text = "<tr><td align='center' colspan='5'>暂无积分明细!</td></tr>"
                });
                this.ExporPageInfoSelect1.Visible = false;
            }
        }
Exemple #5
0
        /// <summary>
        /// 修改团队报价(2报价成功 3 修改成功 4操作失败 5销售员超限 6客户超限 7 销售员客户均超限)
        /// 2012-8-17 王磊 返回的结果 去掉【1超限,垫付申请中】
        /// </summary>
        /// <param name="info">报价实体</param>
        /// <returns></returns>
        public int SuccessTourQuote(EyouSoft.Model.TourStructure.MTourQuoteInfo info)
        {
            int result = 3;

            if (info.MTourQuoteTourInfo != null && info.MTourQuoteTourInfo.LDate != null)
            {
                info.MTourQuoteTourInfo.TourId   = System.Guid.NewGuid().ToString();
                info.MTourQuoteTourInfo.TourCode = "";
                //info.OrderCode = info.MTourQuoteTourInfo.TourCode + "01";
            }
            info.OrderId   = System.Guid.NewGuid().ToString();
            info.OrderCode = "";
            if (string.IsNullOrEmpty(info.QuoteId))
            {
                //先新增,再报价成功
                info.QuoteId  = System.Guid.NewGuid().ToString();
                info.ParentId = "0";
                if (dal.AddTourQuote(info))
                {
                    result = dal.UpdateTourQuote(info);
                }
            }
            else
            {
                result = dal.UpdateTourQuote(info);
            }
            if (result == 1)
            {
                //添加操作日志
                System.Text.StringBuilder str = new System.Text.StringBuilder();
                str.AppendFormat("报价未成功(超限垫付申请中),,报价编号:{0}", info.QuoteId);
                EyouSoft.BLL.SysStructure.BSysLogHandle.Insert(str.ToString());
            }
            if (result == 2)
            {
                //添加操作日志
                System.Text.StringBuilder str = new System.Text.StringBuilder();
                str.AppendFormat("报价成功,报价编号:{0}", info.QuoteId);
                EyouSoft.BLL.SysStructure.BSysLogHandle.Insert(str.ToString());
            }

            if (result == 2 && info.IsJiFen == 1)
            {
                decimal jiFenBiLi = 0;
                var     setting   = EyouSoft.Security.Membership.UserProvider.GetComSetting(info.CompanyId);
                if (setting != null)
                {
                    jiFenBiLi = (decimal)setting.IntegralProportion / 100M;
                }

                if (jiFenBiLi > 0)
                {
                    var jiFenInfo = new EyouSoft.Model.CrmStructure.MJiFenInfo();
                    EyouSoft.BLL.CrmStructure.BCrmMember bll = new EyouSoft.BLL.CrmStructure.BCrmMember();
                    jiFenInfo.CrmId          = info.BuyCompanyID;
                    jiFenInfo.IssueTime      = System.DateTime.Now;
                    jiFenInfo.JiFen          = info.TotalPrice * jiFenBiLi;
                    jiFenInfo.JiFenShiJian   = System.DateTime.Now;
                    jiFenInfo.OperatorId     = info.OperatorInfo.OperatorId;
                    jiFenInfo.Remark         = string.Empty;
                    jiFenInfo.ZengJianLeiBie = EyouSoft.Model.EnumType.CrmStructure.JiFenZengJianLeiBie.增加;
                    jiFenInfo.OrderId        = info.OrderId;
                    jiFenInfo.OrderJinE      = info.TotalPrice;
                    jiFenInfo.JiFenBiLi      = jiFenBiLi;

                    new EyouSoft.BLL.CrmStructure.BCrmMember().SetJiFen(jiFenInfo);
                }
            }

            return(result);
        }
Exemple #6
0
        /// <summary>
        /// init info
        /// </summary>
        void InitInfo()
        {
            if (IsAdd)
            {
                return;
            }
            string crmId = Utils.GetQueryStringValue("crmid");
            var    info  = new EyouSoft.BLL.CrmStructure.BCrmMember().GetInfo(crmId);

            if (info == null)
            {
                return;
            }

            if (info.Birthday.HasValue)
            {
                txtBirthday.Text = info.Birthday.Value.ToString("yyyy-MM-dd");
            }
            txtContactPhone.Text = info.Telephone;
            txtEMail.Text        = info.Email;
            txtHomeAddress.Text  = info.HomeAddress;
            txtIdNumber.Text     = info.IdCardCode;
            if (info.JoinTime.HasValue)
            {
                txtJoinTime.Text = info.JoinTime.Value.ToString("yyyy-MM-dd");
            }
            txtMemberCardNumber.Text = info.MemberCardCode;
            txtMemberDues.Text       = info.HuiFei.ToString("F2");
            txtMobilePhone.Text      = info.Mobile;
            txtName.Text             = info.Name;
            txtNational.Text         = info.National;
            txtQQ.Text                   = info.QQ;
            txtRemark.Text               = info.Remark;
            txtUnitAddress.Text          = info.DanWeiAddress;
            txtWorkUnit.Text             = info.DanWei;
            txtZipCode.Text              = info.ZipCode;
            ddlGender.SelectedValue      = ((int)info.Gender).ToString();
            ddlMemberState.SelectedValue = ((int)info.MemberStatus).ToString();
            ddlMemberType.SelectedValue  = info.MemberTypeId.ToString();
            chbIsRemind.Checked          = info.IsTiXing;
            txtApplicationType.Text      = info.JoinType;
            txtBrevityCode.Text          = info.BriefCode;
            this.Seller1.SellsID         = info.SellerId;
            this.Seller1.SellsName       = info.SellerName;
            Country  = info.CountryId;
            Province = info.ProvinceId;
            City     = info.CityId;
            County   = info.DistrictId;


            if (Utils.GetQueryStringValue("edittype") == "details")
            {
                this.phdSave.Visible = false;
            }

            if (SiteUserInfo.IsHandleElse == false)
            {
                if (info.SellerId != SiteUserInfo.UserId)
                {
                    this.phdSave.Visible = false;
                }
            }
        }