private void Page_Load(object sender, System.EventArgs e)
{
pyear=DateTime.Now.Year;
pmonth=DateTime.Now.Month;
pday=DateTime.Now.Day;
psecond=DateTime.Now.Second;
Response.Write("<script language=jscript>function SetFocus(){ document.Form1
."+this.txtUsercd.ClientID+".focus();}</script>"); //固定焦点
}
private void btnStart_Click(object sender, System.EventArgs e) //密码验证
{
string strUserName=txtUsercd.Text;
string strPassWord=txtPwdcd.Text;
if(strPassWord.Equals("")==true&&strUserName.Equals("")==true)
{
MessageBox.MsgShow(this.Page,"取引先CDを入力してください。");
}
else if(strPassWord.Equals("")==true &&strUserName.Equals("")==false)
{
MessageBox.MsgShow(this.Page,"パスワードを入力してください。");
Response.Write("<script language=jscript>function SetFocus() { document.Form1."+this.txtPwdcd.ClientID+".focus();}</script>");
}
else if(strPassWord.Equals("")==false&&strUserName.Equals("")==true)
{
MessageBox.MsgShow(this.Page,"取引先CDを入力してください。");
}
else
{
IniReadWrite myini=new IniReadWrite(MapPath("SettingMarketEOS.ini"));
if(myini.IniKeyValue("ベンダーサイトパスワード","password").ToString()==strPassWord)
{
ConDataBase myConDataBase=new ConDataBase();
myConDataBase.ProduceName="smEOS_b_login";
myConDataBase.ParameterAdd(strUserName);
myConDataBase.ParameterAdd("0");
myConDataBase.ParameterAdd("0");
DataSet ds=myConDataBase.GetDataSet("table");
if(ds.Tables["table"].Rows.Count!=0)
{
Response.Redirect("wfrm_b_menu.aspx");
}
else
{
MessageBox.MsgShow(this.Page,"取引先CDが不正です。");
txtUsercd.Text="";
}
}
else
{
ConDataBase myConDataBase=new ConDataBase();
myConDataBase.ProduceName="smEOS_b_login";
myConDataBase.ParameterAdd(""+strUserName+"");
myConDataBase.ParameterAdd("0");
myConDataBase.ParameterAdd("0");
DataSet ds=myConDataBase.GetDataSet("table");
if(ds.Tables["table"].Rows.Count!=0)
{
string password=ds.Tables["table"].Rows[0]["password"].ToString();
if(password.Equals(strPassWord))
{
Response.Redirect("wfrm_b_menu.aspx");
}
else
{
MessageBox.MsgShow(this.Page,"パスワードが不正です。");
Response.Write("<script language=jscript>function SetFocus(){ document.Form1."+this.txtPwdcd.ClientID+".focus();}</script>");
}
}
else
{
MessageBox.MsgShow(this.Page,"取引先CDが不正です。");
txtUsercd.Text="";
}
}
}
}
}
}