ChanceItemInfo.aspx.cs
资源名称:yjal.rar [点击查看]
上传用户:shjujing
上传日期:2022-07-28
资源大小:11244k
文件大小:6k
源码类别:
Email客户端
开发平台:
Visual C++
- using System;
- using System.Data;
- using System.Configuration;
- using System.Collections;
- 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 System.Data.SqlClient;
- public partial class Module_Relation_ChatItemInfo : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- if (Session["UserName"] != null)
- {
- if (Session["Popedom"].ToString() == "0")
- {
- this.Panel5.Visible = true;
- }
- }
- else
- {
- Response.Write("<script language=javascript>top.location.href='../../Index.aspx'</script>");
- }
- if (!IsPostBack)
- {
- SqlData da = new SqlData();
- string str = Request["ID"].ToString();
- string cmdtxt1 = "select * from tb_ChanceItem where ID='" + str + "'";
- SqlCommand Com1 = new SqlCommand(cmdtxt1, da.ExceCon());
- SqlDataReader dr1 = Com1.ExecuteReader();
- dr1.Read();
- if (dr1.HasRows)
- {
- this.txtClientAddress.Text = dr1["ClientAddress"].ToString();
- this.txtClientEmail.Text = dr1["ClientEmail"].ToString();
- this.txtClientName.Text = dr1["ClientName"].ToString();
- this.txtComContent.Text = dr1["CommunionContent"].ToString();
- this.txtEndTime.Text = Convert.ToDateTime(dr1["EndTime"]).ToString("yyyy-MM-dd");
- this.txtItemMoney.Text = dr1["ItemMoney"].ToString();
- this.txtItemName.Text = dr1["ItemName"].ToString();
- this.txtOrderCode.Text = dr1["OrderCode"].ToString();
- this.txtPhoneAbout.Text = dr1["PhoneAbout"].ToString();
- this.txtPostCode.Text = dr1["PostCode"].ToString();
- this.txtDepName.Text = dr1["DepName"].ToString();
- this.txtPerson.Text = dr1["ItemPrincipal"].ToString();
- this.txtStartTime.Text = Convert.ToDateTime(dr1["StartTime"]).ToString("yyyy-MM-dd");
- }
- dr1.Close();
- string cmdtxt2 = "select Distinct Name from tb_User";
- SqlCommand Com2 = new SqlCommand(cmdtxt2, da.ExceCon());
- SqlDataReader dr2 = Com2.ExecuteReader();
- while (dr2.Read())
- {
- this.dropDepEmployee.Items.Add(dr2["Name"].ToString());
- }
- dr2.Close();
- string cmdtxt3 = "select Distinct DepName from tb_Department";
- SqlCommand Com = new SqlCommand(cmdtxt3, da.ExceCon());
- SqlDataReader dr3 = Com.ExecuteReader();
- while (dr3.Read())
- {
- this.dropDepAbout.Items.Add(dr3["DepName"].ToString());
- }
- dr3.Close();
- }
- }
- protected void btnDelete_Click(object sender, EventArgs e)
- {
- string cmdtxt = "DELETE FROM tb_ChanceItem where ID='" + Request["ID"].ToString() + "'";
- SqlData da = new SqlData();
- if (da.ExceSQL(cmdtxt))
- {
- Response.Write("<script language=javascript>alert('操作成功!');location='ChanceItem.aspx'</script>");
- CommonClass.WriteNote(this.txtItemName.Text, 2, Session["UserName"].ToString());
- }
- else
- {
- Response.Write("<script language=javascript>alert('操作失败!');location='javascript:history.go(-1)'</script>");
- }
- }
- protected void btnSave_Click(object sender, EventArgs e)
- {
- SqlData da = new SqlData();
- string cmdtxt = "UPDATE tb_ChanceItem SET ItemName='" + this.txtItemName.Text + "',ClientName='" + this.txtClientName.Text + "'";
- cmdtxt += ",ItemPrincipal='" + this.dropDepEmployee.SelectedValue + "',OrderCode='" + this.txtOrderCode.Text + "',ItemMoney='" + this.txtItemMoney.Text + "'";
- cmdtxt += ",StartTime='" + this.txtStartTime.Text + "',EndTime='" + this.txtEndTime.Text + "',PhoneAbout='" + this.txtPhoneAbout.Text + "'";
- cmdtxt += ",ClientAddress='" + this.txtClientAddress.Text + "',PostCode='" + this.txtPostCode.Text + "',ClientEmail='" + this.txtClientEmail.Text + "'";
- cmdtxt += ",CommunionContent='" + this.txtComContent.Text + "',DepName='" + this.dropDepAbout.SelectedValue + "' where ID='"+Request["ID"].ToString()+"'";
- if (da.ExceSQL(cmdtxt))
- {
- Response.Write("<script language=javascript>alert('操作成功!');location='ChanceItem.aspx'</script>");
- CommonClass.WriteNote(this.txtItemName.Text, 1, Session["UserName"].ToString());
- }
- else
- {
- Response.Write("<script language=javascript>alert('操作失败!');location='javascript:history.go(-1)'</script>");
- }
- }
- protected void btnEdit_Click(object sender, EventArgs e)
- {
- this.txtClientAddress.ReadOnly = false;
- this.txtClientEmail.ReadOnly = false;
- this.txtClientName.ReadOnly = false;
- this.txtComContent.ReadOnly = false;
- this.txtEndTime.ReadOnly = false;
- this.txtItemMoney.ReadOnly = false;
- this.txtItemName.ReadOnly = false;
- this.txtOrderCode.ReadOnly = false;
- this.txtPhoneAbout.ReadOnly = false;
- this.txtPostCode.ReadOnly = false;
- this.txtStartTime.ReadOnly = false;
- this.btnDelete.Enabled = true;
- this.btnSave.Enabled = true;
- this.Panel1.Visible = false;
- this.Panel2.Visible = true;
- this.Panel3.Visible = false;
- this.Panel4.Visible = true;
- }
- protected void btnBack_Click(object sender, EventArgs e)
- {
- Response.Write("<script>this.parent.rightFrame.location='ChanceItem.aspx'</script>");
- }
- }