public void UserApprove(FormCollection collection)
 {
     JsonObject obj2 = new JsonObject();
     string str = collection["TrueName"];
     string str2 = collection["IdCardVal"];
     string str3 = collection["hiddenIdCardPreImage"];
     string str4 = collection["hiddenIdCardNeImage"];
     if ((!string.IsNullOrWhiteSpace(str) && !string.IsNullOrWhiteSpace(str2)) && (!string.IsNullOrWhiteSpace(str3) && !string.IsNullOrWhiteSpace(str4)))
     {
         Maticsoft.Model.Members.UsersApprove approve = new Maticsoft.Model.Members.UsersApprove {
             UserID = base.CurrentUser.UserID,
             TrueName = str,
             IDCardNum = str2,
             FrontView = string.Format(str3, ""),
             RearView = string.Format(str4, ""),
             Status = 0,
             UserType = 0,
             CreatedDate = DateTime.Now
         };
         base.Session["USERAPPROVE"] = approve;
         obj2.Accumulate("STATUS", "SUCCESS");
     }
     else
     {
         obj2.Accumulate("STATUS", "FAILE");
     }
     base.Response.Write(obj2.ToString());
 }
 public ActionResult UserApprove(int? Id)
 {
     ((dynamic) base.ViewBag).Title = "实名认证";
     Maticsoft.BLL.Members.UsersApprove approve = new Maticsoft.BLL.Members.UsersApprove();
     Maticsoft.Model.Members.UsersApprove model = new Maticsoft.Model.Members.UsersApprove();
     model = approve.GetModelByUserID(base.CurrentUser.UserID);
     if (model != null)
     {
         return this.Redirect(string.Format("/UserCenter/SubmitSucc/{0}", model.Status));
     }
     if (Id.HasValue)
     {
         if (base.Session["USERAPPROVE"] != null)
         {
             model = (Maticsoft.Model.Members.UsersApprove) base.Session["USERAPPROVE"];
         }
         ((dynamic) base.ViewBag).UserID = base.CurrentUser.UserID;
         return base.View(model);
     }
     base.Session["USERAPPROVE"] = null;
     ((dynamic) base.ViewBag).UserID = base.CurrentUser.UserID;
     model = new Maticsoft.Model.Members.UsersApprove {
         UserID = base.CurrentUser.UserID
     };
     return base.View(model);
 }
 public ActionResult SubmitApprove()
 {
     ((dynamic) base.ViewBag).Title = "实名认证--确认并提交";
     Maticsoft.Model.Members.UsersApprove model = new Maticsoft.Model.Members.UsersApprove();
     if (base.Session["USERAPPROVE"] != null)
     {
         model = (Maticsoft.Model.Members.UsersApprove) base.Session["USERAPPROVE"];
         if (model != null)
         {
             return base.View(model);
         }
     }
     return base.RedirectToAction("UserApprove", "UserCenter");
 }
 public void SubmitApprove(FormCollection collection)
 {
     JsonObject obj2 = new JsonObject();
     if (base.Session["USERAPPROVE"] != null)
     {
         Maticsoft.BLL.Members.UsersApprove approve = new Maticsoft.BLL.Members.UsersApprove();
         Maticsoft.Model.Members.UsersApprove model = new Maticsoft.Model.Members.UsersApprove();
         model = (Maticsoft.Model.Members.UsersApprove) base.Session["USERAPPROVE"];
         string oldValue = string.Format("/Upload/Temp/{0}/", DateTime.Now.ToString("yyyyMMdd"));
         string newValue = "/Upload/SNS/Images/ApproveImage/";
         ArrayList fileNameList = new ArrayList();
         fileNameList.Add(model.FrontView.Replace(oldValue, ""));
         fileNameList.Add(model.RearView.Replace(oldValue, ""));
         model.FrontView = model.FrontView.Replace(oldValue, newValue);
         model.RearView = model.RearView.Replace(oldValue, newValue);
         if (approve.Add(model) > 0)
         {
             FileManage.MoveFile(base.Server.MapPath(oldValue), base.Server.MapPath(newValue), fileNameList);
             base.Session["USERAPPROVE"] = null;
             obj2.Accumulate("STATUS", "SUCCESS");
         }
         else
         {
             obj2.Accumulate("STATUS", "FAILE");
         }
     }
     else
     {
         obj2.Accumulate("STATUS", "FAILE");
     }
     base.Response.Write(obj2.ToString());
 }
Beispiel #5
0
 public List<Maticsoft.Model.Members.UsersApprove> DataTableToList(DataTable dt)
 {
     List<Maticsoft.Model.Members.UsersApprove> list = new List<Maticsoft.Model.Members.UsersApprove>();
     int count = dt.Rows.Count;
     if (count > 0)
     {
         for (int i = 0; i < count; i++)
         {
             Maticsoft.Model.Members.UsersApprove item = new Maticsoft.Model.Members.UsersApprove();
             if ((dt.Rows[i]["ApproveID"] != null) && (dt.Rows[i]["ApproveID"].ToString() != ""))
             {
                 item.ApproveID = int.Parse(dt.Rows[i]["ApproveID"].ToString());
             }
             if ((dt.Rows[i]["UserID"] != null) && (dt.Rows[i]["UserID"].ToString() != ""))
             {
                 item.UserID = int.Parse(dt.Rows[i]["UserID"].ToString());
             }
             if ((dt.Rows[i]["TrueName"] != null) && (dt.Rows[i]["TrueName"].ToString() != ""))
             {
                 item.TrueName = dt.Rows[i]["TrueName"].ToString();
             }
             if ((dt.Rows[i]["IDCardNum"] != null) && (dt.Rows[i]["IDCardNum"].ToString() != ""))
             {
                 item.IDCardNum = dt.Rows[i]["IDCardNum"].ToString();
             }
             if ((dt.Rows[i]["FrontView"] != null) && (dt.Rows[i]["FrontView"].ToString() != ""))
             {
                 item.FrontView = dt.Rows[i]["FrontView"].ToString();
             }
             if ((dt.Rows[i]["RearView"] != null) && (dt.Rows[i]["RearView"].ToString() != ""))
             {
                 item.RearView = dt.Rows[i]["RearView"].ToString();
             }
             if ((dt.Rows[i]["DueDate"] != null) && (dt.Rows[i]["DueDate"].ToString() != ""))
             {
                 item.DueDate = new DateTime?(DateTime.Parse(dt.Rows[i]["DueDate"].ToString()));
             }
             if ((dt.Rows[i]["Status"] != null) && (dt.Rows[i]["Status"].ToString() != ""))
             {
                 item.Status = int.Parse(dt.Rows[i]["Status"].ToString());
             }
             if ((dt.Rows[i]["ApproveUserID"] != null) && (dt.Rows[i]["ApproveUserID"].ToString() != ""))
             {
                 item.ApproveUserID = int.Parse(dt.Rows[i]["ApproveUserID"].ToString());
             }
             if ((dt.Rows[i]["UserType"] != null) && (dt.Rows[i]["UserType"].ToString() != ""))
             {
                 item.UserType = new int?(int.Parse(dt.Rows[i]["UserType"].ToString()));
             }
             if ((dt.Rows[i]["CreatedDate"] != null) && (dt.Rows[i]["CreatedDate"].ToString() != ""))
             {
                 item.CreatedDate = DateTime.Parse(dt.Rows[i]["CreatedDate"].ToString());
             }
             if ((dt.Rows[i]["ApproveDate"] != null) && (dt.Rows[i]["ApproveDate"].ToString() != ""))
             {
                 item.ApproveDate = new DateTime?(DateTime.Parse(dt.Rows[i]["ApproveDate"].ToString()));
             }
             list.Add(item);
         }
     }
     return list;
 }