public ActionResult addCompanyGuarantMoney(WebCompanyGuarantMoney GuarantMoney)
        {
            int result = 0;
            WebCompanyGuarantMoney webthis = comGmser.GetWebCompanyGuarantMoneyByUserID(GuarantMoney.CompanyUserID);

            if (webthis != null && webthis.IsGuarantMoney == 2)
            {
                result = comGmser.UpdateWebCompanyGuarantMoney(GuarantMoney);
                //申请
            }
            else if (webthis != null && webthis.IsGuarantMoney == 1)
            {
                //已通过
                result = 0;
            }
            else if (webthis != null && webthis.IsGuarantMoney == 0)
            {
                //已提交
                result = 2;
            }
            else
            {
                //申请
                result = comGmser.AddWebCompanyGuarantMoney(GuarantMoney);
            }
            return(Json(new { RetCode = result }, JsonRequestBehavior.AllowGet));
        }
 public int AddWebCompanyGuarantMoney(WebCompanyGuarantMoney WebCompanyGuarantMoney)
 {
     using (AIYunNetContext context = new AIYunNetContext())
     {
         context.WebCompanyGuarantMoney.Add(WebCompanyGuarantMoney);
         context.SaveChanges();
         return(1);
     }
 }
        public ActionResult CompanyGuarantMoney(int UserID)
        {
            WebCompanyGuarantMoney comGm = comGmser.GetWebCompanyGuarantMoneyByUserID(UserID);

            if (comGm == null)
            {
                comGm = new WebCompanyGuarantMoney();
            }
            return(View(comGm));
        }
 public int DeleteWebCompanyGuarantMoney(int WebCompanyGuarantMoneyID)
 {
     using (AIYunNetContext context = new AIYunNetContext())
     {
         WebCompanyGuarantMoney WebCompanyGuarantMoney = context.WebCompanyGuarantMoney.Find(WebCompanyGuarantMoneyID);
         if (WebCompanyGuarantMoney != null)
         {
             WebCompanyGuarantMoney.IsDelete = 1;
             WebCompanyGuarantMoney.DeleteOn = DateTime.Now;
             context.SaveChanges();
             return(1);
         }
         else
         {
             return(0);
         }
     }
 }
        public int IsGuarantMoney(int id)
        {
            using (AIYunNetContext context = new AIYunNetContext())
            {
                if (id != 0)
                {
                    WebCompanyGuarantMoney origWebCompanyGuarantMoney = context.WebCompanyGuarantMoney.Find(id);
                    WebCompany             orwebcom = context.WebCompany.FirstOrDefault(c => c.WebCompanyUserID == origWebCompanyGuarantMoney.CompanyUserID);
                    if (origWebCompanyGuarantMoney != null)
                    {
                        origWebCompanyGuarantMoney.IsGuarantMoney = 1;
                        orwebcom.IsBond = true;
                        origWebCompanyGuarantMoney.EditOn = DateTime.Now;
                        context.SaveChanges();
                    }
                }


                return(1);
            }
        }
        public int UpdateWebCompanyGuarantMoney(WebCompanyGuarantMoney WebCompanyGuarantMoney)
        {
            using (AIYunNetContext context = new AIYunNetContext())
            {
                if (WebCompanyGuarantMoney != null)
                {
                    WebCompanyGuarantMoney origWebCompanyGuarantMoney = context.WebCompanyGuarantMoney.FirstOrDefault(c => c.CompanyUserID == WebCompanyGuarantMoney.CompanyUserID);
                    if (origWebCompanyGuarantMoney != null)
                    {
                        //origWebCompanyGuarantMoney.UserID = WebCompanyGuarantMoney.UserID;
                        origWebCompanyGuarantMoney.CompanyID      = WebCompanyGuarantMoney.CompanyID;
                        origWebCompanyGuarantMoney.CompanyName    = WebCompanyGuarantMoney.CompanyName;
                        origWebCompanyGuarantMoney.CompanyPhone   = WebCompanyGuarantMoney.CompanyPhone;
                        origWebCompanyGuarantMoney.IsGuarantMoney = 0;
                        origWebCompanyGuarantMoney.EditOn         = DateTime.Now;
                        context.SaveChanges();
                    }
                }


                return(1);
            }
        }
示例#7
0
        public ActionResult AddAndUpdateGu(int guid)
        {
            WebCompanyGuarantMoney Gu = GuarantMoneyService.GetWebCompanyGuarantMoneyByID(guid);

            return(View(Gu));
        }