Esempio n. 1
0
        public int AddGuarantMoney(WebPeopleGuarantMoney GuarantMoney)
        {
            WebPeopleGuarantMoney webthis = webmoneyservice.GetWebPeopleGuarantMoneyByUserID(GuarantMoney.UserID);

            if (webthis != null && webthis.IsGuarantMoney == 2)
            {
                webmoneyservice.UpdateWebPeopleGuarantMoney(GuarantMoney);
                //申请
                return(1);
            }
            else if (webthis != null && webthis.IsGuarantMoney == 1)
            {
                //已通过
                return(0);
            }
            else if (webthis != null && webthis.IsGuarantMoney == 0)
            {
                //已提交
                return(2);
            }
            else
            {
                //申请
                webmoneyservice.AddWebPeopleGuarantMoney(GuarantMoney);
                return(1);
            }
        }
 public int AddWebPeopleGuarantMoney(WebPeopleGuarantMoney WebPeopleGuarantMoney)
 {
     using (AIYunNetContext context = new AIYunNetContext())
     {
         context.WebPeopleGuarantMoney.Add(WebPeopleGuarantMoney);
         context.SaveChanges();
         return(1);
     }
 }
 public int DeleteWebPeopleGuarantMoney(int WebPeopleGuarantMoneyID)
 {
     using (AIYunNetContext context = new AIYunNetContext())
     {
         WebPeopleGuarantMoney WebPeopleGuarantMoney = context.WebPeopleGuarantMoney.Find(WebPeopleGuarantMoneyID);
         if (WebPeopleGuarantMoney != null)
         {
             WebPeopleGuarantMoney.IsDelete = 1;
             WebPeopleGuarantMoney.DeleteOn = DateTime.Now;
             context.SaveChanges();
             return(1);
         }
         else
         {
             return(0);
         }
     }
 }
        public int IsGuarantMoney(int id)
        {
            using (AIYunNetContext context = new AIYunNetContext())
            {
                if (id != 0)
                {
                    WebPeopleGuarantMoney origWebPeopleGuarantMoney = context.WebPeopleGuarantMoney.Find(id);
                    WebPeople             orwebpeople = context.WebPeople.FirstOrDefault(c => c.UserID == origWebPeopleGuarantMoney.UserID);
                    if (origWebPeopleGuarantMoney != null)
                    {
                        origWebPeopleGuarantMoney.IsGuarantMoney = 1;
                        orwebpeople.IsBond = true;
                        origWebPeopleGuarantMoney.EditOn = DateTime.Now;
                        context.SaveChanges();
                    }
                }


                return(1);
            }
        }
        public int UpdateWebPeopleGuarantMoney(WebPeopleGuarantMoney WebPeopleGuarantMoney)
        {
            using (AIYunNetContext context = new AIYunNetContext())
            {
                if (WebPeopleGuarantMoney != null)
                {
                    WebPeopleGuarantMoney origWebPeopleGuarantMoney = context.WebPeopleGuarantMoney.FirstOrDefault(c => c.UserID == WebPeopleGuarantMoney.UserID);
                    if (origWebPeopleGuarantMoney != null)
                    {
                        //origWebPeopleGuarantMoney.UserID = WebPeopleGuarantMoney.UserID;
                        origWebPeopleGuarantMoney.UserName       = WebPeopleGuarantMoney.UserName;
                        origWebPeopleGuarantMoney.UserPhone      = WebPeopleGuarantMoney.UserPhone;
                        origWebPeopleGuarantMoney.UserType       = WebPeopleGuarantMoney.UserType;
                        origWebPeopleGuarantMoney.IsGuarantMoney = 0;
                        origWebPeopleGuarantMoney.EditOn         = DateTime.Now;
                        context.SaveChanges();
                    }
                }


                return(1);
            }
        }
Esempio n. 6
0
 public ActionResult AddAndUpdateGu(int guid)
 {
     WebPeopleGuarantMoney Gu = GuarantMoneyService.GetWebPeopleGuarantMoneyByID(guid);
     return View(Gu);
 }