?? newlost.aspx.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 + -