예제 #1
0
        public void LoadSuppliers(int stateid, string suppliername, int active)
        {
            int tempsize;

            StudioMSupplier.Clear();
            _tempsupplier.Clear();
            client = new SQSAdminServiceClient();
            client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint);
            DataSet ds = client.SQSAdmin_StudioM_GetSuppliers(stateid, suppliername, active);

            client.Close();
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                Supplier b = new Supplier();
                b.SupplierID   = int.Parse(dr["idstudiomsupplier"].ToString());
                b.SupplierName = dr["suppliername"].ToString();
                b.Active       = bool.Parse(dr["active"].ToString());
                b.StateID      = int.Parse(dr["fkidstate"].ToString());
                b.StateName    = dr["statename"].ToString();
                StudioMSupplier.Add(b);
                _tempsupplier.Add(b);
            }
            if (ds.Tables[0].Rows.Count > pagesize)
            {
                tempsize = pagesize;
            }
            else
            {
                tempsize = ds.Tables[0].Rows.Count;
            }
            StudioMSupplier2 = new PagingCollectionView(_tempsupplier, tempsize);
        }
예제 #2
0
        public void LoadSuppliers()
        {
            StudioMSupplier.Clear();
            client = new SQSAdminServiceClient();
            client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint);
            DataSet ds = client.SQSAdmin_StudioM_GetSuppliers(stateid, "", 1);

            client.Close();
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                Supplier b = new Supplier();
                b.SupplierID   = int.Parse(dr["idstudiomsupplier"].ToString());
                b.SupplierName = dr["suppliername"].ToString();
                StudioMSupplier.Add(b);
            }
        }