public int UpdateWebCompanyAuthentication(WebCompanyAuthentication WebCompanyAuthentication) { using (AIYunNetContext context = new AIYunNetContext()) { if (WebCompanyAuthentication != null) { WebCompanyAuthentication origWebCompanyAuthentication = context.WebCompanyAuthentication.FirstOrDefault(c => c.CompanyUserID == WebCompanyAuthentication.CompanyUserID); if (origWebCompanyAuthentication != null) { origWebCompanyAuthentication.CompanyID = WebCompanyAuthentication.CompanyID; origWebCompanyAuthentication.CompanyName = WebCompanyAuthentication.CompanyName; origWebCompanyAuthentication.PeopleName = WebCompanyAuthentication.PeopleName; origWebCompanyAuthentication.IsAuthentication = 0; origWebCompanyAuthentication.ShengfenF = WebCompanyAuthentication.ShengfenF; origWebCompanyAuthentication.ShengfenZ = WebCompanyAuthentication.ShengfenZ; origWebCompanyAuthentication.PeopleIdentity = WebCompanyAuthentication.PeopleIdentity; origWebCompanyAuthentication.ZthumbnailImage = WebCompanyAuthentication.ZthumbnailImage; origWebCompanyAuthentication.FthumbnailImage = WebCompanyAuthentication.FthumbnailImage; origWebCompanyAuthentication.UploadFile = WebCompanyAuthentication.UploadFile; origWebCompanyAuthentication.EditOn = DateTime.Now; context.SaveChanges(); } } return(1); } }
public ActionResult addCompanyAuthentication(WebCompanyAuthentication webAuthen) { int result = 0; WebCompanyAuthentication webthis = comAuser.GetWebCompanyAuthenticationByUserID(webAuthen.CompanyUserID); if (webthis != null && webthis.IsAuthentication == 2) { result = comAuser.UpdateWebCompanyAuthentication(webAuthen); //申请 } else if (webthis != null && webthis.IsAuthentication == 1) { //已通过 result = 0; } else if (webthis != null && webthis.IsAuthentication == 0) { //已提交 result = 2; } else { //申请 result = comAuser.AddWebCompanyAuthentication(webAuthen); } return(Json(new { RetCode = result }, JsonRequestBehavior.AllowGet)); }
public int AddWebCompanyAuthentication(WebCompanyAuthentication WebCompanyAuthentication) { using (AIYunNetContext context = new AIYunNetContext()) { context.WebCompanyAuthentication.Add(WebCompanyAuthentication); context.SaveChanges(); return(1); } }
public ActionResult CompanyAuthentication(int UserID) { WebCompanyAuthentication comAu = comAuser.GetWebCompanyAuthenticationByUserID(UserID); if (comAu == null) { comAu = new WebCompanyAuthentication(); } return(View(comAu)); }
public int DeleteWebCompanyAuthentication(int WebCompanyAuthenticationID) { using (AIYunNetContext context = new AIYunNetContext()) { WebCompanyAuthentication WebCompanyAuthentication = context.WebCompanyAuthentication.Find(WebCompanyAuthenticationID); if (WebCompanyAuthentication != null) { WebCompanyAuthentication.IsDelete = 1; WebCompanyAuthentication.DeleteOn = DateTime.Now; context.SaveChanges(); return(1); } else { return(0); } } }
public int IsAuthentication(int id) { using (AIYunNetContext context = new AIYunNetContext()) { if (id != 0) { WebCompanyAuthentication origWebCompanyAuthentication = context.WebCompanyAuthentication.Find(id); WebCompany orwebcompany = context.WebCompany.FirstOrDefault(c => c.WebCompanyUserID == origWebCompanyAuthentication.CompanyUserID); if (origWebCompanyAuthentication != null) { origWebCompanyAuthentication.IsAuthentication = 1; orwebcompany.IsAuthentication = true; origWebCompanyAuthentication.EditOn = DateTime.Now; context.SaveChanges(); } } return(1); } }
public ActionResult AddAndUpdateAu(int auid) { WebCompanyAuthentication authen = AuthenticationService.GetWebCompanyAuthenticationByID(auid); return(View(authen)); }