📄 plan.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.BLL;
using MyCRM.Models;
public partial class department_plan : System.Web.UI.Page
{
int count = 0;
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
Display();
}
}
protected void Display()
{
GridViewChance.DataSource = ChanceManager.GetAllChances();
GridViewChance.DataBind();
}
protected void GridViewChance_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
ImageButton img1 = (ImageButton)e.Row.FindControl("ImageButton1");
ImageButton img2 = (ImageButton)e.Row.FindControl("ImageButton2");
ImageButton img3 = (ImageButton)e.Row.FindControl("ImageButton3");
ImageButton img4 = (ImageButton)e.Row.FindControl("ImageButton4");
if (e.Row.Cells[6].Text.Trim() == "2")
{
e.Row.Cells[6].Text = "开发中";
img4.Visible = false;
}
else if(e.Row.Cells[6].Text.Trim()=="3")
{
e.Row.Cells[6].Text = "已归档";
img1.Visible = false;
img2.Visible = false;
img3.Visible = false;
}
else if (e.Row.Cells[6].Text.Trim() == "4")
{
e.Row.Cells[6].Text = "已终止";
img1.Visible = false;
img2.Visible = false;
img3.Visible = false;
}
}
}
protected void save_Click(object sender, EventArgs e)
{
source();
}
protected void source()
{
string names = name.Text.Trim();
string titles = title.Text.Trim();
string ren = telname.Text.Trim();
GridViewChance.DataSource = ChanceManager.GetChanceSelects(names, titles, ren);
GridViewChance.DataBind();
if (GridViewChance.DataSource == null)
{
count = 1;
}
}
protected void GridViewChance_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridViewChance.PageIndex = e.NewPageIndex;
if (count == 1)
{
Display();
}
else
{
source();
}
}
protected void GridViewChance_RowCommand(object sender, GridViewCommandEventArgs e)
{
string chanceid = e.CommandArgument.ToString();
if (e.CommandName == "plan")
{
Response.Redirect("constitute.aspx?chanceid=" + Server.UrlEncode(chanceid.Trim()) + "");
}
if (e.CommandName == "feedback")
{
Response.Redirect("administer.aspx?chanceid=" + Server.UrlEncode(chanceid.Trim()) + "");
}
if (e.CommandName == "yes")
{
Sal_chance chance = ChanceManager.GetChanceById(int.Parse(chanceid));
Cst_customer customers = new Cst_customer();
Random rd = new Random();
customers.Customer_no = rd.Next().ToString().Substring(0, 6).Trim();
customers.Customer_name = chance.Chance_customer_name;
customers.Customer_region ="";
customers.Customer_manager_id = chance.Chance_cue_id;
customers.Customer_manager_name =chance.Chance_due_to;
customers.Customer_level =0;
customers.Customer_level_label ="";
customers.Customer_satisfy =0;
customers.Customer_credit =0;
customers.Customer_addr ="";
customers.Customer_zip = "";
customers.Customer_tel = "";
customers.Customer_fax = "";
customers.Customer_website = "";
customers.Customer_licence_no = "";
customers.Customer_chieftain ="";
customers.Customer_bankroll = 0;
customers.Customer_turnover = 0;
customers.Customer_bank ="";
customers.Customer_bank_account = "";
customers.Customer_local_tax_no = "";
customers.Customer_national_tax_no ="";
customers.Customer_status = "1";
CustomerManager.AddCustomer(customers);
Cst_linkman link = new Cst_linkman();
link.Customer= CustomerManager.GetCustomerByCustomerId(customers.Customer_no.Trim());
link.Linkman_memo = "";
link.Linkman_mobile = "";
link.Linkman_tel = chance.Chance_tel;
link.Linkman_sex = "男";
link.Linkman_postion = "";
link.Linkman_name = chance.Chance_linkman;
LinkManManager.AddLinkman(link);
chance.Chance_status = "3";
chance.Chance_id = int.Parse(chanceid);
int result = ChanceManager.UpdateStatus(chance);
if (result > 0)
{
Response.Write("<script>alert('开发计划成功');location.href('plan.aspx');</script>");
}
}
if (e.CommandName == "detail")
{
Response.Redirect("see.aspx?chanceid=" + Server.UrlEncode(chanceid.Trim()) + "");
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -