You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DS7/DSWeb/ParameterSet/PreferencesSet.aspx.cs

118 lines
4.9 KiB
C#

3 years ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Text;
using DSWeb.DataAccess;
using System.Data.SqlClient;
using DSWeb.Models;
using DSWeb.EntityDA;
using System.Web.Script.Serialization;
using System.Xml;
namespace DSWeb.ParameterSet
{
public partial class PreferencesSet : System.Web.UI.Page
{
T_ALL_DA T_ALL_DA = new T_ALL_DA();
public string strUserID;//用户GID
protected void Page_Load(object sender, EventArgs e)
{
if (Session["USERID"] != null)
{
strUserID = Session["USERID"].ToString().Trim();
}
else
{
Server.Transfer("~/Error/FriendError.aspx");
return;
//strUserID = "";
}
//
if (!IsPostBack)
{
//保存xml设置
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(Server.MapPath("../vote.xml")); //加载xml
XmlNodeList NodeList = xmlDoc.SelectNodes("/vote/password"); //xml节点的路径
string xmlName = NodeList[0].ChildNodes[0].InnerText; //获取第一个Student节点的StuName
/*if (xmlName == "1") { Response.Redirect("Login_old.aspx"); }
else { Response.Redirect("Login_new.aspx"); }*/
if (NodeList[0].ChildNodes[0].InnerText == "1")
{
this.chkIsShowRemember.Checked = true;
}
else
{
this.chkIsShowRemember.Checked = false;
}
this.hd_comboSubCompanyID.Value = "";
this.hd_comboSubCompany.Value = "";
this.hd_comboPORTLOADID.Value = "";
this.hd_comboPORTLOAD.Value = "";
this.hd_comboBLFRT.Value = "";
this.hd_comboSERVICE.Value = "";
this.hd_kgs.Value = "毛重";
this.cbISCGOL.Checked = false;
this.cbISADVANCE.Checked = false;
}
//加载下拉框
Page.ClientScript.RegisterStartupScript(this.GetType(), "key", "<script>initComboSubCompany();initComboPORTLOAD();initComboBLFRT();initComboSERVICE();setValueComboKGS();</script>");
}
protected void btnEnter_Click(object sender, ImageClickEventArgs e)
{
string alt = "";
string ksgvalue = this.hd_kgs.Value.Trim();
//保存xml设置
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(Server.MapPath("../vote.xml")); //加载xml
XmlNodeList NodeList = xmlDoc.SelectNodes("/vote/password"); //xml节点的路径
string xmlName = NodeList[0].ChildNodes[0].InnerText; //获取第一个Student节点的StuName
/*if (xmlName == "1") { Response.Redirect("Login_old.aspx"); }
else { Response.Redirect("Login_new.aspx"); }*/
if (this.chkIsShowRemember.Checked)
{
NodeList[0].ChildNodes[0].InnerText = "1";
}
else
{
NodeList[0].ChildNodes[0].InnerText = "0";
}
xmlDoc.Save(Server.MapPath("../vote.xml"));
DataSet ds = T_ALL_DA.GetAllSQL("select * from subcomp_seae_def where CORPID=(select Gid from Company where codename='" + this.hd_comboSubCompanyID.Value.Trim() + "')");
if (ds == null)
{
string strcg = "";
strcg = T_ALL_DA.GetStrSQL("Gid", "select Gid from Company where codename='" + this.hd_comboSubCompanyID.Value.Trim() + "' and ISDELETED=0");
alt = T_ALL_DA.GetSubcompSeaeDefInsert(strcg.Trim(), this.hd_comboPORTLOADID.Value, this.hd_comboPORTLOAD.Value, this.hd_comboBLFRT.Value, this.hd_comboSERVICE.Value, strUserID.Trim(), ksgvalue, cbISCGOL.Checked, cbISADVANCE.Checked);
}
else
{
alt = T_ALL_DA.GetSubcompSeaeDefUpdate(ds.Tables[0].Rows[0]["GID"].ToString().Trim(), ds.Tables[0].Rows[0]["CORPID"].ToString().Trim(), this.hd_comboPORTLOADID.Value, this.hd_comboPORTLOAD.Value, this.hd_comboBLFRT.Value, this.hd_comboSERVICE.Value, strUserID.Trim(), ksgvalue, cbISCGOL.Checked, cbISADVANCE.Checked);
}
if (alt != "")
{
Response.Write("<script>alert('" + alt + "');history.back();</script>");
return;
}
else
{
Response.Write("<script>alert('成功提交!');</script>");
return;
}
}
}
}