Beispiel #1
0
    public void populateServiceddl()
    {
        //GCommon<Service> obj = new DataManipulationClass().populateService();
        List <Service> obj = new DataManipulationClass().populateService_list();
        DataTable      dt  = GenericListToDataTable(obj);

        ViewState["dtdata1"] = dt;
        Session["list"]      = obj;
        // this.gridTest.DataSource = dt;
        this.gridTest.DataSource = obj;
        this.gridTest.DataBind();



        if (obj.Count > 0)
        {
            IEnumerator <Service> ie = obj.GetEnumerator();

            ListItem li = new ListItem();
            li.Value = "0";
            li.Text  = "Please Select";
            ddlService.Items.Insert(0, li);

            while (ie.MoveNext())
            {
                li       = new ListItem();
                li.Text  = ie.Current.service_name.ToString();
                li.Value = ie.Current.service_id.ToString();
                ddlService.Items.Add(li);
            }
        }
    }
    public void populateStateddl()
    {
        GCommon <State>     obj = new DataManipulationClass().populateState();
        IEnumerator <State> ie  = obj.GetEnumerator();

        while (ie.MoveNext())
        {
            ListItem li = new ListItem();
            li.Text  = ie.Current.sname.ToString();
            li.Value = ie.Current.sid.ToString();
            ddlState.Items.Add(li);
        }
    }
    public void populateServiceddl()
    {
        GCommon <Service> obj = new DataManipulationClass().populateService();

        if (obj.Count > 0)
        {
            IEnumerator <Service> ie = obj.GetEnumerator();
            ListItem li = new ListItem();
            li.Value = "0";
            li.Text  = "Please Select";
            ddlService.Items.Insert(0, li);

            while (ie.MoveNext())
            {
                li       = new ListItem();
                li.Text  = ie.Current.service_name.ToString();
                li.Value = ie.Current.service_id.ToString();
                ddlService.Items.Add(li);
            }
        }
    }
    private void populateSite(int UserId)
    {
        GCommon <WebSiteDetail> objLink = new DataManipulationClass().GetSiteCollection(UserId);

        if (objLink.Count > 0)
        {
            System.Collections.Generic.IEnumerator <WebSiteDetail> ie = objLink.GetEnumerator();
            ddlSite.Items.Clear();
            ListItem li = new ListItem();
            li.Text  = "Please Select";
            li.Value = "";
            ddlSite.Items.Add(li);

            while (ie.MoveNext())
            {
                li       = new ListItem();
                li.Text  = Convert.ToString(ie.Current.SiteURL);
                li.Value = Convert.ToString(ie.Current.Id);
                ddlSite.Items.Add(li);
            }
        }
    }