Esempio n. 1
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (this.hidRoomTypeId.Value == "0")
        {
            this.lblResult.Text = "Invalid RoomType. Please select a Room Type from Room Types Screen.";
            return;
        }
        RoomType_OnlineDetails details = new RoomType_OnlineDetails();

        details.RoomType_ID = Int32.Parse(this.hidRoomTypeId.Value);

        /* details.Number_of_Rooms = Int32.Parse(drpNumberOfRooms.SelectedValue);
         * details.Number_of_BedRooms = Int32.Parse(drpNumberOfBedRooms.SelectedValue);
         * details.Number_of_BathRooms = Int32.Parse(drpNumberOfBathRooms.SelectedValue);
         * details.Number_of_LivingRooms = Int32.Parse(drpNumberOfLivingRooms.SelectedValue);
         * details.Number_of_Kitchens = Int32.Parse(drpNumberOfKitchens.SelectedValue);
         * details.Number_of_Adults = Int32.Parse(drpNumberOfAdults.SelectedValue);
         * details.Number_of_Children = Int32.Parse(drpNumberOfChildren.SelectedValue);*/
        details.Description = txtDescription.Text;

        if (this.hidRoomTypeOnlineId.Value == "0")
        {
            if (details.Insert())
            {
                this.lblResult.Text            = "Successfully Inserted";
                this.hidRoomTypeOnlineId.Value = details.RoomType_Online_ID.ToString();
            }
            else
            {
                this.lblResult.Text = "Error Code " + details.ErrorCode.ToString() + "; Description " + details.ErrorDesc.ToString();
            }
        }
        else
        {
            details.RoomType_Online_ID = Int32.Parse(this.hidRoomTypeOnlineId.Value);
            if (details.Update())
            {
                this.lblResult.Text = "Successfully Updated";
            }
            else
            {
                this.lblResult.Text = "Error Code " + details.ErrorCode.ToString() + "; Description " + details.ErrorDesc.ToString();
            }
        }
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (this.hidRoomTypeId.Value == "0")
        {
            this.lblResult.Text = "Invalid RoomType. Please select a Room Type from Room Types Screen.";
            return;
        }
        RoomType_OnlineDetails details = new RoomType_OnlineDetails();

        details.RoomType_ID = Int32.Parse(this.hidRoomTypeId.Value);
        details.Description = txtDescription.Text;
        //string txt = txtDescriptionExtender.Decode(txtDescription.Text);

        if (this.hidRoomTypeOnlineId.Value == "0")
        {
            if (details.Insert())
            {
                this.lblResult.Text            = "Successfully Inserted";
                this.hidRoomTypeOnlineId.Value = details.RoomType_Online_ID.ToString();
            }
            else
            {
                this.lblResult.Text = "Error Code " + details.ErrorCode.ToString() + "; Description " + details.ErrorDesc.ToString();
            }
        }
        else
        {
            details.RoomType_Online_ID = Int32.Parse(this.hidRoomTypeOnlineId.Value);
            if (details.Update())
            {
                this.lblResult.Text = "Successfully Updated";
            }
            else
            {
                this.lblResult.Text = "Error Code " + details.ErrorCode.ToString() + "; Description " + details.ErrorDesc.ToString();
            }
        }
    }