public String AnnualReviewUpload(AnnualReviewViewPage AnnualReviewAdd, string idd) { Examine ExamineInfo = new Examine(); var UserInfo = db.UsersInfo.Where(a => a.UserName == idd).FirstOrDefault(); ExamineInfo.ExamineID = DateTime.Now.ToString("yyyyMMddHHmmss"); ExamineInfo.CompanyName = UserInfo.CompanyName; string name = "^[a-zA-Z0-9\u4e00-\u9fa5]{1,}$";//字母数字汉字 Regex rxname = new Regex(name); if (!rxname.IsMatch(AnnualReviewAdd.ExamineName)) { return("请输入正确格式"); } ExamineInfo.ExamineName = AnnualReviewAdd.ExamineName; ExamineInfo.PayCard = AnnualReviewAdd.PayCard; ExamineInfo.BusinessCard = AnnualReviewAdd.BusinessCard; ExamineInfo.ExamineState = ExamineState1.ExamineAccept; ExamineInfo.ExamineTime = DateTime.Now; db.Examine.Add(ExamineInfo); db.SaveChanges(); return("申请成功"); }
public AnnualReviewViewPage Index(string id) { AnnualReviewViewPage xx = new AnnualReviewViewPage(); var CompanyInfo = db.UsersInfo.Where(a => a.UserName == id).FirstOrDefault(); var Examine = db.Examine.Where(a => a.CompanyName == CompanyInfo.CompanyName).ToList(); xx.aa = Examine; return(xx); }
public ActionResult AnnualReviewUpload1(AnnualReviewViewPage AnnualReviewAdd) { IAnnualReview IA = new AnnualReviewMethod(); string idd = "0"; try { idd = System.Web.HttpContext.Current.Session["UserName"].ToString(); } catch { return(Json("操作时间过长请重新登录")); } string fileSave = Server.MapPath("~/upload/"); try { HttpFileCollectionBase file = Request.Files; if (file.Count != 0) { for (int i = 0; i < file.Count; i++) { HttpPostedFileBase file2 = file[i]; if (file.AllKeys[i] == "file") { count++; string extName = Path.GetExtension(file2.FileName); string newName = Guid.NewGuid().ToString() + extName; file2.SaveAs(Path.Combine(fileSave, newName)); if (count == 1) { AnnualReviewAdd.BusinessCard = "/upload/" + newName; } else { AnnualReviewAdd.BusinessCard += "," + "/upload/" + newName; } } if (file.AllKeys[i] == "PayCard") { string extName = Path.GetExtension(file2.FileName); string newName = Guid.NewGuid().ToString() + extName; file2.SaveAs(Path.Combine(fileSave, newName)); AnnualReviewAdd.PayCard = "/upload/" + newName; } } } } catch { return(Json("文件过大", JsonRequestBehavior.AllowGet)); } return(Json(IA.AnnualReviewUpload(AnnualReviewAdd, idd), JsonRequestBehavior.AllowGet)); }
public AnnualReviewViewPage AnnualReviewDetail(string id) { AnnualReviewViewPage xx = new AnnualReviewViewPage(); var ExamineInfo = db.Examine.Find(id); xx.ExamineID = ExamineInfo.ExamineID; xx.CompanyName = ExamineInfo.CompanyName; xx.ExamineName = ExamineInfo.ExamineName; xx.PayCard = ExamineInfo.PayCard; xx.BusinessCard = ExamineInfo.BusinessCard; xx.ExamineState = ExamineInfo.ExamineState; xx.ExamineTime = ExamineInfo.ExamineTime; return(xx); }