Esempio n. 1
0
 protected void Button3_Click(object sender, EventArgs e)
 {
     if (TextBox1.Text == "" && TextBox2.Text == "" && TextBox3.Text == "" && DropDownList1.SelectedValue == "0" && DropDownList2.SelectedValue == "0" && DropDownList3.SelectedValue == "0")
     {
         Response.Write("<script>alert('请将信息填写完整!')</script>");
     }
     else
     {
         CumrooInfoModel model = new CumrooInfoModel()
         {
             CusName   = Convert.ToString(TextBox1.Text),
             CusSex    = Convert.ToString(RadioButtonList1.SelectedValue),
             CusPhone  = Convert.ToString(TextBox2.Text),
             CusBodyId = Convert.ToString(TextBox3.Text),
             RTypeID   = Convert.ToInt32(DropDownList1.SelectedValue),
             NumID     = Convert.ToInt32(DropDownList2.SelectedValue),
             RightID   = Convert.ToInt32(DropDownList3.SelectedValue)
         };
         if (Convert.ToInt32(CumrooInfoBLL.int_kaifang(model)) > 0)
         {
             Response.Write("<script>alert('添加成功!');location.href='OneRoom.aspx'</script>");
         }
         else
         {
             Response.Write("<script>alert('该房源暂时紧缺!')");
         }
     }
 }
Esempio n. 2
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            if (DropDownList1.SelectedValue == "0")
            {
                Response.Write("<script>alert('请选择房间类型!')</script>");
            }
            CumrooInfoModel model = new CumrooInfoModel()
            {
                CusName   = Convert.ToString(TextBox1.Text),
                CusSex    = Convert.ToString(RadioButtonList1.SelectedValue),
                CusPhone  = Convert.ToString(TextBox2.Text),
                CusBodyId = Convert.ToString(TextBox3.Text),
                RTypeID   = Convert.ToInt32(DropDownList1.SelectedValue),
                NumID     = Convert.ToInt32(DropDownList2.SelectedValue),
                RightID   = Convert.ToInt32(DropDownList3.SelectedValue)
            };

            if (Convert.ToInt32(CumrooInfoBLL.int_kaifang(model)) > 0)
            {
                Response.Write("<script>alert('添加成功!');</script>");
            }
        }