Beispiel #1
0
        public int AddAuthentication(WebPeopleAuthentication webAuthen)
        {
            WebPeopleAuthentication webthis = webautnservice.GetWebPeopleAuthenticationByUserID(webAuthen.UserID);

            if (webthis != null && webthis.IsAuthentication == 2)
            {
                webautnservice.UpdateWebPeopleAuthentication(webAuthen);
                //申请
                return(1);
            }
            else if (webthis != null && webthis.IsAuthentication == 1)
            {
                //已通过
                return(0);
            }
            else if (webthis != null && webthis.IsAuthentication == 0)
            {
                //已提交
                return(2);
            }
            else
            {
                //申请
                webautnservice.AddWebPeopleAuthentication(webAuthen);
                return(1);
            }
        }
        public int UpdateWebPeopleAuthentication(WebPeopleAuthentication WebPeopleAuthentication)
        {
            using (AIYunNetContext context = new AIYunNetContext())
            {
                if (WebPeopleAuthentication != null)
                {
                    WebPeopleAuthentication origWebPeopleAuthentication = context.WebPeopleAuthentication.FirstOrDefault(c => c.UserID == WebPeopleAuthentication.UserID);
                    if (origWebPeopleAuthentication != null)
                    {
                        origWebPeopleAuthentication.TrueName = WebPeopleAuthentication.TrueName;
                        //origWebPeopleAuthentication.UserID = WebPeopleAuthentication.UserID;
                        origWebPeopleAuthentication.UserIdentity     = WebPeopleAuthentication.UserTrueName;
                        origWebPeopleAuthentication.UserType         = WebPeopleAuthentication.UserType;
                        origWebPeopleAuthentication.IsAuthentication = 0;
                        origWebPeopleAuthentication.ShengfenF        = WebPeopleAuthentication.ShengfenF;
                        origWebPeopleAuthentication.ShengfenZ        = WebPeopleAuthentication.ShengfenZ;
                        origWebPeopleAuthentication.UserTrueName     = WebPeopleAuthentication.UserTrueName;
                        origWebPeopleAuthentication.EditOn           = DateTime.Now;
                        context.SaveChanges();
                    }
                }


                return(1);
            }
        }
 public int AddWebPeopleAuthentication(WebPeopleAuthentication WebPeopleAuthentication)
 {
     using (AIYunNetContext context = new AIYunNetContext())
     {
         context.WebPeopleAuthentication.Add(WebPeopleAuthentication);
         context.SaveChanges();
         return(1);
     }
 }
 public int DeleteWebPeopleAuthentication(int WebPeopleAuthenticationID)
 {
     using (AIYunNetContext context = new AIYunNetContext())
     {
         WebPeopleAuthentication WebPeopleAuthentication = context.WebPeopleAuthentication.Find(WebPeopleAuthenticationID);
         if (WebPeopleAuthentication != null)
         {
             WebPeopleAuthentication.IsDelete = 1;
             WebPeopleAuthentication.DeleteOn = DateTime.Now;
             context.SaveChanges();
             return(1);
         }
         else
         {
             return(0);
         }
     }
 }
        public int IsAuthentication(int id)
        {
            using (AIYunNetContext context = new AIYunNetContext())
            {
                if (id != 0)
                {
                    WebPeopleAuthentication origWebPeopleAuthentication = context.WebPeopleAuthentication.Find(id);
                    WebPeople orwebpeople = context.WebPeople.FirstOrDefault(c => c.UserID == origWebPeopleAuthentication.UserID);
                    if (origWebPeopleAuthentication != null)
                    {
                        origWebPeopleAuthentication.IsAuthentication = 1;
                        orwebpeople.IsAuthentication       = true;
                        origWebPeopleAuthentication.EditOn = DateTime.Now;
                        context.SaveChanges();
                    }
                }


                return(1);
            }
        }
Beispiel #6
0
 public ActionResult AddAndUpdateAu(int auid)
 {
     WebPeopleAuthentication authen = AuthenticationService.GetWebPeopleAuthenticationByID(auid);
     return View(authen);
 }