Esempio n. 1
0
 protected void btnOk_ServerClick1(object sender, EventArgs e)
 {
     if(this.txtName.Text ==""){
         Alert("经营模式类别不能为空");
         return;
     }
     XYECOM.Model.ModeInfo em = new XYECOM.Model.ModeInfo();
     XYECOM.Business.Mode m = new XYECOM.Business.Mode();
     em.M_Type =this.txtName.Text;
     int i = 0;
     i = m.Insert(em);
     if (i == 1)
     {
         Response.Redirect(url);
     }
     else if (i == -1)
     {
         Alert("该记录已经存在,请重新输入!", url);
         Modelist();
     }
     else
     {
         Alert("添加失败!", url);
     }
 }
Esempio n. 2
0
    protected void gvlist_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "del")
        {
            XYECOM.Business.Mode m = new XYECOM.Business.Mode();

            int id = Int32.Parse(gvlist.DataKeys[Convert.ToInt32(e.CommandArgument)].Value.ToString());
            int i = m.Delete(id);
            if (i == 1)
            {
                Modelist();
            }
            else
            {
                Alert("删除失败!", url);
            }
        }
        else if (e.CommandName == "up")
        {
            XYECOM.Business.Mode m = new XYECOM.Business.Mode();
            XYECOM.Model.ModeInfo em = new XYECOM.Model.ModeInfo();
            this.key.Value = "2";
            em=m .GetItem (Int32.Parse(gvlist.DataKeys[Convert.ToInt32(e.CommandArgument)].Value.ToString()));
            this.value.Value = gvlist.DataKeys[Convert.ToInt32(e.CommandArgument)].Value.ToString();
            this .uname .Text  = em .M_Type .ToString ();
        }
    }
Esempio n. 3
0
    protected void Submit1_ServerClick(object sender, EventArgs e)
    {
        XYECOM.Model.ModeInfo em = new XYECOM.Model.ModeInfo();
        XYECOM.Business.Mode m = new XYECOM.Business.Mode();

        em.M_Type = this.uname.Text;
        em .M_ID =Convert.ToInt32(this.value.Value);

        int i = 0;
        i = m.Update(em);

        if (i == 1)
        {
            Response.Redirect(url);
            Modelist();
        }
        else
        {
            Alert("修改失败!", url);
        }
    }