protected void Page_Load(object sender, EventArgs e) { try { if (!Page.IsPostBack) { string rfsid = Request.Params["rfsid"].Trim(); type = Request.Params["action"].Trim(); hrfsid.Value = rfsid; haction.Value = type; //type1.Value = type; Model.BaseUser bu = (Model.BaseUser)Session["login"]; DataTable dt = new BLL.flow_master().GetList(" rf_sid=" + rfsid + " and dept_sid like '%," + bu.DeptID + ",%' and post_sid like '%," + bu.ApprRole + ",%'").Tables[0]; flow_ddl.DataSource = dt; flow_ddl.DataValueField = "sid"; flow_ddl.DataTextField = "flow_name"; flow_ddl.DataBind(); Model.request_form model = new BLL.request_form().GetModel(int.Parse(rfsid)); switch (type) { case "add": show.Visible = false; split.Visible = false; GetFormContent(model == null ? "" : model.content_str); flow_name.Text = DBUtility.DbHelperSQL.GetSingle("select dbo.getDeptName('" + bu.DeptID + "')").ToString().Trim() + " " + bu.Name.Trim() + "<" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + ">" + model.form_name.Trim(); break; case "copy": show.Visible = false; split.Visible = false; SetValue(); flow_name.Text = DBUtility.DbHelperSQL.GetSingle("select dbo.getDeptName('" + bu.DeptID + "')").ToString().Trim() + " " + bu.Name.Trim() + "<" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + ">" + model.form_name.Trim(); isVal.Checked = false; break; case "update": show.Visible = false; split.Visible = false; SetValue(); break; case "view": split.Visible = false; submit.Visible = false; SetValue(); break; default: break; } GetNode(); } } catch { } }
public string Edit(HttpContext context) { string sid = context.Request.Params["sid"].Trim(); string Name = context.Request["Name"].Trim(); string chkStatus = context.Request["chkStatus"].Trim(); string ApplyForm = context.Request["ApplyForm"].Trim(); string ApplyBanding = context.Request["ApplyBanding"].Trim(); string ApplyDept = context.Request["ApplyDept"].Trim(); string dept = context.Request["dept"].Trim(); string post = context.Request["post"].Trim(); string form = context.Request["form"].Trim(); string Description = context.Request["Description"].Trim(); string addstr = context.Request["addstr"].Trim(); string updatestr = context.Request["updatestr"].Trim(); string delstr = context.Request["delstr"].Trim(); Model.flow_master flowMasterModel = new BLL.flow_master().GetModel(int.Parse(sid)); flowMasterModel.flow_name = Name; flowMasterModel.flow_status = Convert.ToInt32(chkStatus); flowMasterModel.remark = Description; flowMasterModel.dept = dept; flowMasterModel.post = post; flowMasterModel.form = form; flowMasterModel.create_person = "";//context.Session["UserID"].ToString(); flowMasterModel.rf_sid = Convert.ToInt32(ApplyForm); if (ApplyBanding.Length > 0) { if (ApplyBanding.Substring(0, 1) == ",") { ApplyBanding = ApplyBanding + ","; } else { ApplyBanding = "," + ApplyBanding + ","; } } flowMasterModel.post_sid = ApplyBanding; if (ApplyDept.Length > 0) { if (ApplyDept.Substring(0, 1) == ",") { ApplyDept = ApplyDept + ","; } else { ApplyDept = "," + ApplyDept + ","; } } flowMasterModel.dept_sid = ApplyDept; //List<Model.flow_node> details = new List<Model.flow_node>(); //details = JsonSerializerHelper.JSONStringToList<Model.flow_node>(addstr); List <Model.flow_node> insert = new List <Model.flow_node>(); insert = JsonSerializerHelper.JSONStringToList <Model.flow_node>(addstr); List <Model.flow_node> update = new List <Model.flow_node>(); update = JsonSerializerHelper.JSONStringToList <Model.flow_node>(updatestr); List <Model.flow_node> del = new List <Model.flow_node>(); del = JsonSerializerHelper.JSONStringToList <Model.flow_node>(delstr); //return BllOAProcess.InsertFlow(oaFlowMasterInfo, details); return(new BLL.flow_master().UpdateFlow(flowMasterModel, insert, update, del)); }