public void LoadBrand(int stateid)
        {
            SQSBrand.Clear();
            SQSBrandWithAll.Clear();
            ItemsBrand         = new Dictionary <string, object>();
            SelectedItemsBrand = new Dictionary <string, object>();
            Brand b = new Brand();

            b.BrandID   = 0;
            b.BrandName = "All";
            SQSBrandWithAll.Add(b);

            client = new SQSAdminServiceClient();
            client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint);
            DataSet ds = client.SQSAdmin_Generic_GetBrandByState(stateid);

            client.Close();
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                b           = new Brand();
                b.BrandID   = int.Parse(dr["brandid"].ToString());
                b.BrandName = dr["brandname"].ToString();
                SQSBrand.Add(b);
                SQSBrandWithAll.Add(b);
                ItemsBrand.Add(b.BrandName, b.BrandID);
            }
        }
Beispiel #2
0
        public void LoadBrand(int stateid, string dropdownname)
        {
            if (dropdownname.ToUpper() == "CMBSTATE")
            {
                SQSBrand.Clear();
            }
            else if (dropdownname.ToUpper() == "CMBSTATE2")
            {
                SQSBrand2.Clear();
            }
            else if (dropdownname.ToUpper() == "CMBSTATE3")
            {
                SQSBrand3.Clear();
            }
            client = new SQSAdminServiceClient();
            client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint);
            DataSet ds = client.SQSAdmin_Generic_GetBrandByState(stateid);

            client.Close();
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                CommonResource.Brand b = new CommonResource.Brand();
                b.BrandID   = int.Parse(dr["brandid"].ToString());
                b.BrandName = dr["brandname"].ToString();
                if (dropdownname.ToUpper() == "CMBSTATE")
                {
                    SQSBrand.Add(b);
                }
                else if (dropdownname.ToUpper() == "CMBSTATE2")
                {
                    SQSBrand2.Add(b);
                }
                else if (dropdownname.ToUpper() == "CMBSTATE3")
                {
                    SQSBrand3.Add(b);
                }
            }
        }