Exemplo n.º 1
0
        /// <summary>
        /// 添加房型
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            string id = Request.QueryString["id"].ToString();

            Model.room_type fm = new Model.room_type();
            fm.room_name        = this.txt_roomName.Value;
            fm.room_listedmoney = Convert.ToDecimal(this.txt_room_listedmoney.Value);
            fm.room_zmmoney     = Convert.ToDecimal(this.txt_room_zmmoney.Value);
            fm.room_reamker     = this.txt_Reamker.Value;
            fm.Room_ealry_price = Convert.ToDecimal(txt_lcPrice.Value);
            fm.Room_Moth_price  = Convert.ToDecimal(txt_yzprice.Value);
            fm.room_number      = "1";
            fm.Room_Bfb         = Convert.ToInt32(txt_iscy.Value);
            if (this.raddyes.Checked)
            {
                fm.room_hour = raddyes.Value;
            }
            else
            {
                fm.room_hour = raddno.Value;
            }
            if (id == "")
            {
                int b = fmBll.Add(fm);
                if (b > 0)
                {
                    ClientScript.RegisterStartupScript(GetType(), "message", "<script language='javascript' defer>alert('保存成功!');parent.Window_Close();</script>");
                }
            }
            else
            {
                fm.id = Convert.ToInt32(id);
                if (fmBll.Update(fm))
                {
                    ClientScript.RegisterStartupScript(GetType(), "message", "<script language='javascript' defer>alert('修改成功!');parent.Window_Close();</script>");
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 添加房型
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            string id = Request.QueryString["id"].ToString();

            Model.room_type fm = new Model.room_type();
            fm.room_name        = this.txt_roomName.Value;
            fm.room_listedmoney = Convert.ToDecimal(this.txt_room_listedmoney.Value);
            fm.room_zmmoney     = Convert.ToDecimal(this.txt_room_zmmoney.Value);
            fm.room_reamker     = this.txt_Reamker.Value;

            fm.room_number = "1";
            if (this.raddyes.Checked)
            {
                fm.room_hour = raddyes.Text;
            }
            else
            {
                fm.room_hour = raddno.Text;
            }
            if (id == "")
            {
                int b = fmBll.Add(fm);
                if (b > 0)
                {
                    Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "");
                }
            }
            else
            {
                fm.id = Convert.ToInt32(id);
                if (fmBll.Update(fm))
                {
                    Maticsoft.Common.MessageBox.ShowAndRedirect(this, "更新成功!", "");
                }
            }
        }