Esempio n. 1
0
        public void LoadExistingAreasForProduct(string productid, int active)
        {
            CommonResource.Area s;
            ExistingAreas.Clear();
            ExcludedAreas.Clear();
            client = new SQSAdminServiceClient();
            client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint);
            DataSet ds = client.SQSAdmin_RelatedArea_LoadExistingAreasForProduct(productid, active);

            client.Close();

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                s = new CommonResource.Area();
                if (dr["validateinstudiom"] != null && (dr["validateinstudiom"].ToString() == "1" || dr["validateinstudiom"].ToString().ToUpper() == "TRUE"))
                {
                    s.AreaID   = int.Parse(dr["areaid"].ToString());
                    s.AreaName = dr["areaname"].ToString();
                    ExistingAreas.Add(s);
                }
                else
                {
                    s.AreaID   = int.Parse(dr["areaid"].ToString());
                    s.AreaName = dr["areaname"].ToString();
                    ExcludedAreas.Add(s);
                }
            }
        }