Example #1
0
 //Displays all the category in the grid view
 public void GetAllCategory()
 {
     try
     {
         dtCategory            = categoryBLLObj.BLLGetAllCategory();
         gvCategory.DataSource = dtCategory;
         gvCategory.DataBind();
         ViewState["CategoryData"] = dtCategory;
     }
     catch (Exception ex)
     {
         string m = ex.Message;
     }
 }
    public void fillDLLs()
    {
        DataTable dtCityShowAll = cityBLLObj.BLLShowAllCity();

        ddlCity.DataSource     = dtCityShowAll;
        ddlCity.DataTextField  = "cityName";
        ddlCity.DataValueField = "cityId";
        ddlCity.DataBind();
        ddlCity.Items.Add("---Select---");
        ddlCity.SelectedIndex = ddlCity.Items.Count - 1;
        ddlCity.Items[ddlCity.Items.Count - 1].Value = "";


        DataTable dtStateShowAll = stateBLLObj.BLLStateShowAll();

        ddlState.DataSource     = dtStateShowAll;
        ddlState.DataTextField  = "stateName";
        ddlState.DataValueField = "stateId";
        ddlState.DataBind();
        ddlState.Items.Add("---Select---");
        ddlState.SelectedIndex = ddlState.Items.Count - 1;
        ddlState.Items[ddlState.Items.Count - 1].Value = "";

        DataTable dtCategory = categoryBLLObj.BLLGetAllCategory();

        ddlSelectCategory.DataSource     = dtCategory;
        ddlSelectCategory.DataTextField  = "categoryName";
        ddlSelectCategory.DataValueField = "categoryId";
        ddlSelectCategory.DataBind();
        ddlSelectCategory.Items.Add("---Select---");
        ddlSelectCategory.SelectedIndex = ddlSelectCategory.Items.Count - 1;
        ddlSelectCategory.Items[ddlSelectCategory.Items.Count - 1].Value = "";

        DataTable dtAdvertiseSelect = advBLLObj.BLLAdvertiseShowAll();

        ddlAdvId.DataSource    = dtAdvertiseSelect;
        ddlAdvId.DataTextField = "maxId";
        ddlAdvId.DataBind();
        ddlAdvId.Items.Add("---Select---");
        ddlAdvId.SelectedIndex = ddlAdvId.Items.Count - 1;
        ddlAdvId.Items[ddlAdvId.Items.Count - 1].Value = "";

        DataTable dtAdvertiseLocation = pubAdvBLLObj.BLLAdvertiseLocation();

        ddlLocation.DataSource     = dtAdvertiseLocation;
        ddlLocation.DataTextField  = "LocationName";
        ddlLocation.DataValueField = "LocId";
        ddlLocation.DataBind();
        ddlLocation.Items.Add("---Select---");
        ddlLocation.SelectedIndex = ddlLocation.Items.Count - 1;
        ddlLocation.Items[ddlLocation.Items.Count - 1].Value = "";
    }