Beispiel #1
0
        protected void btnUplodIDCard_Click(object sender, ImageClickEventArgs e)
        {
            if (null == CurrentUser)
            {
                Maticsoft.Common.MessageBox.ShowFailTip(this, "您尚未登录,无法进行身份验证!");
                return;
            }
            if (!Maticsoft.Common.PageValidate.CheckIDCard(this.txtIDCard.Text))
            {
                Maticsoft.Common.MessageBox.ShowFailTip(this, "对不起,您输入的身份证格式有误,请重新输入!");
                return;
            }
            Model.UserExp.UsersApprove model = new Model.UserExp.UsersApprove();
            model.UserID = CurrentUser.UserID;
            model.CreatedDate = DateTime.Now;
            model.Status = 0;//未审核
            model.ImgURL = this.hfImgURL.Value;
            if (!string.IsNullOrEmpty(uploadFile))
            {
                string outPath = string.Empty;
                Common.FileUpLoad.uploadFileControl(fileIDCard.PostedFile, uploadFile += "/" + CurrentUser.UserID, "pic", out outPath);
                if (!string.IsNullOrEmpty(outPath))
                {
                    model.ImgURL = outPath;
                }
            }
            model.IDCard = hfIDCard.Value;
            if (!string.IsNullOrEmpty(this.txtIDCard.Text))
            {
                model.IDCard = this.txtIDCard.Text;
            }
            model.ApproveType = 1;//身份证
            if (string.IsNullOrEmpty(model.ImgURL))
            {
                Maticsoft.Common.MessageBox.ShowFailTip(this, "对不起,您尚未选择文件!");
                return;
            }
            if (usersApproveBLL.Exists(CurrentUser.UserID, 1))
            {
                Model.UserExp.UsersApprove usersApproveModel = usersApproveBLL.GetModelByUidAndType(CurrentUser.UserID, 1);
                if (null != usersApproveModel)
                {
                    if (usersApproveModel.Status.HasValue)
                    {
                        switch (usersApproveModel.Status)
                        {
                            case 0:
                            case 2:
                                model.Status = 0;
                                model.ID = usersApproveModel.ID;
                                usersApproveBLL.Update(model);
                                ShowInfo();
                                Maticsoft.Common.MessageBox.ShowSuccessTip(this, "保存成功!");
                                break;

                            case 1:
                                Maticsoft.Common.MessageBox.ShowFailTip(this, "你已经上传了该类型的认证资料并通过认证,请勿重复上传!");
                                break;
                        }
                    }
                }
            }
            else
            {
                if (0 < usersApproveBLL.Add(model))
                {
                    ShowInfo();
                    Maticsoft.Common.MessageBox.ShowSuccessTip(this, "保存成功!");
                }
                else
                {
                    Maticsoft.Common.MessageBox.ShowFailTip(this, "上传失败!");
                    return;
                }
            }
        }
Beispiel #2
0
        protected void upDoc_Click(object sender, ImageClickEventArgs e)
        {
            if (ddlUpType.SelectedIndex == 0)
            {
                Maticsoft.Common.MessageBox.ShowFailTip(this, "请先选择认证类型!");
                return;
            }

            int iiaa = int.Parse(this.Hftype.Value);
            bool isExist = usersApproveBLL.Exists(CurrentUser.UserID, iiaa);
            if (isExist)
            {
                Maticsoft.Common.MessageBox.ShowFailTip(this, "你已经上传了该类型的认证资料,请勿重复上传!");
                return;
            }

            if (!string.IsNullOrEmpty(uploadFile))
            {
                uploadFile += "/" + CurrentUser.UserID.ToString();
                HttpPostedFile hpf = DocUp.PostedFile;
                string outPath = string.Empty;
                Common.FileUpLoad.uploadFileControl(hpf, uploadFile, "pic", out outPath);
                if (!string.IsNullOrEmpty(outPath))
                {
                    this.FilePath.Value = outPath;
                    Model.UserExp.UsersApprove appModel = new Model.UserExp.UsersApprove();
                    appModel.UserID = CurrentUser.UserID;
                    appModel.CreatedDate = DateTime.Now;
                    appModel.Status = 0;
                    appModel.ImgURL = this.FilePath.Value;
                    appModel.ApproveType = int.Parse(this.Hftype.Value);
                    if (usersApproveBLL.Add(appModel) > 0)
                    {
                        Maticsoft.Common.MessageBox.ShowAndRedirect(this, "证书上传成功!", "UserAuthen.aspx");
                    }
                    else
                    {
                        Maticsoft.Common.MessageBox.ShowFailTip(this, "证书上传失败!");
                    }
                }
                else
                {
                    //认证资料上传失败
                }
            }
            else
            {
                // 保存路径为空 后台没有配置认证资料保存路径
            }
        }
Beispiel #3
0
 protected void btnSubmit_Click(object sender, ImageClickEventArgs e)
 {
     if (null == CurrentUser)
     {
         Maticsoft.Common.MessageBox.ShowFailTip(this, "您尚未登录,无法进行身份验证!");
         return;
     }
     Model.UserExp.UsersApprove appModel = new Model.UserExp.UsersApprove();
     appModel.UserID = CurrentUser.UserID;
     appModel.CreatedDate = DateTime.Now;
     appModel.Status = 0;
     appModel.ImgURL = this.FilePath.Value;
     if (!string.IsNullOrEmpty(this.Hftype.Value) && Maticsoft.Common.PageValidate.IsNumber(this.Hftype.Value))
     {
         appModel.ApproveType = int.Parse(this.Hftype.Value);
     }
     if (usersApproveBLL.Add(appModel) > 0)
     {
         ShowInfo();
         Maticsoft.Common.MessageBox.ShowSuccessTip(this, "保存成功!", "UserAuthen.aspx");
     }
     else
     {
         Maticsoft.Common.MessageBox.ShowFailTip(this, "保存失败!");
     }
 }