Beispiel #1
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        Cms.BLL.wx_msg   bll    = new Cms.BLL.wx_msg();
        Cms.Model.wx_msg bml    = new Cms.Model.wx_msg();
        string           action = this.Request.QueryString["action"] ?? "";//编辑:edit 添加:add
        int  id = Convert.ToInt32(this.Request.QueryString["id"] ?? "0");
        bool bl = false;

        if (action == "add")
        {
            bml.orderNumber = tborderNumber.Text.Trim();
            bml.info        = tbinfo.Value;
            bml.updatetime  = DateTime.Now;
            bl = bll.Add(bml) > 0 ? true : false;
        }
        else
        {
            bml             = new Cms.BLL.wx_msg().GetModel(id);
            bml.orderNumber = tborderNumber.Text.Trim();
            bml.info        = tbinfo.Value;
            bl = bll.Update(bml);
        }
        if (bl)
        {
            //ShowConfirm("是否继续添加?", "msgedit.aspx?action=add", "msglist.aspx");
            JscriptMsg("提交成功!", "msglist.aspx", "Success");
        }
        else
        {
            JscriptMsg("提交失败!", "msgedit.aspx?action=Edit?id=" + id, "Error");
        }
    }
Beispiel #2
0
    public void bind_date(int _id)
    {
        Cms.BLL.wx_msg bll = new Cms.BLL.wx_msg();
        DataTable      dt  = bll.GetList("id=" + _id).Tables[0];

        if (dt.Rows.Count > 0)
        {
            tborderNumber.Text = dt.Rows[0]["orderNumber"].ToString();
            tbinfo.Value       = dt.Rows[0]["info"].ToString();
        }
    }