Ejemplo n.º 1
0
    private void sava()
    {
        mtb = btb.GetModel(Convert.ToInt32(Request.Params["bid"]));
        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(mtb.b_sort);
        mtb.b_title = TextBox1.Text.Trim();
        mtb.b_state = (mf.f_state == 0 ? 1 : 2);
        mtb.b_suser = (RadioButtonList3.SelectedValue == "1" ? int.Parse(m_value.Value) : 0);
        btb.Update(mtb);
    }
Ejemplo n.º 2
0
    private void sava()
    {
        ArrayList list = new ArrayList();

        mtb.b_content   = FCKeditor1.Value;
        mtb.b_datefield = "";
        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 = "";
            }
        }
        mtb.b_id          = int.Parse(Request.Params["bid"]);
        mtb.b_title       = TextBox1.Text.Trim();
        mtb.b_time        = DateTime.Now;
        mtb.b_user        = ul.LoginID;
        mtb.b_formcontent = "";
        mtb.b_sort        = 0;
        mtb.b_state       = 2;
        mtb.b_suser       = 0;
        mtb.b_stype       = 1;
        btb.Update(mtb);
    }