/// <summary> /// 新增文件夹 /// </summary> public void CreateFolder() { //业务类型 string BUSINESS_TYPE = Request["BUSINESS_TYPE"]; if (string.IsNullOrEmpty(BUSINESS_TYPE)) { BUSINESS_TYPE = string.Empty; } SYS_FOLDER fd = new SYS_FOLDER(); fd.FD_BUSINESS_TYPE = BUSINESS_TYPE; fd.FD_CREATE_USER = 0; fd.FD_CREATE_DATE = DateTime.Now; db.SYS_FOLDER.Add(fd); db.SaveChanges(); string str_result = new AjaxSuccessResult(fd.FD_ID.ToString()).ToString(); Response.Write(str_result); }
public void PreViewFile() { List <string> list_image_ex = new List <string>(); list_image_ex.Add("jpg"); list_image_ex.Add("png"); list_image_ex.Add("bmp"); list_image_ex.Add("jpeg"); int FL_ID = Convert.ToInt32(Request["FL_ID"]); SYS_FILE f = db.SYS_FILE.Where(o => o.FL_ID == FL_ID).FirstOrDefault(); if (string.IsNullOrEmpty(f.FL_ICON_S)) { if (list_image_ex.Contains(f.FL_EXTENSION)) { //1查询图片的绝对路径 string str_url = Server.MapPath("~" + f.FL_URL); //2生成图片的预览路径 string str_url_new = SmallImageWidth(str_url, 200); //3赋值给FL_EXTENSION f.FL_ICON_S = str_url_new; //返回 string str_result = new AjaxSuccessResult(str_url_new).ToString(); Response.Write(str_result); } else { string str_result = new AjaxErrorResult("暂时不支持缩略图").ToString(); Response.Write(str_result); } } else { string str_result = new AjaxSuccessResult(f.FL_ICON_S).ToString(); Response.Write(str_result); } }
public string handle_work_follow() { string function_code = Request["function_code"]; if (string.IsNullOrEmpty(function_code)) { return(new AjaxErrorResult("function_code不能为空").ToString()); } FunctionCode = Convert.ToInt32(function_code); string id = Request["id"]; if (string.IsNullOrEmpty(id)) { return(new AjaxErrorResult("id不能为空").ToString()); } int Id = Convert.ToInt32(id); string WF_STATUS = Request["WF_STATUS"]; if (string.IsNullOrEmpty(WF_STATUS)) { return(new AjaxErrorResult("WF_STATUS不能为空").ToString()); } string WF_REASON = Request["WF_REASON"]; if (string.IsNullOrEmpty(WF_REASON)) { WF_REASON = string.Empty; } string WF_TO_USER = Request["WF_TO_USER"]; H5Objects obj = H5Object; try { if (WF_STATUS == "1") { int to_user = 0; //审批通过 if (string.IsNullOrEmpty(WF_TO_USER)) { to_user = GData.get_administrator(obj.HO_BUSINESS_TYPE); } else { to_user = Convert.ToInt32(WF_TO_USER); } //普通审核(更新本数据,插入待审核数据) int my_id = Convert.ToInt32(Cookies.UserCode); //更新本数据 SP_WORK_FOLLOW one_work = db.SP_WORK_FOLLOW.Where(o => o.WF_BUSINESS_TYPE == obj.HO_BUSINESS_TYPE && o.WF_BUSINESS_KEY == Id && o.WF_TO_USER == my_id && (o.WF_STATUS == 0 || o.WF_STATUS == 3)).FirstOrDefault(); one_work.WF_STATUS = Convert.ToInt32(WF_STATUS); one_work.WF_REASON = WF_REASON; one_work.WF_APPROVE_DATE = DateTime.Now; //判断自己是否为终审人, if (GData.check_administrator(obj.HO_BUSINESS_TYPE, Cookies.UserCode)) { //更新状态为终审 update_form_status(Id, 1, FunctionCode); db.SaveChanges(); AjaxSuccessResult re = new AjaxSuccessResult("保存成功"); re.message = GData.get_status_name("1"); re.primary_key = "1"; return(re.ToString()); } else { //插入待审数据 SP_WORK_FOLLOW new_work = new SP_WORK_FOLLOW(); new_work.WF_BUSINESS_KEY = one_work.WF_BUSINESS_KEY; new_work.WF_BUSINESS_TYPE = one_work.WF_BUSINESS_TYPE; new_work.WF_CREATE_DATE = DateTime.Now; new_work.WF_FROM_USER = my_id; new_work.WF_STATUS = 0; new_work.WF_TO_USER = to_user; db.SP_WORK_FOLLOW.Add(new_work); //判断下一个审批人是否为终审人,是就改变状态为待终审 if (GData.check_administrator(obj.HO_BUSINESS_TYPE, to_user.ToString())) { update_form_status(Id, 3, FunctionCode); db.SaveChanges(); AjaxSuccessResult re = new AjaxSuccessResult(""); re.message = GData.get_status_name("3"); re.primary_key = "3"; return(re.ToString()); } else { db.SaveChanges(); AjaxSuccessResult re = new AjaxSuccessResult(""); re.message = GData.get_status_name("0"); re.primary_key = "0"; return(re.ToString()); } } } if (WF_STATUS == "2") { //驳回(更新本数据,更新主数据) //更新本数据 int my_id = Convert.ToInt32(Cookies.UserCode); SP_WORK_FOLLOW one_work = db.SP_WORK_FOLLOW.Where(o => o.WF_BUSINESS_TYPE == obj.HO_BUSINESS_TYPE && o.WF_BUSINESS_KEY == Id && o.WF_TO_USER == my_id && o.WF_STATUS == 0).FirstOrDefault(); one_work.WF_STATUS = Convert.ToInt32(WF_STATUS); one_work.WF_REASON = WF_REASON; one_work.WF_APPROVE_DATE = DateTime.Now; //更新主数据[驳回] update_form_status(Id, 2, FunctionCode); db.SaveChanges(); AjaxSuccessResult re = new AjaxSuccessResult("保存成功"); re.message = GData.get_status_name("2"); re.primary_key = "2"; return(re.ToString()); } if (WF_STATUS == "4") { //更新主数据[撤回] update_form_status(Id, 4, FunctionCode); AjaxSuccessResult re = new AjaxSuccessResult("保存成功"); re.message = GData.get_status_name("4"); re.primary_key = "4"; return(re.ToString()); } return(new AjaxSuccessResult("保存成功").ToString()); } catch (Exception ex) { comm_fun.WriteLog(ex.ToString()); return(new AjaxErrorResult("保存失败").ToString()); } }