protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { string strName = txtName.Text.Trim(); string strCity = ddlCity.SelectedValue.Trim(); if (strName == "") { CommonFunction.AjaxAlert(UpdatePanel1, "请输入路政单位名称"); return; } if (strCity == "") { CommonFunction.AjaxAlert(UpdatePanel1, "请选择地市"); return; } if (DBHelper.IsExistRecord("select count(*) from R_RoadDepart where RD_Name='" + strName + "'")) { CommonFunction.AjaxAlert(UpdatePanel1, "该路政单位名称已存在"); return; } string strLogo = "banner.jpg"; string strSlogon = strName + "欢迎您!"; string sqlStr = "insert into R_RoadDepart(RD_Name,RD_City,RD_Logo,RD_Slogon) values('" + strName + "','" + strCity + "','" + strLogo + "','" + strSlogon + "')"; if (DBHelper.ExecuteCommand(sqlStr) > 0) { CommonFunction.AjaxAlertAndRedirect(UpdatePanel1, "添加成功!", "RoadDepartMgr.aspx"); } }
protected void btnSave_Click(object sender, ImageClickEventArgs e) { UserInfo info = (UserInfo)Session["RoadUser"]; if (txtOldPwd.Text == "") { CommonFunction.AjaxAlert(UpdatePanel1, "请输入原始密码"); txtOldPwd.Focus(); return; } string strPwd = CommonFunction.Decrypt(info.U_LoginPwd, "roadkey"); if (txtOldPwd.Text != strPwd) { CommonFunction.AjaxAlert(UpdatePanel1, "原始密码输入错误"); txtOldPwd.Focus(); return; } if (txtNewPwd.Text == "") { CommonFunction.AjaxAlert(UpdatePanel1, "请输入新密码"); txtNewPwd.Focus(); return; } if (txtNewPwd.Text.Length < 4) { CommonFunction.AjaxAlert(UpdatePanel1, "密码过于简单,长度应为4位数以上"); txtNewPwd.Focus(); return; } if (txtRNewPwd.Text != txtNewPwd.Text) { CommonFunction.AjaxAlert(UpdatePanel1, "密码不一致"); txtRNewPwd.Focus(); return; } strPwd = CommonFunction.Encrypt(txtNewPwd.Text, "roadkey"); string strTrueName = txtTrueName.Text.Trim(); string strPhone = txtPhone.Text.Trim(); string sqlStr = "update R_UserInfo set U_LoginPwd='" + strPwd + "',U_TrueName='" + strTrueName + "',U_Phone='" + strPhone + "' where U_ID=" + info.U_ID; if (DBHelper.ExecuteCommand(sqlStr) > 0) { info.U_LoginPwd = strPwd; info.U_TrueName = strTrueName; info.U_Phone = strPhone; Session["RoadUser"] = info; Session.Timeout = 600; CommonFunction.AjaxAlertAndRedirect(UpdatePanel1, "保存成功", "default.aspx"); } }
/// <summary> /// 编辑部门信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSaveInfo_Click(object sender, ImageClickEventArgs e) { string sqlStr = "update R_RoadDepart set RD_Manager='" + txtRen.Text.Trim() + "',RD_Phone='" + txtPhone.Text.Trim() + "',RD_Fax='" + txtFax.Text.Trim() + "',RD_Email='" + txtEmail.Text.Trim() + "',RD_PostCode='" + txtPostCode.Text.Trim() + "',RD_QQ='" + txtQQ.Text.Trim() + "',RD_City='" + ddlCity.SelectedValue + "',RD_Address='" + txtAddress.Text.Trim() + "',RD_Honour='" + txtHonour.Text + "',RD_Slogon='" + txtSlogon.Text.Trim() + "',RD_Remark='" + txtRemark.Text + "',RD_Report='" + txtReport.Text + "' where RD_ID='" + ViewState["rdid"].ToString() + "'"; if (DBHelper.ExecuteCommand(sqlStr) > 0) { CommonFunction.AjaxAlert(UpdatePanel1, "信息修改成功"); } else { CommonFunction.AjaxAlert(UpdatePanel1, "操作失败,请检查数据是否录入规范"); } }
protected void btnSaveInfo_Click(object sender, ImageClickEventArgs e) { string sqlStr = "update S_TollStation set TS_PinYin='" + txtPinYin.Text.Trim() + "',TS_Stake='" + txtStake.Text.Trim() + "',TS_StakeNum='" + txtStakeNum.Text.Trim() + "',TS_Manager='" + txtRen.Text.Trim() + "',TS_Phone='" + txtPhone.Text.Trim() + "',TS_Honour='" + txtHonour.Text.Trim() + "',TS_Welcome='" + txtWelcome.Text.Trim() + "',TS_Highway='" + ddlHighway.SelectedValue + "',TS_City='" + ddlCity.SelectedValue + "',TS_Company='" + ddlUnit.SelectedValue + "',TS_Star='" + ddlStar.SelectedValue + "',TS_LaneNum='" + txtLaneNum.Text.Trim() + "',TS_ExitToRoad='" + txtExitToRoad.Text.Trim() + "',TS_Remark='" + txtRemark.Text.Trim() + "' where TS_ID='" + ViewState["tsid"].ToString() + "'"; if (DBHelper.ExecuteCommand(sqlStr) > 0) { CommonFunction.AjaxAlert(UpdatePanel1, "信息修改成功"); } else { CommonFunction.AjaxAlert(UpdatePanel1, "操作失败,请检查数据是否录入规范"); } }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { UserInfo info = (UserInfo)Session["StationUser"]; if (txtOldPwd.Text == "") { CommonFunction.AjaxAlert(UpdatePanel1, "请输入原始密码"); txtOldPwd.Focus(); return; } string strPwd = CommonFunction.Encrypt(txtOldPwd.Text, "station"); if (strPwd != info.U_LoginPwd) { CommonFunction.AjaxAlert(UpdatePanel1, "原始密码错误"); txtOldPwd.Focus(); return; } if (txtNewPwd.Text == "") { CommonFunction.AjaxAlert(UpdatePanel1, "请输入新密码"); txtNewPwd.Focus(); return; } if (txtNewPwd.Text.Length < 4) { CommonFunction.AjaxAlert(UpdatePanel1, "密码过于简单,长度应为4位数以上。"); txtNewPwd.Focus(); return; } if (txtRNewPwd.Text != txtNewPwd.Text) { CommonFunction.AjaxAlert(UpdatePanel1, "密码不一致"); txtRNewPwd.Focus(); return; } strPwd = CommonFunction.Encrypt(txtNewPwd.Text, "station"); string sqlStr = "update S_UserInfo set U_LoginPwd='" + strPwd + "' where U_ID=" + info.U_ID; if (DBHelper.ExecuteCommand(sqlStr) > 0) { info.U_LoginPwd = strPwd; Session["StationUser"] = info; Session.Timeout = 30; CommonFunction.AjaxAlertAndRedirect(UpdatePanel1, "密码修改成功", "default.aspx"); } }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { string strName = txtName.Text.Trim(); string strCity = ddlCity.SelectedValue.Trim(); string strCompany = ddlUnit.SelectedValue.Trim(); string strHighway = ddlHighway.SelectedValue.Trim(); string strStar = ddlStar.SelectedValue; if (strName == "") { CommonFunction.AjaxAlert(UpdatePanel1, "请输入收费站名称"); return; } if (strHighway == "") { CommonFunction.AjaxAlert(UpdatePanel1, "请选择高速"); return; } if (strCompany == "") { CommonFunction.AjaxAlert(UpdatePanel1, "请选择单位"); return; } if (strCity == "") { CommonFunction.AjaxAlert(UpdatePanel1, "请选择地市"); return; } if (DBHelper.IsExistRecord("select count(*) from S_TollStation where TS_Name='" + strName + "'")) { CommonFunction.AjaxAlert(UpdatePanel1, "该收费站名称已存在"); return; } string strStakeNum = "0"; string strLogo = "banner.jpg"; string strWelcome = strName + "欢迎您!"; string sqlStr = "insert into S_TollStation(TS_Name,TS_StakeNum,TS_Star,TS_Highway,TS_City,TS_Company,TS_Logo,TS_Welcome) values('" + strName + "','" + strStakeNum + "','" + strStar + "','" + strHighway + "','" + strCity + "','" + strCompany + "','" + strLogo + "','" + strWelcome + "') select @@identity"; string strKey = DBHelper.GetStringScalar(sqlStr); if (strKey.Length > 0) { string sql_User = "******" + strName + "','" + CommonFunction.Encrypt("123", "station") + "','" + strKey + "',0)"; DBHelper.ExecuteCommand(sql_User); CommonFunction.AjaxAlertAndRedirect(UpdatePanel1, "添加成功!", "StationMgr.aspx"); } }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { string strName = txtName.Text.Trim(); string strPwd = txtPwd.Text; string strDepart = ddlRoad.SelectedValue; if (strName == "") { CommonFunction.AjaxAlert(UpdatePanel1, "请输入用户名"); txtName.Focus(); return; } if (DBHelper.IsExistRecord("select count(*) from R_UserInfo where U_LoginName='" + strName + "'")) { CommonFunction.AjaxAlert(UpdatePanel1, "该用户名已存在"); txtName.Focus(); return; } if (strPwd == "") { CommonFunction.AjaxAlert(UpdatePanel1, "请输入密码"); txtPwd.Focus(); return; } if (strPwd.Length < 4) { CommonFunction.AjaxAlert(UpdatePanel1, "密码过于简单,长度应为4位数以上。"); txtPwd.Focus(); return; } if (strDepart == "") { CommonFunction.AjaxAlert(UpdatePanel1, "请选择所属单位"); return; } strPwd = CommonFunction.Encrypt(strPwd, "roadkey"); string sqlStr = "insert into R_UserInfo(U_LoginName,U_LoginPwd,U_RoadID,U_IsSuper) values('" + strName + "','" + strPwd + "','" + strDepart + "',0)"; if (DBHelper.ExecuteCommand(sqlStr) > 0) { CommonFunction.AjaxAlertAndRedirect(UpdatePanel1, "添加成功", "UserMgr.aspx"); } }
protected void btnSubmit_Click(object sender, EventArgs e) { if (txtUName.Text.Trim() == "") { CommonFunction.AjaxAlert(UpdatePanel1, "请输入您的姓名"); return; } if (txtEMail.Text.Trim() == "") { CommonFunction.AjaxAlert(UpdatePanel1, "请输入电子邮件"); return; } if (txtPhone.Text.Trim() == "") { CommonFunction.AjaxAlert(UpdatePanel1, "请输入联系电话"); return; } if (txtContent.Text.Trim() == "") { CommonFunction.AjaxAlert(UpdatePanel1, "请输入留言内容"); return; } MainModel.MessageBoard mess = new MainModel.MessageBoard(); mess.M_UName = txtUName.Text.Trim(); mess.M_Email = txtEMail.Text.Trim(); mess.M_Phone = txtPhone.Text.Trim(); mess.M_Content = txtContent.Text.Trim(); int result = MessageBoardService.Insert_MessageBoard(mess); if (result > 0) { txtUName.Text = ""; txtEMail.Text = ""; txtPhone.Text = ""; txtContent.Text = ""; CommonFunction.AjaxAlertAndRedirect(UpdatePanel1, "提交成功,我们将会在最短的时间内给您回复", "MessageBoard.aspx"); } else { CommonFunction.AjaxAlert(UpdatePanel1, "提交失败,请检查数据是否规范重新提交"); } }
protected void Button__Submit_Click(object sender, EventArgs e) { if (ddlStation.SelectedIndex == 0) { CommonFunction.AjaxAlert(UpdatePanel1, "请选择您要投诉的收费站"); return; } if (txtRen.Text.Trim() == "") { CommonFunction.AjaxAlert(UpdatePanel1, "请填写您的姓名"); return; } if (txtContent.Text == "") { CommonFunction.AjaxAlert(UpdatePanel1, "请填写投诉内容"); return; } if (txtPhone.Text == "") { CommonFunction.AjaxAlert(UpdatePanel1, "请填写您的电话"); return; } if (txtAddress.Text == "") { CommonFunction.AjaxAlert(UpdatePanel1, "请填写您的地址"); return; } S_StationComplaint complain = new S_StationComplaint(); complain.SC_CptName = txtRen.Text.Trim(); complain.SC_CptContent = txtContent.Text.Trim(); complain.SC_Phone = txtPhone.Text.Trim(); complain.SC_Address = txtAddress.Text; complain.SC_TSID = Convert.ToInt32(ddlStation.SelectedValue); new S_StationComplaintSev().AddS_StationComplaint(complain); ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "", "alert('提交成功,我们会在最短的时间内给您答复!');window.location.reload();", true); }