protected void SubmitButton_Click(object sender, EventArgs e)
    {
        da = new SqlDataAdapter("insert into [Homestay-Resort_Details](HR_Type,HR_Stars,HR_Category,HR_Name,HR_Country,HR_City,Amount,Description)values('" + DropDownListType.SelectedItem.Text + "','" + NameDropDownList.SelectedItem.Text + "','" + DropdownCategory.SelectedItem.Text + "','" + NameTextBox.Text + "','" + DropDownCountry.SelectedItem.Text + "','" + DropDownCity.SelectedItem.Text + "'," + TextBoxAmount.Text + ",'" + DescTextBox.Text + "')", con);
        dt = new DataTable();
        da.Fill(dt);
        CmtLabel.Text = "Data Submit";
        DropDownListType.ClearSelection();
        NameDropDownList.ClearSelection();
        DropdownCategory.ClearSelection();
        NameTextBox.Text = "";
        DropDownCountry.ClearSelection();
        DropDownCity.ClearSelection();
        TextBoxAmount.Text = "";
        DescTextBox.Text   = "";
        CmtLabel.Text      = "Data Submit";


        da = new SqlDataAdapter("select * from [Homestay-Resort_Details] order by HR_ID desc", con);
        dt = new DataTable();
        da.Fill(dt);
        if (dt.Rows.Count > 0)
        {
            GridViewHomestayDetails.DataSource = dt;
            GridViewHomestayDetails.DataBind();
        }
        else
        {
            GridViewHomestayDetails.DataSource = "";
            GridViewHomestayDetails.DataBind();
        }
    }
    protected void SubmitButton_Click(object sender, EventArgs e)
    {
        da = new SqlDataAdapter("insert into Hotel_Details(H_Type,H_Stars,H_Name,H_Country,Room_Category,H_City,Amount,Description)values('" + typeDropDownList.SelectedItem.Text + "','" + StarDropDownList.SelectedItem.Text + "','" + NameTextBox.Text + "','" + DropDownCountry.SelectedItem.Text + "','" + DropdownCategory.SelectedItem.Text + "','" + DropDownCity.SelectedItem.Text + "'," + AmtTextBox.Text + ",'" + DescTextBox.Text + "')", con);
        dt = new DataTable();
        da.Fill(dt);
        cmtLabel.Text = "Data Submit";
        typeDropDownList.ClearSelection();
        StarDropDownList.ClearSelection();
        NameTextBox.Text = "";
        DropDownCountry.ClearSelection();
        DropdownCategory.ClearSelection();
        DropDownCity.ClearSelection();
        AmtTextBox.Text  = "";
        DescTextBox.Text = "";

        da = new SqlDataAdapter("select * from Hotel_Details order by H_Id desc", con);
        dt = new DataTable();
        da.Fill(dt);
        if (dt.Rows.Count > 0)
        {
            GridViewHotelDetails.DataSource = dt;
            GridViewHotelDetails.DataBind();
        }
        else
        {
            GridViewHotelDetails.DataSource = "";
            GridViewHotelDetails.DataBind();
        }
    }
    protected void SubmitButton_Click(object sender, EventArgs e)
    {
        da = new SqlDataAdapter("insert into Package_Details(P_Type,P_Category,Country,City,Days,Amount,Description)values('" + DropDownListType.SelectedItem.Text + "','" + DropdownCategory.SelectedItem.Text + "','" + DropDownCountry.SelectedItem.Text + "','" + DropDownCity.SelectedItem.Text + "','" + TextBoxDays.Text + "'," + TextBoxAmount.Text + ",'" + TextBoxDesc.Text + "')", con);
        dt = new DataTable();
        da.Fill(dt);
        Label1.Text = "Data Submit Successfully";
        DropDownCountry.ClearSelection();
        DropDownCity.ClearSelection();
        DropdownCategory.ClearSelection();
        DropDownListType.ClearSelection();
        TextBoxDays.Text   = "";
        TextBoxAmount.Text = "";
        TextBoxDesc.Text   = "";

        da = new SqlDataAdapter("select * from Package_Details order by P_Id desc", con);
        dt = new DataTable();
        da.Fill(dt);
        if (dt.Rows.Count > 0)
        {
            GridViewPackageDetails.DataSource = dt;
            GridViewPackageDetails.DataBind();
        }
        else
        {
            GridViewPackageDetails.DataSource = "";
            GridViewPackageDetails.DataBind();
        }
    }
        private void CityBind()
        {
            CityInfoBLL _CityInfoBLL = new CityInfoBLL();
            DataTable   DT           = _CityInfoBLL.GetAllCityInfo();

            this.DropDownCity.Items.Clear();
            DropDownCity.DataSource     = DT;
            DropDownCity.DataTextField  = "CityName";
            DropDownCity.DataValueField = "CityID";
            DropDownCity.DataBind();
        }
Esempio n. 5
0
    /* protected void GridView1_RowEditing1(object sender, GridViewEditEventArgs e)
     * {
     *
     *   GridView1.EditIndex = e.NewEditIndex;
     *   bindgrid();
     *   DropDownList ddlstate = (DropDownList)GridView1.Rows[e.NewEditIndex].FindControl("DropDownList1");
     * //  var data = from d in db.StateMasters select d;
     *   ddlstate.DataSource = db.manage_state(0,"",4);
     *   ddlstate.DataTextField = "StateName";
     *   ddlstate.DataValueField = "StateId";
     *   ddlstate.DataBind();
     *
     * }
     * protected void GridView1_RowDeleting1(object sender, GridViewDeleteEventArgs e)
     * {
     *   int CityId = int.Parse(GridView1.DataKeys[e.RowIndex].Values["CityId"].ToString());
     *   db.manage_city(CityId,"",0,3);
     *
     *   bindgrid();
     * }
     * protected void GridView1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
     * {
     *   GridView1.EditIndex = -1;
     *   bindgrid();
     * }*/
    protected void DropDownState_SelectedIndexChanged(object sender, EventArgs e)
    {
        int id   = Convert.ToInt16(DropDownState.SelectedValue);
        var data = from d in db.CityMasters
                   where d.StateId == id
                   select d;

        DropDownCity.DataSource     = data;
        DropDownCity.DataTextField  = "CityName";
        DropDownCity.DataValueField = "CityId";
        DropDownCity.DataBind();
        DropDownCity.Items.Insert(0, "--Select city--");
    }
Esempio n. 6
0
 public void City()
 {
     cn.Open();
     using (SqlCommand cmd = new SqlCommand("select cityname,cityid from CityTable where stateId='" + DropDownState.SelectedValue + "'", cn))
     {
         using (SqlDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection))
         {
             DropDownCity.DataSource = dr;
             DropDownCity.Items.Clear();
             DropDownCity.Items.Add("Please Select City");
             DropDownCity.DataTextField  = "CityName";
             DropDownCity.DataValueField = "CityName";
             DropDownCity.DataBind();
         }
     }
 }
Esempio n. 7
0
        private void InitDropDownCity()
        {
            int provinceID = 0;

            if (DropDownProvince.SelectedValue != null)
            {
                provinceID = Infobasis.Web.Util.Change.ToInt(DropDownProvince.SelectedValue);
            }

            IQueryable table = DB.Citys.Where(item => item.ProvinceID == provinceID && item.IsActive == true).OrderBy(item => item.DisplayOrder);

            DropDownCity.DataSource     = table;
            DropDownCity.DataTextField  = "Name";
            DropDownCity.DataValueField = "ID";
            DropDownCity.DataBind();
            DropDownCity.Items.Insert(0, new FineUIPro.ListItem("请选择区域", "-1"));
        }
    protected void DropDownCountry_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (DropDownCountry.SelectedIndex > 0)
        {
            da = new SqlDataAdapter("select  CityName from CountryCityMaster where CountryName='" + DropDownCountry.SelectedItem.Text + "' order by CityName", con);
            dt = new DataTable();
            da.Fill(dt);
            if (dt.Rows.Count > 0)
            {
                DropDownCity.DataSource    = dt;
                DropDownCity.DataTextField = "CityName";
                DropDownCity.DataBind();

                DropDownCity.Items.Insert(0, "Select City");
                DropDownCity.Items.Insert(dt.Rows.Count + 1, "Other City");
            }
        }
    }
        public List <DropDownCity> GetListOfCitiesByStates(string valueSelected)
        {
            List <DropDownCity> listDropDownCisty = new List <DropDownCity>();
            BAL_Common          bAL_Common        = new BAL_Common();
            List <City>         cityList          = new List <City>();

            cityList = bAL_Common.GetCityByStateIDForDropDown(valueSelected);

            foreach (City city in cityList)
            {
                DropDownCity dropDownCity = new DropDownCity();
                dropDownCity.StateID = city.StateID;
                dropDownCity.text    = city.Name;
                dropDownCity.Value   = city.ID;
                listDropDownCisty.Add(dropDownCity);
            }
            return(listDropDownCisty);
        }