/// <summary> /// 上传图片 /// </summary> /// <param name="picFile"></param> /// <param name="id"></param> /// <returns></returns> public ActionResult RegisterPicture(HttpPostedFileBase picFile, string id) { string fileName = picFile.FileName; int fileSuffxLength = fileName.LastIndexOf(".") + 1; string suffx = fileName.Substring(fileSuffxLength, fileName.Length - fileSuffxLength); List <string> SuffxLsit = new List <string>() { "jpg", "png" }; if (SuffxLsit.Contains(suffx)) { string webPath = "~/images/upload/image/" + id + "." + suffx; string FilePath = Server.MapPath(webPath); picFile.SaveAs(FilePath); Entity.human_file changeObj = HumanFileBll.FindHumanFileByHumanId(id); changeObj.human_picture = id + "." + suffx; if (HumanFileBll.Change(changeObj) > 0) { return(Content("<script>alert('文件上传成功!');history.back()</script>")); } else { return(Content("<script>alert('数据库修改错误请重试!');history.back()</script>")); } } else { return(Content("<script>alert('非法后缀,请上传JPG,PNG类型的图片');history.back();</script>")); } return(Content("<script>alert('请勿直接进入');history.back();</script>")); }
public ActionResult ChangeHumanFile(Entity.human_file humanFile, string flage) { Entity.salary_standard standard = SalaryStandardBll.FindAll().Where(e => e.standard_id == humanFile.salary_standard_id).ToList().FirstOrDefault(); Entity.human_file changeObjc = HumanFileBll.FindHumanFileByHumanId(humanFile.human_id); changeObjc.salary_sum = standard.salary_sum; changeObjc.check_time = humanFile.check_time; changeObjc.human_pro_designation = humanFile.human_pro_designation; changeObjc.human_name = humanFile.human_name; changeObjc.human_sex = humanFile.human_sex; changeObjc.human_email = humanFile.human_email; changeObjc.human_telephone = humanFile.human_telephone; changeObjc.human_qq = humanFile.human_qq; changeObjc.human_mobilephone = humanFile.human_mobilephone; changeObjc.human_address = humanFile.human_address; changeObjc.human_postcode = humanFile.human_postcode; changeObjc.human_nationality = humanFile.human_nationality; changeObjc.human_birthplace = humanFile.human_birthplace; changeObjc.human_birthday = humanFile.human_birthday; changeObjc.human_race = humanFile.human_race; changeObjc.human_religion = humanFile.human_religion; changeObjc.human_party = humanFile.human_party; changeObjc.human_id_card = humanFile.human_id_card; changeObjc.human_society_security_id = humanFile.human_society_security_id; changeObjc.human_age = humanFile.human_age; changeObjc.human_educated_degree = humanFile.human_educated_degree; changeObjc.human_educated_years = humanFile.human_educated_years; changeObjc.human_educated_major = humanFile.human_educated_major; changeObjc.salary_standard_id = humanFile.salary_standard_id; changeObjc.human_bank = humanFile.human_bank; changeObjc.human_account = humanFile.human_account; changeObjc.checker = humanFile.checker; changeObjc.regist_time = humanFile.regist_time; changeObjc.human_speciality = humanFile.human_speciality; changeObjc.human_hobby = humanFile.human_hobby; changeObjc.human_histroy_records = humanFile.human_histroy_records; changeObjc.human_family_membership = humanFile.human_family_membership; changeObjc.remark = humanFile.remark; changeObjc.file_chang_amount = (short)((int)changeObjc.file_chang_amount + 1); changeObjc.check_status = 1; string msg = "审核"; if (flage != null && flage != "") { msg = "变更"; changeObjc.check_status = 0; } if (HumanFileBll.Change(changeObjc) > 0) { return(Content("<script>alert('" + msg + "成功!');location.href='/humanResources/check_list';</script>")); } return(Content("<script>alert('" + msg + "失败!');history.back();</script>")); }
public ActionResult recHumanFile(string humanid) { Entity.human_file changeObj = HumanFileBll.FindHumanFileByHumanId(humanid); changeObj.human_file_status = false; if (HumanFileBll.Change(changeObj) > 0) { return(Content("<script>alert('恢复成功!');location.href='/humanResources/recovery_locate'</script>")); } else { return(Content("<script>alert('恢复失败!');history.back()</script>")); } }
public ActionResult delHumanFile(string humanid) { Entity.human_file changeObj = HumanFileBll.FindHumanFileByHumanId(humanid); changeObj.human_file_status = true; if (HumanFileBll.Change(changeObj) > 0) { return(Content("<script>alert('删除成功!');location.href='/humanResources/delete_forever_list'</script>")); } else { return(Content("<script>alert('删除失败!');history.back();</script>")); } }
/// <summary> /// 添加人力资源档案 /// </summary> /// <returns></returns> public ActionResult humanAdd(Entity.human_file humanFile) { Entity.salary_standard standard = SalaryStandardBll.FindAll().Where(e => e.standard_id == humanFile.salary_standard_id).ToList().FirstOrDefault(); humanFile.salary_sum = standard.salary_sum; Entity.human_file file = HumanFileBll.FindAll().OrderBy(e => e.huf_id).LastOrDefault(); string lastCode = file != null?file.human_id:""; humanFile.human_id = GetHumanId(lastCode); humanFile.check_status = 0; humanFile.file_chang_amount = 0; if (HumanFileBll.Add(humanFile) > 0) { return(Content("<script>alert('添加成功');location.href='/humanResources/register_choose_picture?hid=" + humanFile.human_id + "';</script>")); } return(Content("<script>alert('添加失败');history.back();</script>")); }
public ActionResult upLoadAccFile(HttpPostedFileBase accFile, string humanId) { string fileName = accFile.FileName; int fileSuffxLength = fileName.LastIndexOf(".") + 1; string suffx = fileName.Substring(fileSuffxLength, fileName.Length - fileSuffxLength); List <string> SuffxLsit = new List <string>() { "doc", "docx", "ppt", "pptx", "txt", "pdf", "jpg" }; if (SuffxLsit.Contains(suffx)) { System.IO.DirectoryInfo file = new System.IO.DirectoryInfo(Server.MapPath("~/images/upload/acc/" + humanId)); if (!file.Exists) { file.Create(); } string webPath = "~/images/upload/acc/" + humanId + "/" + fileName; string FilePath = Server.MapPath(webPath); accFile.SaveAs(FilePath); Entity.human_file changeObj = HumanFileBll.FindHumanFileByHumanId(humanId); changeObj.attachment_name = fileName; if (HumanFileBll.Change(changeObj) > 0) { return(Content("<script>alert('文件上传成功!');history.back()</script>")); } else { return(Content("<script>alert('数据库修改错误请重试!');history.back()</script>")); } } else { return(Content("<script>alert('非法后缀,请上传JPG,PNG类型的图片');history.back();</script>")); } return(Content("<script>alert('请勿直接进入');history.back();</script>")); }