⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 newlost.aspx.cs

📁 客户关系管理系统 客户关系管理系统
💻 CS
字号:
using System;
using System.Data;
using System.Configuration;
using System.Collections.Generic;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using MyCRM.Models;
using MyCRM.BLL;

public partial class client_newlost : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            if (Session["User"] != null && Request.QueryString["lostid"] != null)
            {
                string lostid = Request.Params["lostid"].ToString();
                Cst_lost lost = LostManager.GetLostByLostId(int.Parse(lostid));
                if (Request.QueryString["num"] != null)
                {
                    name.Text = "确认流失";
                    btn.Text = "确认流失";
                    yuan.Text = "流失原因";
                    num.Text = lost.Lost_id.ToString();
                    ku.Text = lost.Customer.Customer_name;
                    manager.Text = lost.Lost_customer_manager_name;
                    time.Text = lost.Lost_last_order_date.ToString("yyyy年MM月dd日");
                    title.Text = lost.Lost_delay;
                }
                else
                {
                    name.Text = "暂缓流失";
                    num.Text = lost.Lost_id.ToString();
                    ku.Text = lost.Customer.Customer_name;
                    manager.Text = lost.Lost_customer_manager_name;
                    time.Text = lost.Lost_last_order_date.ToString("yyyy年MM月dd日");
                    title.Text = lost.Lost_delay;
                }
            }
        }

    }
    protected void save_Click(object sender, EventArgs e)
    {
        clck();
    }
    protected void clck()
    {
        string lostid = Request.Params["lostid"].ToString();
        Cst_lost cs = new Cst_lost();
        int result = 0;
        if (yuan.Text.Trim() == "流失原因")
        {
            cs.Lost_id = int.Parse(lostid);
            cs.Lost_reason = desc.Text;
            cs.Lost_lost_date = DateTime.Now;
            cs.Lost_status = "3";
            cs.Lost_delay = title.Text;
          result= LostManager.Update(cs);
          if (result > 0)
          {
              Response.Redirect("lost.aspx");
          }
        }
        else
        {
            Cst_lost lost = LostManager.GetLostByLostId(int.Parse(lostid));
            cs.Lost_id = int.Parse(lostid);
            string a = desc.Text+"</br>";
            cs.Lost_delay=lost.Lost_delay+a;
            cs.Lost_lost_date = DateTime.Now;
            cs.Lost_status = "2";
            cs.Lost_reason = "";
          result=  LostManager.Update(cs);
            if (result > 0)
            {
                Response.Redirect("lost.aspx");
            }
        }
    }
    protected void btn_Click(object sender, EventArgs e)
    {
        clck();
    }
    protected void exit_Click(object sender, EventArgs e)
    {
        Response.Redirect("lost.aspx");
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -