protected void btnCancelShare_Command(object sender, CommandEventArgs e)
        {
            string customerId = e.CommandArgument.ToString();

            WX.CRM.Customer.MODEL customer = WX.CRM.Customer.NewDataModel(customerId);
            customer.IsShare.value = 0;
            customer.Update();
            WX.CRM.Customer.AddLog(customer.ID.ToInt32(), customer.CustomerName.ToString(), WX.Main.CurUser.UserID, 6, "撤销共享");
            InitCustomerRepeater(false);
        }
        protected void btnDelete_Command(object sender, CommandEventArgs e)
        {
            string customerId = e.CommandArgument.ToString();

            WX.CRM.Customer.MODEL customer = WX.CRM.Customer.NewDataModel(customerId);
            customer.State.value = -1;
            int row = customer.Update();

            WX.CRM.Customer.AddLog(customer.ID.ToInt32(), customer.CustomerName.ToString(), WX.Main.CurUser.UserID, 8, "");
            if (row > 0)
            {
                mes = "window.alert('客户信息已成功废弃!');"; InitCustomerRepeater(false);
            }
        }
Exemple #3
0
 protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     WX.CRM.Customer.MODEL model = WX.CRM.Customer.NewDataModel(e.CommandArgument);
     if (e.CommandName == "state1")
     {
         model.State.value = -1;
     }
     else
     {
         model.State.value = 2;
     }
     model.UpTime.value = DateTime.Now;
     model.Update();
     WX.CRM.Customer.AddLog(model.ID.ToInt32(), model.CustomerName.ToString(), WX.Main.CurUser.UserID, 13, model.State.ToInt32() == 2?"不通过":"通过");
     InitRecycle();
 }
        protected void btnEdit_Command(object sender, CommandEventArgs e)
        {
            string customerId = e.CommandArgument.ToString();

            WX.CRM.Customer.MODEL customer = WX.CRM.Customer.NewDataModel(customerId);
            customer.State.value      = 2;
            customer.DeptId.value     = WX.Main.CurUser.UserModel.DepartmentID.value;
            customer.EmployeeID.value = WX.Main.CurUser.UserID;
            customer.IsShare.value    = 0;
            customer.UpTime.value     = DateTime.Now;
            int row = customer.Update();

            WX.CRM.Customer.AddLog(customer.ID.ToInt32(), customer.CustomerName.ToString(), WX.Main.CurUser.UserID, 9, "");
            if (row > 0)
            {
                mes = "window.alert('客户信息已成功回收!');"; InitCustomerRepeater(false);
            }
        }
Exemple #5
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            WX.CRM.Customer.MODEL customer = getnew();
            customer.State.set(2);
            customer.CheckUserId.value = WX.Main.CurUser.UserID;
            customer.UpTime.value      = DateTime.Now;
            if (customer.ID.ToInt32() > 0)
            {
                customer.Update();
            }
            else
            {
                customer.Insert();
            }

            WX.CRM.CustomerTemp.MODEL customertemp = WX.Request.rCustomerTempToTempID;
            customertemp.Delete();
            mes = "butsumit();";
            WX.CRM.Customer.AddLog(customer.ID.ToInt32(), customer.CustomerName.ToString(), customer.CheckUserId.ToString(), 2, "通过");
        }
Exemple #6
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            if (ddlProcessState.SelectedValue == "4")
            {
                ccp.Visible = true;
            }
            else
            {
                ccp.Visible = false;
            }
            WX.CRM.Track.MODEL track;
            if (Request["TrackID"] != null && Request["TrackID"] != "")
            {
                track = WX.CRM.Track.NewDataModel(Request["TrackID"]);
            }
            else
            {
                track = WX.CRM.Track.NewDataModel();
                track.UserID.value = WX.Main.CurUser.UserID;
            }
            track.ProcessState.value = ddlProcessState.SelectedValue;
            track.CustomerID.value   = WX.Request.rCustomerID;
            track.TrackNo.value      = txtTrackNo.Text;
            track.Fee.value          = txtFee.Text;
            track.Remarks.value      = txtremark.Text + "|" + txtremark2.Text + "|" + txtremark3.Text + "|" + txtremark4.Text;
            track.IP.value           = System.Web.HttpContext.Current.Request.UserHostAddress;
            track.LogParaments.value = txtLogParaments.Text;
            track.Type.value         = 0;
            if (txtTrackTime.Text.Trim() == "")
            {
                mess = "Messages('跟踪时间必填!')";
                return;
            }
            track.TrackTime.value = txtTrackTime.Text;
            track.State.value     = rblstate.SelectedValue; //track.TrackTime.ToDateTime() < DateTime.Now ? 1 : 0;

            if (Request["TrackID"] != null && Request["TrackID"] != "")
            {
                track.Update();
                if (track.ProcessState.ToInt32() == 4)
                {
                    WX.CRM.CustomerProgram.MODEL programmodel = WX.CRM.CustomerProgram.GetModel("SELECT * FROM CRM_CustomerProgram where TrackID=" + Request["TrackID"]);
                    if (programmodel != null)
                    {
                        SetProgram(programmodel, track.id.ToInt32());
                    }
                }
                else if (track.ProcessState.ToInt32() == 5)
                {
                    WX.CRM.CustomerAgreement.MODEL agreementmodel = WX.CRM.CustomerAgreement.GetModel("SELECT * FROM CRM_CustomerAgreement where TrackID=" + Request["TrackID"]);
                    SetAgreement(agreementmodel, track.id.ToInt32());
                }
            }
            else
            {
                int trackid = track.Insert(true);
                if (track.ProcessState.ToInt32() == 4)
                {
                    WX.CRM.CustomerProgram.MODEL programmodel = WX.CRM.CustomerProgram.NewDataModel();
                    SetProgram(programmodel, trackid);
                }
                else if (track.ProcessState.ToInt32() == 5)
                {
                    WX.CRM.CustomerAgreement.MODEL agreementmodel = WX.CRM.CustomerAgreement.NewDataModel();
                    SetAgreement(agreementmodel, trackid);
                }
            }
            //当签订协议后更改促成方案的状态
            if (track.ProcessState.ToInt32() == 5 && track.State.ToInt32() == 1 && DropProgram.SelectedValue != "0")
            {
                WX.CRM.CustomerProgram.MODEL cprogram = WX.CRM.CustomerProgram.NewDataModel(DropProgram.SelectedValue);
                cprogram.State.value      = 1;
                cprogram.Updatetime.value = DateTime.Now;
                cprogram.Update();
            }
            WX.CRM.Customer.MODEL customer = WX.CRM.Customer.NewDataModel(track.CustomerID.value);
            if (customer.StageID.ToInt32() == 0 && (track.ProcessState.ToInt32() == 0 || track.ProcessState.ToInt32() == 1))
            {
                customer.StageID.value = 1;
            }
            else if (customer.StageID.ToInt32() == 1 && (track.ProcessState.ToInt32() == 2 || track.ProcessState.ToInt32() == 3 || track.ProcessState.ToInt32() == 4))
            {
                customer.StageID.value = 2;
            }
            else if (customer.StageID.ToInt32() == 2 && (track.ProcessState.ToInt32() == 5 || track.ProcessState.ToInt32() == 6 || track.ProcessState.ToInt32() == 7 || track.ProcessState.ToInt32() == 8))
            {
                customer.StageID.value = 3;
            }
            else if (customer.StageID.ToInt32() == 3 && track.ProcessState.ToInt32() > 8)
            {
                customer.StageID.value = 4;
            }
            if (rblstate.SelectedValue == "1" && Convert.ToDouble(track.Fee.value) > 0)
            {
                WX.CRM.CustomerTemp.MODEL temp = WX.Request.rCustomerTempToCID;
                if (temp != null)
                {
                    temp.LastMaintainMoney.value = track.Fee.value;
                    temp.MaintainMoney.value     = Convert.ToDouble(temp.MaintainMoney.value) + Convert.ToDouble(track.Fee.value);
                    temp.Update();
                    customer.LastMaintainMoney.value = temp.LastMaintainMoney.value;
                    customer.MaintainMoney.value     = temp.MaintainMoney.value;
                }
                else
                {
                    customer.LastMaintainMoney.value = track.Fee.value;
                    customer.MaintainMoney.value     = Convert.ToDouble(customer.MaintainMoney.value) + Convert.ToDouble(track.Fee.value);
                }
            }
            customer.Update();

            WX.CRM.Customer.AddLog(customer.ID.ToInt32(), customer.CustomerName.ToString(), WX.Main.CurUser.UserID, 11, ddlProcessState.SelectedItem.Text);
            if (track.ProcessState.ToInt32() == 5)
            {
                Response.Redirect("CRM_SingleM_EditAgreement.aspx?TrackID=" + track.id.ToString());
            }
            else
            {
                WX.Main.CloseDialog_In_EasyUIDialog(this, "提交成功!");
            }
        }