示例#1
0
    protected void ibtnAdd_Click(object sender, EventArgs e)
    {
        //验证代码
        try
        {
            TFXK.Model.TestingCenter model = new TFXK.Model.TestingCenter();
            try
            {
                model.id = int.Parse(Request.QueryString["id"].ToString());
            }
            catch { model.id = 0; }

            if (model.id > 0)
            {
                model           = bll.GetModel(model.id);
                model.Status    = ddlState.SelectedIndex;
                model.UserName  = txtUserName.Text;
                model.UserPhone = txtUserPhone.Text;
                model.UserEmail = txtUserEmail.Text;
                if (chkChangePass.Checked && !string.IsNullOrEmpty(txtPass.Text.Trim()))
                {
                    model.UserPass = Security.EncryptDES(txtPass.Text.Trim(), "UEMASTER");
                }
                Modify(model);
            }
        }
        catch (Exception ex)
        {
            log.Error(ex.Message);
            Msg.Show("网络错误!原因:" + ex.Message);
        }
    }
示例#2
0
 private void InitData(int id)
 {
     userOModel             = bll.GetModel(id);
     ddlState.SelectedValue = userOModel.Status + "";
     txtUserName.Text       = userOModel.UserName;
     txtUserPhone.Text      = userOModel.UserPhone;
     txtUserEmail.Text      = userOModel.UserEmail;
 }
示例#3
0
 private void InitData(int examid)
 {
     TFXK.Model.TestingCenter testingCenter = new TFXK.Model.TestingCenter();
     testingCenter = testingCenterBLL.GetModel(examid);
     if (testingCenter != null && testingCenter.Status == 1)
     {
         //wait
     }
     else
     {
         Response.Redirect("Default.aspx");
     }
 }
示例#4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     testingCenter = ExamAuthHelper.GetAuthData(this.Context);
     if (testingCenter == null)
     {
         Response.Redirect("login.aspx");
         return;
     }
     if (testingCenter.Status == 0)
     {
         Response.Redirect("uploadinfo.aspx");
         return;
     }
     if (testingCenter.Status == 1)
     {
         Response.Redirect("WaitForAudit.aspx");
         return;
     }
 }
示例#5
0
 private void InitData(int examid)
 {
     TFXK.Model.TestingCenter testingCenter = new TFXK.Model.TestingCenter();
     testingCenter        = testingCenterBLL.GetModel(examid);
     txtID.Value          = testingCenter.IDNo;
     this.txtIDImg1.Value = testingCenter.IDImage;
     this.txtIDImg2.Value = testingCenter.IDImage2;
     this.txtYYZZ.Value   = testingCenter.WorkImage;
     if (!string.IsNullOrEmpty(testingCenter.IDImage))
     {
         imgID1.Src = testingCenter.IDImage;
     }
     if (!string.IsNullOrEmpty(testingCenter.IDImage2))
     {
         imgID2.Src = testingCenter.IDImage2;
     }
     if (!string.IsNullOrEmpty(testingCenter.WorkImage))
     {
         imgID3.Src = testingCenter.WorkImage;
     }
 }
示例#6
0
    protected void btnReg_ServerClick(object sender, EventArgs e)
    {
        try
        {
            TFXK.Model.TestingCenter testingCenter = new TFXK.Model.TestingCenter();
            testingCenter           = testingCenterBLL.GetModel(ExamAuthHelper.GetAuthCenterID(this.Context));
            testingCenter.IDNo      = txtID.Value.Trim();
            testingCenter.IDImage   = this.txtIDImg1.Value.Trim();
            testingCenter.IDImage2  = this.txtIDImg2.Value.Trim();
            testingCenter.WorkImage = this.txtYYZZ.Value.Trim();
            if (string.IsNullOrEmpty(testingCenter.IDNo))
            {
                Msg.Show("请填写身份证号码!");
                return;
            }
            if (string.IsNullOrEmpty(testingCenter.IDImage))
            {
                Msg.Show("请上传身份证正面照!");
                return;
            }
            else
            {
                imgID1.Src = testingCenter.IDImage;
            }
            if (string.IsNullOrEmpty(testingCenter.IDImage2))
            {
                Msg.Show("请上传身份证背面照!");
                return;
            }
            else
            {
                imgID2.Src = testingCenter.IDImage2;
            }
            if (string.IsNullOrEmpty(testingCenter.WorkImage))
            {
                Msg.Show("请上传营业执照照片!");
                return;
            }
            else
            {
                imgID3.Src = testingCenter.WorkImage;
            }


            testingCenter.Status = 1;
            bool res = testingCenterBLL.Update(testingCenter);
            if (res)
            {
                Response.Redirect("Default.aspx");
            }
            else
            {
                Msg.Show("保存失败!");
                return;
            }
        }
        catch (Exception ex)
        {
            Msg.Show("保存失败!" + ex.Message);
            return;
        }
    }
示例#7
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(TFXK.Model.TestingCenter model)
 {
     return(dal.Update(model));
 }
示例#8
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(TFXK.Model.TestingCenter model)
 {
     model.UserPass   = Security.EncryptDES(model.UserPass, "UEMASTER");
     model.CreateTime = DateTime.Now;
     return(dal.Add(model));
 }
示例#9
0
    protected void btnReg_ServerClick(object sender, EventArgs e)
    {
        try
        {
            TFXK.Model.TestingCenter testingCenter = new TFXK.Model.TestingCenter();
            testingCenter.KDName        = this.txtName.Value.Trim();
            testingCenter.Address       = this.txtAddress.Value.Trim();
            testingCenter.UserName      = this.txtUserName.Value.Trim();
            testingCenter.UserPhone     = this.txtPhone.Value.Trim();
            testingCenter.UserTel       = this.txtTel.Value.Trim();
            testingCenter.UserEmail     = this.txtEmail.Value.Trim();
            testingCenter.UserPass      = this.txtPass.Value.Trim();
            testingCenter.KDDescription = this.txtDes.Value.Trim();

            string password2 = this.txtPass2.Value.Trim();
            if (string.IsNullOrEmpty(testingCenter.KDName))
            {
                Msg.Show("考点名称不能为空!");
                return;
            }
            if (string.IsNullOrEmpty(testingCenter.Address))
            {
                Msg.Show("考点地址不能为空!");
                return;
            }
            if (string.IsNullOrEmpty(testingCenter.UserName))
            {
                Msg.Show("负责人名称不能为空!");
                return;
            }
            if (string.IsNullOrEmpty(testingCenter.UserPhone))
            {
                Msg.Show("负责人电话不能为空!");
                return;
            }
            if (!testingCenter.UserPass.Equals(password2))
            {
                Msg.Show("密码输入不一致!");
                return;
            }
            if (string.IsNullOrEmpty(testingCenter.UserPass))
            {
                Msg.Show("密码不能为空!");
                return;
            }
            if (testingCenterBLL.ExistsName(testingCenter.KDName))
            {
                Msg.Show("考点名已存在!");
                return;
            }
            testingCenter.Status = 0;
            int res = testingCenterBLL.Add(testingCenter);
            if (res > 0)
            {
                Response.Cookies.Add(new HttpCookie("ExamID", res.ToString()));
                Session["ExamID"] = res.ToString();
                Response.Redirect("UploadInfo.aspx");
            }
            else
            {
                Msg.Show("注册失败!");
                return;
            }
        }
        catch (Exception ex)
        {
            Msg.Show("注册失败!" + ex.Message);
            return;
        }
    }
示例#10
0
    protected void btnReg_ServerClick(object sender, EventArgs e)
    {
        try
        {
            TFXK.Model.TestingCenter testingCenter = ExamAuthHelper.GetAuthData(this.Context);;
            testingCenter.Address       = this.txtAddress.Value.Trim();
            testingCenter.UserName      = this.txtUserName.Value.Trim();
            testingCenter.UserPhone     = this.txtPhone.Value.Trim();
            testingCenter.UserTel       = this.txtTel.Value.Trim();
            testingCenter.UserEmail     = this.txtEmail.Value.Trim();
            testingCenter.KDDescription = this.txtDes.Value.Trim();

            string password2 = this.txtPass2.Value.Trim();
            if (string.IsNullOrEmpty(testingCenter.KDName))
            {
                Msg.Show("考点名称不能为空!");
                return;
            }
            if (string.IsNullOrEmpty(testingCenter.Address))
            {
                Msg.Show("考点地址不能为空!");
                return;
            }
            if (string.IsNullOrEmpty(testingCenter.UserName))
            {
                Msg.Show("负责人名称不能为空!");
                return;
            }
            if (string.IsNullOrEmpty(testingCenter.UserPhone))
            {
                Msg.Show("负责人电话不能为空!");
                return;
            }
            if (chkChangePass.Checked)
            {
                if (string.IsNullOrEmpty(testingCenter.UserPass))
                {
                    Msg.Show("密码不能为空!");
                    return;
                }
                if (!testingCenter.UserPass.Equals(password2))
                {
                    Msg.Show("密码输入不一致!");
                    return;
                }
                testingCenter.UserPass = Security.EncryptDES(testingCenter.UserPass, "UEMASTER");
            }
            if (testingCenterBLL.Update(testingCenter))
            {
                Msg.ShowAndRedirect("更新成功", "default.aspx");
            }
            else
            {
                Msg.Show("更新失败!");
                return;
            }
        }
        catch (Exception ex)
        {
            Msg.Show("更新失败!" + ex.Message);
            return;
        }
    }
示例#11
0
 private void Modify(TFXK.Model.TestingCenter model)
 {
     bll.Update(model);
     Msg.ShowAndRedirect("修改信息成功!", "Default.aspx");
 }