コード例 #1
0
        public void SearchAvailableProducts(int stateid, string productid, string productname)
        {
            client = new SQSAdminServiceClient();
            client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint);
            DataSet ds = client.SQSAdmin_StudioM_GetStudioMProduct(stateid, productid, productname);

            AvailableProduct.Clear();
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                Product p = new Product();
                p.ProductID   = dr["productid"].ToString();
                p.ProductName = dr["productname"].ToString();
                //p.ProductDescription = dr["productdescription"].ToString();
                bool exists = false;
                foreach (Product prod in SelectedProduct)
                {
                    if (p.ProductID == prod.ProductID)
                    {
                        exists = true;
                        break;
                    }
                }
                if (!exists)
                {
                    AvailableProduct.Add(p);
                }
            }
        }