void ShowInit() { if (!string.IsNullOrEmpty(Request.Params["File_Id"])) { try { Tunnel.BLL.Tunnel_bumf btb = new Tunnel.BLL.Tunnel_bumf(); Tunnel.Model.Tunnel_bumf mtb = new Tunnel.Model.Tunnel_bumf(); Tunnel.BLL.Tunnel_form tf = new Tunnel.BLL.Tunnel_form(); Tunnel.Model.Tunnel_form mtf = new Tunnel.Model.Tunnel_form(); Tunnel.Common.Form_Class fc = new Tunnel.Common.Form_Class(); Tunnel.BLL.UserLogin ul = new Tunnel.BLL.UserLogin(); mtb = btb.GetModel(Convert.ToInt32(Request.Params["File_Id"])); formfile = getFile(mtb.b_file);//附件 Label1.Text = mtb.b_title; Label2.Text = fc.From_Content(mtb.b_formcontent, mtb.b_content, true);//取得替换后的表单数据 ul.UsbnLogin = ul.getUserModel(mtb.b_user); Label3.Text = "发布人:" + ul.UsbnLogin.m_name + " 发布时间:" + mtb.b_time.ToString(); } catch { Tunnel.Common.Message.back("不正确的ID"); return; } } }
private int sava() { ArrayList list = new ArrayList(); string datalist = ""; string datafield = ""; System.Collections.Specialized.NameObjectCollectionBase.KeysCollection keys = Request.Params.Keys;//取得所有Request的Key值 for (int i = 0; i < keys.Count; i++) { //过滤其它Request的Key值留以DATA_开头的Key if (keys[i].ToString().IndexOf("DATA_") >= 0) { list.Add(keys[i].ToString()); //将key值存入数组 datafield += keys[i].ToString() + ","; //将key值存入字符串 } } //获取表单提交过来的值 for (int j = 0; j < list.Count; j++) { datalist += Request.Form[list[j].ToString()] + "<@Sep@>";//值用<@Sep@>隔开以便存入数据库 } mtb.b_content = datalist; if (!string.IsNullOrEmpty(datafield)) { datafield = datafield.Substring(0, datafield.Length - 1);//去掉最后的的',' } mtb.b_datefield = datafield; if (!"".Equals(this.SaveFiles())) { if (null != Request.Form["hfile"] && !"".Equals(Request.Form["hfile"])) { mtb.b_file = Request.Form["hfile"] + "," + this.SaveFiles();//批量附件上传 } else { mtb.b_file = this.SaveFiles();//批量附件上传 } } else { if (null != Request.Form["hfile"] && !"".Equals(Request.Form["hfile"])) { mtb.b_file = Request.Form["hfile"]; } else { mtb.b_file = ""; } } mf = bf.GetModel(int.Parse(Request.Params["Flow"])); mtb.b_title = TextBox1.Text.Trim(); mtb.b_time = DateTime.Now; mtb.b_user = ul.LoginID; mtf = tf.GetModel(mf.f_form); mtb.b_formcontent = mtf.f_content; mtb.b_sort = int.Parse(Request.Params["Flow"]); mtb.b_state = (mf.f_state == 0 ? 1 : 2); mtb.b_suser = (RadioButtonList3.SelectedValue == "1" ? int.Parse(m_value.Value) : 0); return(btb.Add(mtb)); }
/// <summary> /// 获得数据列表 /// </summary> public List <Tunnel.Model.Tunnel_form> DataTableToList(DataTable dt) { List <Tunnel.Model.Tunnel_form> modelList = new List <Tunnel.Model.Tunnel_form>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { Tunnel.Model.Tunnel_form model; for (int n = 0; n < rowsCount; n++) { model = new Tunnel.Model.Tunnel_form(); //model.f_id=dt.Rows[n]["f_id"].ToString(); model.f_name = dt.Rows[n]["f_name"].ToString(); if (dt.Rows[n]["f_bum"].ToString() != "") { model.f_bum = int.Parse(dt.Rows[n]["f_bum"].ToString()); } if (dt.Rows[n]["f_lcid"].ToString() != "") { model.f_lcid = int.Parse(dt.Rows[n]["f_lcid"].ToString()); } if (dt.Rows[n]["f_user"].ToString() != "") { model.f_user = int.Parse(dt.Rows[n]["f_user"].ToString()); } if (dt.Rows[n]["f_date"].ToString() != "") { model.f_date = DateTime.Parse(dt.Rows[n]["f_date"].ToString()); } model.f_content = dt.Rows[n]["f_content"].ToString(); modelList.Add(model); } } return(modelList); }
void Bind() { mf = bf.GetModel(int.Parse(DropDownList1.SelectedValue)); mtf = tf.GetModel(mf.f_form); if (mtf == null) { Tunnel.Common.Message.back("表单不存在或已删除,请与管理员联系"); return; } Label1.Text = fc.From_Content(mtf.f_content, "", false);//取得替换后的表单数据 ul.UsbnLogin = ul.getUserModel(ul.LoginID); string bumname = Tunnel.Common.GetValue.getDataValue("Tunnel_bum", "b_name", "b_id=" + ul.UsbnLogin.m_bum); TextBox1.Text = bumname + mf.f_name; if (mf.f_isfile.ToString() == "1") { isuploads = false; } Repeater1.DataSource = bs.GetList("s_lid=" + mf.f_id); Repeater1.DataBind(); if (Repeater1.Items.Count <= 0) { Label2.Text = "本公文未设置流程,将不能保存!"; HiddenField2.Value = "0"; } else { Label2.Text = ""; HiddenField2.Value = "1"; } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { mf = tf.GetModel(int.Parse(Request.Params["form_id"])); FORM_CONTENT.Value = mf.f_content; } }
void Bind() { mtb = btb.GetModel(Convert.ToInt32(Request.Params["bid"])); mf = bf.GetModel(mtb.b_sort); mtf = tf.GetModel(mf.f_form); if (mtf == null) { Tunnel.Common.Message.back("表单不存在或已删除,请与管理员联系"); return; } Label1.Text = fc.From_Content(mtf.f_content, mtb.b_content, false);//取得替换后的表单数据 if (mf.f_isfile.ToString() == "1") { isuploads = false; } TextBox1.Text = mtb.b_title; if (mtb.b_suser == 0) { RadioButtonList3.SelectedIndex = 0; isusered = false; } else { TextBox2.Text = Tunnel.Common.GetValue.getDataValue("Tunnel_menber", "m_name", "m_id=" + mtb.b_suser); RadioButtonList3.SelectedIndex = 1; isusered = true; } m_value.Value = mtb.b_suser.ToString(); hfile.Value = mtb.b_file; if (!"".Equals(mtb.b_file)) { string[] filelist = mtb.b_file.Split(','); foreach (string list in filelist) { string flist = list.Substring(list.LastIndexOf('/') + 1, list.Length - list.LastIndexOf('/') - 1); hfilelist += "<span><img src=\"../../image/attach.png\">" + flist + "<img style='cursor:hand' onclick=\"del(this,'" + list + "')\" alt='删除附件' src=\"../../image/remove.png\">;</span>"; } } if (mf.f_state.ToString() == "0") { scontent = "审核→"; issheng = true; } else { scontent = ""; issheng = false; } Repeater1.DataSource = bs.GetList("s_lid=" + mf.f_id); Repeater1.DataBind(); if (Repeater1.Items.Count <= 0) { Label2.Text = "本申请未设置流程,将不能保存!"; HiddenField2.Value = "0"; scontent = ""; } else { Label2.Text = ""; HiddenField2.Value = "1"; } }
void Bind() { try { mtb = btb.GetModel(int.Parse(Request.Params["bid"])); mf = bf.GetModel(mtb.b_sort); mtf = tf.GetModel(mf.f_form); if (mtf == null) { Tunnel.Common.Message.back("表单不存在或已删除,请与管理员联系"); return; } Label1.Text = fc.From_Content(mtf.f_content, mtb.b_content, true);//取得替换后的表单数据 Label4.Text = mtb.b_title + " (" + mtb.b_time + ")"; Label5.Text = "<font color=red>(注:红色代表当前执行步骤,<font color=green>绿色代表已经审批通过</font>)</font>"; formfile = Tunnel.Common.GetValue.getFile(mtb.b_file); if (mf.f_isfile.ToString() == "1") { isuploads = false; } if (mf.f_state.ToString() == "0" && mf.f_sort != 18) { scontent = "<font color='green'>审核→</font>"; } else { scontent = ""; } Repeater1.DataSource = bts.GetList("s_lid=" + mf.f_id); Repeater1.DataBind(); Button4.Visible = false; Button5.Visible = false; string currbid = Tunnel.Common.GetValue.getDataValue("Tunnel_exam", "e_nextbid", "e_gid=" + Request.Params["bid"] + " order by e_id desc"); if ("".Equals(currbid) || "0".Equals(currbid)) { currbid = Tunnel.Common.GetValue.getDataValue("Tunnel_step", "s_id", "s_lid=" + mtb.b_sort + " and s_num=1"); } mts = bts.GetModel(Convert.ToInt32(currbid)); if (mts.s_isbak == 1) { Button5.Visible = true; Button1.Visible = false; Button2.Visible = false; spPassword.Enabled = false; spPassword.TextMode = TextBoxMode.SingleLine; spPassword.Text = "不需填写审批密码"; } } catch { Tunnel.Common.Message.back("不正确的ID"); return; } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { mf = tf.GetModel(int.Parse(Request.Params["form_id"])); if (null != mf) { Tunnel.Common.Form_Class fc = new Tunnel.Common.Form_Class(); Label1.Text = fc.From_Content(mf.f_content, "", false); Page.Title = mf.f_name; } } }
void Bind() { try { mf = bf.GetModel(int.Parse(Request.Params["Flow"])); mtf = tf.GetModel(mf.f_form); if (mtf == null) { Tunnel.Common.Message.back("表单不存在或已删除,请与管理员联系"); return; return; } Label1.Text = fc.From_Content(mtf.f_content, "", false);//取得替换后的表单数据 ul.UsbnLogin = ul.getUserModel(ul.LoginID); string bumname = Tunnel.Common.GetValue.getDataValue("Tunnel_bum", "b_name", "b_id=" + ul.UsbnLogin.m_bum); TextBox1.Text = bumname + mf.f_name; if (mf.f_isfile.ToString() == "1") { isuploads = false; } if (mf.f_state.ToString() == "0") { scontent = "审核→"; issheng = true; isshen = true; } else { scontent = ""; issheng = false; isshen = false; } Repeater1.DataSource = bs.GetList("s_lid=" + mf.f_id); Repeater1.DataBind(); if (Repeater1.Items.Count <= 0) { Label2.Text = "本申请未设置流程,将不能保存!"; HiddenField2.Value = "0"; } else { Label2.Text = ""; HiddenField2.Value = "1"; } } catch { Tunnel.Common.Message.back("不正确的ID"); return; } }
void Bind() { try { mtb = btb.GetModel(int.Parse(Request.Params["bid"])); mf = bf.GetModel(mtb.b_sort); mtf = tf.GetModel(mf.f_form); Label1.Text = fc.From_Content(mtf.f_content, mtb.b_content, true);//取得替换后的表单数据 Label4.Text = mtb.b_title + " (" + mtb.b_time + ")"; formfile = Tunnel.Common.GetValue.getFile(mtb.b_file); if (mf.f_isfile.ToString() == "1") { isuploads = false; } Repeater1.DataSource = bts.GetList("s_lid=" + mf.f_id); Repeater1.DataBind(); } catch { Tunnel.Common.Message.back("不正确的ID"); return; } }
protected void Button1_Click(object sender, EventArgs e) { Tunnel.BLL.Tunnel_bum bt = new Tunnel.BLL.Tunnel_bum(); Tunnel.BLL.Tunnel_form tf = new Tunnel.BLL.Tunnel_form(); Tunnel.Model.Tunnel_form mf = new Tunnel.Model.Tunnel_form(); Tunnel.BLL.Tunnel_formtype btf = new Tunnel.BLL.Tunnel_formtype(); Tunnel.Model.Tunnel_formtype bmf = new Tunnel.Model.Tunnel_formtype(); mf.f_name = TextBox1.Text.Trim(); mf.f_lcid = int.Parse(DropDownList2.SelectedValue); mf.f_bum = 0; mf.f_user = 1; mf.f_date = DateTime.Now; int i = tf.Name_Add(mf); if (i > 0) { bmf.Form_id = i; bmf.Form_name = TextBox1.Text.Trim(); bmf.Item_max = 0; btf.Add(bmf); Tunnel.Common.Message.Show("保存成功!"); } }
protected void ShowEdit() { mf = bf.GetModel(int.Parse(Request.Params["id"])); TextBox1.Text = mf.f_name; //DropDownList2.SelectedValue = mf.f_lcid.ToString(); }
/// <summary> /// 更新一条数据 /// </summary> public void Update_Name(Tunnel.Model.Tunnel_form model) { dal.Update_Name(model); }
/// <summary> /// 设计表单内容 /// </summary> public int Add(Tunnel.Model.Tunnel_form model) { return(dal.Add(model)); }
/// <summary> /// 增加表单名称 /// </summary> public int Name_Add(Tunnel.Model.Tunnel_form model) { return(dal.Name_Add(model)); }