//确定
        protected void btnsure_Click(object sender, EventArgs e)
        {
            string name      = this.txName.Text;    //棋牌室名称
            string type      = this.ddlCat.Text;    //棋牌室类型
            string Price     = this.Textprice.Text; //棋牌室价格
            string are       = this.Textprice.Text; //棋牌室地域
            string address   = this.Textprice.Text; //祥细地址
            string imagePath = this.Textprice.Text; //图片地址
            string content   = this.Textprice.Text; //祥细介绍
            string IfR       = "";

            if (this.Rec.Checked)
            {
                IfR = "0";
            }
            QPS.NEW.Model.Room Mro = new QPS.NEW.Model.Room();
            Mro.Name        = name;
            Mro.RoomType    = type;
            Mro.RoomPrice   = Convert.ToDecimal(Price);
            Mro.Are         = are;
            Mro.Address     = address;
            Mro.ImagePath   = imagePath;
            Mro.Content     = content;
            Mro.IfRecommend = Convert.ToInt32(IfR);

            QPS.NEW.BLL.Room rm = new QPS.NEW.BLL.Room();
            //rm.Add(Mro);
            int i = rm.Add(Mro);

            if (i > 0)
            {
                Response.Write("<script>alert('添加成功!!');</script>");
            }
            else
            {
                Response.Write("<script>alert('添加失败!!');</script>");
            }
        }
        //确定
        protected void btnsure_Click(object sender, EventArgs e)
        {
            string name = this.txName.Text;  //棋牌室名称
            string type = this.ddlCat.Text; //棋牌室类型
            string Price = this.Textprice.Text;	//棋牌室价格
            string are = this.Textprice.Text; //棋牌室地域
            string address = this.Textprice.Text; //祥细地址
            string imagePath = this.Textprice.Text;	//图片地址
            string content = this.Textprice.Text;//祥细介绍
            string IfR = "";
            if(this.Rec.Checked)
            {
                IfR = "0";
            }
            QPS.NEW.Model.Room Mro = new QPS.NEW.Model.Room();
            Mro.Name = name;
            Mro.RoomType = type;
            Mro.RoomPrice = Convert.ToDecimal(Price);
            Mro.Are = are;
            Mro.Address = address;
            Mro.ImagePath = imagePath;
            Mro.Content = content;
            Mro.IfRecommend =Convert.ToInt32(IfR);

            QPS.NEW.BLL.Room rm = new QPS.NEW.BLL.Room();
            //rm.Add(Mro);
            int i = rm.Add(Mro);
            if (i > 0)
            {
                Response.Write("<script>alert('添加成功!!');</script>");
            }
            else
            {
                Response.Write("<script>alert('添加失败!!');</script>");
            }

        }
Exemple #3
0
 protected void btnCreate_Click(object sender, EventArgs e)
 {
     try
     {
         QPS.NEW.BLL.Room   Broom = new QPS.NEW.BLL.Room();
         QPS.NEW.Model.Room Mroom = new QPS.NEW.Model.Room();
         if (this.fulImg.FileName == "")
         {
             //this.lblMessage.Text = "<font color=#FF0000>请选择上传的图片!</font>";
             this.fulImg.Focus();
             return;
         }
         if (txfName.Value == string.Empty)
         {
             Response.Write("<script>alert('用户名不能为空,请重新输入')</script>");
             return;
         }
         if (txfRoomPrice.Value == string.Empty)
         {
             Response.Write("<script>alert('请重新输入房间价格')</script>");
             return;
         }
         if (txfAddress.Value == string.Empty)
         {
             Response.Write("<script>alert('地址不能为空,请重新输入')</script>");
             return;
         }
         if (txfArea.Text == string.Empty)
         {
             Response.Write("<script>alert('地区不能为空,请重新输入')</script>");
             return;
         }
         if (txfContent.Value == string.Empty)
         {
             Response.Write("<script>alert('内容不能为空,请重新输入')</script>");
             return;
         }
         if (txfRoomType.Text == string.Empty)
         {
             Response.Write("<script>alert('房间类型不能为空,请重新输入')</script>");
             return;
         }
         Mroom.Name        = txfName.Value;
         Mroom.RoomPrice   = Convert.ToDecimal(txfRoomPrice.Value);
         Mroom.RoomState   = 0;
         Mroom.IfRecommend = 1;
         Mroom.Address     = txfAddress.Value;
         Mroom.Are         = txfArea.Text;
         Mroom.Content     = txfContent.Value.Length > 100 ? txfContent.Value.Substring(0, 100) : txfContent.Value;
         Mroom.RoomType    = txfRoomType.Text;
         Mroom.OwnerID     = userid;
         Mroom.ImagePath   = Upload(fulImg);
         Mroom.Examine     = 0;
         Broom.Add(Mroom);
         Response.Write("<script>alert('添加棋牌室成功!')</script>");
         Response.Write("<script>window.close()</script>");
     }
     catch (Exception ex)
     {
         Response.Write("<script>alert('添加棋牌室失败!')</script>");
         return;
     }
 }
Exemple #4
0
 protected void btnCreate_Click(object sender, EventArgs e)
 {
     try
     {
         QPS.NEW.BLL.Room Broom = new QPS.NEW.BLL.Room();
         QPS.NEW.Model.Room Mroom = new QPS.NEW.Model.Room();
         if (this.fulImg.FileName == "")
         {
             //this.lblMessage.Text = "<font color=#FF0000>请选择上传的图片!</font>";
             this.fulImg.Focus();
             return;
         }
         if (txfName.Value == string.Empty)
         {
             Response.Write("<script>alert('用户名不能为空,请重新输入')</script>");
             return;
         }
         if (txfRoomPrice.Value == string.Empty)
         {
             Response.Write("<script>alert('请重新输入房间价格')</script>");
             return;
         }
         if (txfAddress.Value == string.Empty)
         {
             Response.Write("<script>alert('地址不能为空,请重新输入')</script>");
             return;
         }
         if (txfArea.Text == string.Empty)
         {
             Response.Write("<script>alert('地区不能为空,请重新输入')</script>");
             return;
         }
         if (txfContent.Value == string.Empty)
         {
             Response.Write("<script>alert('内容不能为空,请重新输入')</script>");
             return;
         }
         if (txfRoomType.Text == string.Empty)
         {
             Response.Write("<script>alert('房间类型不能为空,请重新输入')</script>");
             return;
         }
         Mroom.Name = txfName.Value;
         Mroom.RoomPrice = Convert.ToDecimal(txfRoomPrice.Value);
         Mroom.RoomState = 0;
         Mroom.IfRecommend =1;
         Mroom.Address = txfAddress.Value;
         Mroom.Are = txfArea.Text;
         Mroom.Content = txfContent.Value.Length > 100 ? txfContent.Value.Substring(0, 100) : txfContent.Value;
         Mroom.RoomType = txfRoomType.Text;
         Mroom.OwnerID = userid;
         Mroom.ImagePath = Upload(fulImg);
         Mroom.Examine = 0;
         Broom.Add(Mroom);
         Response.Write("<script>alert('添加棋牌室成功!')</script>");
         Response.Write("<script>window.close()</script>");
     }
     catch (Exception ex)
     {
         Response.Write("<script>alert('添加棋牌室失败!')</script>");
         return;
     }
 }