Пример #1
0
        private void LoadData()
        {
            clsCompaniesFactory fac  = new clsCompaniesFactory();
            DataTable           comp = fac.GetAll();
            DataView            dv   = comp.DefaultView;

            dv.Sort = "Company";
            ddlCompany.DataSource     = dv;
            ddlCompany.DataTextField  = "Company";
            ddlCompany.DataValueField = "Id";
            ddlCompany.DataBind();

            clsLabelsFactory facl = new clsLabelsFactory();
            DataTable        lbl  = facl.GetAll();
            DataView         dv1  = lbl.DefaultView;

            dv1.Sort                = "Title";
            ddlLabel.DataSource     = dv1;
            ddlLabel.DataTextField  = "Title";
            ddlLabel.DataValueField = "Id";
            ddlLabel.DataBind();

            clsPromotionFactory facp        = new clsPromotionFactory();
            DataSet             prmtn       = facp.GetAllWithPaging(1, 1000, "Id", string.Empty);
            DataTable           myDataTable = prmtn.Tables[0];
            DataView            dv2         = myDataTable.DefaultView;

            dv2.Sort = "Title";
            ddlPromoter.DataSource     = dv2;
            ddlPromoter.DataTextField  = "Title";
            ddlPromoter.DataValueField = "Id";
            ddlPromoter.DataBind();
        }
Пример #2
0
        private void LoadData()
        {
            clsCompaniesFactory fac  = new clsCompaniesFactory();
            DataTable           comp = fac.GetAll();
            DataView            dv   = comp.DefaultView;

            dv.Sort = "Company";
            ddlCompany.DataSource     = dv;
            ddlCompany.DataTextField  = "Company";
            ddlCompany.DataValueField = "Id";
            ddlCompany.DataBind();

            clsLabelsFactory facl = new clsLabelsFactory();
            DataTable        lbl  = facl.GetAll();
            DataView         dv1  = lbl.DefaultView;

            dv1.Sort                = "Title";
            ddlLabel.DataSource     = dv1;
            ddlLabel.DataTextField  = "Title";
            ddlLabel.DataValueField = "Id";
            ddlLabel.DataBind();

            clsPromotionFactory facp        = new clsPromotionFactory();
            DataSet             prmtn       = facp.GetAllWithPaging(1, 1000, "Id", string.Empty);
            DataTable           myDataTable = prmtn.Tables[0];
            DataView            dv2         = myDataTable.DefaultView;

            dv2.Sort = "Title";
            ddlPromoter.DataSource     = dv2;
            ddlPromoter.DataTextField  = "Title";
            ddlPromoter.DataValueField = "Id";
            ddlPromoter.SelectedValue  = "11";
            ddlPromoter.DataBind();

            //List<clsGenre> GenreList = new List<clsGenre>();
            //clsSongsFactory fac2 = new clsSongsFactory();
            //List<clsSongs> Songs1 = fac2.GetAllArtists("");
            //foreach (clsSongs s in Songs1)
            //{
            //    if (!string.IsNullOrEmpty(s.GENRE))
            //    {
            //        if (!GenreList.Any(d => d.Value.Contains(s.GENRE)))// s.GENRE.ToLower() == "pop" || s.GENRE.ToLower() == "rock" || s.GENRE.ToLower() == "dance")
            //            GenreList.Add(new clsGenre { Key = s.GENRE.ToLower(), Value = s.GENRE });
            //    }
            //}
            //GenreList = GenreList.Distinct().ToList();
            //ddlGenre.DataSource = GenreList;
            //ddlGenre.DataTextField = "Value";
            //ddlGenre.DataValueField = "Key";
            //ddlGenre.DataBind();

            //List<clsLanguage> LanguageList = new List<clsLanguage>();
            //List<clsSongs> Songs2 = fac2.GetAllTitle("");
            //foreach (clsSongs s in Songs2)
            //{
            //    if (!string.IsNullOrEmpty(s.LANGUAGE))
            //    {
            //        if (s.LANGUAGE.ToLower() == "int" || s.LANGUAGE.ToLower() == "ita")
            //            LanguageList.Add(new clsLanguage { Key = s.LANGUAGE.ToLower(), Value = s.LANGUAGE });
            //    }
            //}
            //LanguageList = LanguageList.Distinct().ToList();
            //ddlLanguage.DataSource = LanguageList;
            //ddlLanguage.DataTextField = "Value";
            //ddlLanguage.DataValueField = "Key";
            //ddlLanguage.DataBind();
        }