public ActionResult Sc2(HttpPostedFileBase file) { #region 获取从图片上传的数据 engage_resume_Model er = new engage_resume_Model(); er.human_name = Request["human_name"]; er.engage_type = Request["engage_type"]; er.human_address = Request["human_address"]; er.human_postcode = Request["human_postcode"]; er.human_major_kind_id = Request["human_major_kind_id"]; er.human_major_kind_name = Request["human_major_kind_name"]; er.human_major_id = Request["human_major_id"]; er.human_major_name = Request["human_major_name"]; er.human_telephone = Request["human_telephone"]; er.human_homephone = Request["human_homephone"]; er.human_mobilephone = Request["human_mobilephone"]; er.human_email = Request["human_email"]; er.human_hobby = Request["human_hobby"]; er.human_specility = Request["human_specility"]; er.human_sex = Request["human_sex"]; er.human_religion = Request["human_religion"]; er.human_party = Request["human_party"]; er.human_nationality = Request["human_nationality"]; er.human_race = Request["human_race"]; er.human_birthday = DateTime.Parse(Request["human_birthday"]); er.human_age = int.Parse(Request["human_age"]); er.human_educated_years = int.Parse(Request["human_educated_years"]); er.human_educated_major = Request["human_educated_major"]; er.human_college = Request["human_college"]; er.human_idcard = Request["human_idcard"]; er.human_birthplace = Request["human_birthplace"]; er.demand_salary_standard = double.Parse(Request["demand_salary_standard"]); er.human_history_records = Request["human_history_records"]; er.remark = Request["remark"]; er.regist_time = DateTime.Parse(Request["regist_time"]); er.human_educated_degree = Request["human_educated_degree"]; er.register = Request["register"]; er.check_status = 1; #endregion string name = Md5String.Md5CreateName(file.InputStream); //文件名 string ext = Path.GetExtension(file.FileName); //后缀名 //1 获得上传文件的完整路径 string path = $"~/Phone/{DateTime.Now.ToString("yyyy/MM/dd")}/" + name + ext; string fullPath = Server.MapPath(path); new FileInfo(fullPath).Directory.Create();//创建文件夹 //2 调用file.SaveAs(完整路径) file.SaveAs(fullPath); er.human_picture = $"/Phone/{ DateTime.Now.ToString("yyyy/MM/dd")}/" + name + ext; //根据uid做表的修改 if (r.engage_resumeAdd(er) > 0) { return(Content("<script>alert('登记成功');window.location.href ='/position_release_search/Index'</script>")); } else { return(View(er)); } }
public ActionResult WJSC1(int uid, HttpPostedFileBase file) { string name = Md5String.Md5CreateName(file.InputStream); //文件名 string ext = Path.GetExtension(file.FileName); //后缀名 //1 获得上传文件的完整路径 string path = $"/Uploader/{DateTime.Now.ToString("yyyy/MM/dd")}/" + name + ext; string fullPath = Server.MapPath(path); new FileInfo(fullPath).Directory.Create();//创建文件夹 //2 调用file.SaveAs(完整路径) file.SaveAs(fullPath); //根据uid做表的修改 human_fileModel hm = new human_fileModel { human_id = uid.ToString() }; List <human_fileModel> list = hfb.SelectBy(hm); var MyDate = DateTime.Now; string year = MyDate.Year.ToString(); string month = (MyDate.Month + 1).ToString(); string Day = MyDate.Day.ToString(); string h = MyDate.Hour.ToString(); string m = MyDate.Minute.ToString(); string s = MyDate.Second.ToString(); string Number = "bt" + year + month + Day + h + m + s; human_fileModel hfm = new human_fileModel { Id = list[0].Id, human_id = Number, first_kind_id = list[0].first_kind_id, first_kind_name = list[0].first_kind_name, second_kind_id = list[0].second_kind_id, second_kind_name = list[0].second_kind_name, third_kind_id = list[0].third_kind_id, third_kind_name = list[0].third_kind_name, human_name = list[0].human_name, human_address = list[0].human_address, human_postcode = list[0].human_postcode, human_pro_designation = list[0].human_pro_designation, human_major_kind_id = list[0].human_major_kind_id, human_major_kind_name = list[0].human_major_kind_name, human_major_id = list[0].human_major_id, hunma_major_name = list[0].hunma_major_name, human_telephone = list[0].human_telephone, human_mobilephone = list[0].human_mobilephone, human_bank = list[0].human_bank, human_account = list[0].human_account, human_qq = list[0].human_qq, human_email = list[0].human_email, human_hobby = list[0].human_hobby, human_speciality = list[0].human_speciality, human_sex = list[0].human_sex, human_religion = list[0].human_religion, human_party = list[0].human_party, human_nationality = list[0].human_nationality, human_race = list[0].human_race, human_birthday = list[0].human_birthday, human_birthplace = list[0].human_birthplace, human_age = list[0].human_age, human_educated_degree = list[0].human_educated_degree, human_educated_years = list[0].human_educated_years, human_educated_major = list[0].human_educated_major, human_society_security_id = list[0].human_society_security_id, human_id_card = list[0].human_id_card, remark = list[0].remark, salary_standard_id = list[0].salary_standard_id, salary_standard_name = list[0].salary_standard_name, salary_sum = list[0].salary_sum, major_change_amount = list[0].major_change_amount, training_amount = list[0].training_amount, file_chang_amount = list[0].file_chang_amount, human_histroy_records = list[0].human_histroy_records, human_family_membership = list[0].human_family_membership, regist_time = list[0].regist_time, check_time = list[0].check_time, change_time = list[0].change_time, lastly_change_time = list[0].lastly_change_time, delete_time = list[0].delete_time, recovery_time = list[0].recovery_time, human_file_status = list[0].human_file_status, check_status = list[0].check_status, register = list[0].register, changer = list[0].changer, checker = list[0].checker, human_picture = path }; hfm.human_file_status = 1; if (hfb.Update(hfm) > 0) { return(Content("<script>alert('上传成功!')</script>")); } else { return(View(uid)); } }