示例#1
0
    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");
        }
    }
示例#2
0
    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");
        }
    }
示例#3
0
    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");
        }
    }
示例#4
0
    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");
        }
    }
示例#5
0
    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");
        }
    }
示例#6
0
    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, "提交失败,请检查数据是否规范重新提交");
        }
    }