protected void Page_Load(object sender, EventArgs e) { if (!long.TryParse(Request.QueryString["type"], out type)) { Response.Write("<script>alert('获取相关信息失败,返回上一页');window.close();</script>"); } if (!long.TryParse(Request.QueryString["id"], out id)) { id = 0; } //测试业务范围 //type = 99; //id = 1102; //测试项目状态 //type = 100; //id = 1345; //测试任务类别 //type = 101; //id = 1807; //付款期限 //type = 102; //id = 475; //付款类型 //type = 103; //id = 478; //配送类型 //type = 104; //id = 493; switch (type) { case (long)QueryType.Line_Of_Business: typename = "新增-组织:业务范围"; break; case (long)QueryType.Project_Status: typename = "新增-项目和任务:项目状态"; break; case (long)QueryType.Task_Type: typename = "新增-项目和任务:任务类型"; break; case (long)QueryType.Payment_Term: typename = "新增-财务、会计和发票:付款期限"; Page.ClientScript.RegisterStartupScript(this.GetType(), OpenWindow.GeneralJs.ToString(), @"$('#newicon').show();", true); this.Save_New.Visible = true; break; case (long)QueryType.Payment_Type: typename = "新增-财务、会计和发票:付款类型"; Page.ClientScript.RegisterStartupScript(this.GetType(), OpenWindow.GeneralJs.ToString(), @"$('#newicon').show();", true); this.Save_New.Visible = true; break; case (long)QueryType.Payment_Ship_Type: typename = "新增-财务、会计和发票:配送类型"; Page.ClientScript.RegisterStartupScript(this.GetType(), OpenWindow.GeneralJs.ToString(), @"$('#newicon').show();", true); this.Cost_Code.Visible = true; this.Save_New.Visible = true; break; default: Response.Write("<script>alert('获取相关信息失败,返回上一页');window.close();</script>"); break; } if (!IsPostBack) { if (type == (long)QueryType.Payment_Ship_Type) { Cost_Code.DataTextField = "value"; Cost_Code.DataValueField = "key"; Cost_Code.DataSource = gbll.GetCodeList(); Cost_Code.DataBind(); Cost_Code.Items.Insert(0, new ListItem() { Value = "0", Text = " ", Selected = true }); } this.Active.Checked = true; if (id > 0)//修改 { general = gbll.GetSingleGeneral(id); if (general != null) { typename = typename.Replace("新增", "修改"); this.Name.Text = general.name; if (!string.IsNullOrEmpty(general.remark)) { this.Description.Text = general.remark; } if (general.is_active > 0) { this.Active.Checked = true; } else { this.Active.Checked = false; } if (general.sort_order != null) { this.Sort.Text = general.sort_order.ToString(); } if (type == (long)QueryType.Payment_Term && general.ext1 != null) { this.termday.Text = general.ext1; } if (type == (long)QueryType.Payment_Type && general.ext1 != null) { int re; if (int.TryParse(general.ext1, out re)) { if (re > 0) { this.Reimbursable.Checked = true; } } } if (type == (long)QueryType.Payment_Ship_Type) { int co; if (int.TryParse(general.ext1, out co)) { if (co > 0) { this.Cost_Code.SelectedValue = co.ToString(); } } } } else { Response.Write("<script>alert('获取相关信息失败,返回上一页');window.close();</script>"); } } else { } } else { } }