コード例 #1
0
ファイル: HFEdit.aspx.cs プロジェクト: 123ljf/personal
    /// <summary>
    /// 编辑社团
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        T_STB model = new T_STB();
        int   STF   = 0;

        if (this.txtSTF.Text != "")
        {
            STF = int.Parse(this.txtSTF.Text);
        }
        model.STF = STF;
        if (Request.Params["id"] != null && Request.Params["id"].Trim() != "")
        {
            //修改
            model.STBID = Convert.ToInt32(Request.Params["id"]);
            if (model.Update(model) <= 0)
            {
                ResponseMessage(this, "修改失败、请检查输入是否正确!");
                return;
            }
        }
        Response.Redirect("HFXXXG.aspx");
    }
コード例 #2
0
ファイル: STEdit.aspx.cs プロジェクト: 123ljf/personal
    /// <summary>
    /// 编辑社团
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        if (this.txtSTBMC.Text == "")
        {
            ResponseMessage(this, "社团名称不能为空! ");
            return;
        }


        if (this.txtSTF.Text != "")
        {
            if (!IsPlusInt(this.txtSTF.Text))
            {
                ResponseMessage(this, "社团费用类型错误!");
                return;
            }
        }
        T_STB model = new T_STB();


        string STBMC = this.txtSTBMC.Text;
        int    BZID  = 0;

        if (this.ddlBZ.SelectedValue != "")
        {
            BZID = int.Parse(this.ddlBZ.SelectedValue);
        }

        int CYRS = 0;

        if (this.txtCYRS.Text != "")
        {
            CYRS = int.Parse(this.txtCYRS.Text);
        }


        string MOBILE = this.txtMOBILE.Text;
        string STZN   = this.txtSTZN.Text;
        string BZ     = this.txtBZ.Text;
        int    STF    = 0;

        if (this.txtSTF.Text != "")
        {
            STF = int.Parse(this.txtSTF.Text);
        }



        model.STBMC  = STBMC;
        model.BZID   = BZID;
        model.CYRS   = CYRS;
        model.MOBILE = MOBILE;
        model.STZN   = STZN;
        model.BZ     = BZ;
        model.STF    = STF;

        if (Request.Params["id"] != null && Request.Params["id"].Trim() != "")
        {
            //修改
            model.STBID = Convert.ToInt32(Request.Params["id"]);
            if (model.Update(model) <= 0)
            {
                ResponseMessage(this, "修改失败、请检查输入是否正确!");
                return;
            }
        }
        else
        {
            if (model.ExistsBYNAME(this.txtSTBMC.Text))
            {
                ResponseMessage(this, "社团重名!");
                return;
            }
            //添加
            if (model.Add(model) <= 0)
            {
                ResponseMessage(this, "添加社团失败!");
                return;
            }
        }
        if (Request.Params["t"] != null)
        {
            Response.Redirect("~/XXXG/STXXXG.aspx");
        }
        else
        {
            Response.Redirect("STGL.aspx");
        }
    }