コード例 #1
0
 public void RemoveValidationRule(GenericProduct p, bool promotion, bool update = false, bool active = true)
 {
     client = new SQSAdminServiceClient();
     client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint);
     client.SQSAdmin_StandardInclusion_RemoveValidationRule(p.validationruleID, update, active);
     client.Close();
     if (promotion && !update)
     {
         PromotionProducts.Remove(p);
     }
     else
     {
         UpgradeOptionProducts.Remove(p);
     }
 }
コード例 #2
0
        public void GetUpgradeForStandardInclusion(string productid, string pbrandids)
        {
            DateTime dateValue = (DateTime)System.Data.SqlTypes.SqlDateTime.MinValue;

            client = new SQSAdminServiceClient();
            client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint);
            DataSet ds = client.SQSAdmin_StandardInclusion_GetUpgradeOptionByStandardInclusion(productid, pbrandids);

            client.Close();
            UpgradeOptionProducts.Clear();
            PromotionProducts.Clear();
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                GenericProduct p = new GenericProduct();
                p.BrandID            = int.Parse(dr["brandid"].ToString());
                p.BrandName          = dr["brandname"].ToString();
                p.ProductID          = dr["productid"].ToString();
                p.ProductName        = dr["productname"].ToString();
                p.ProductDescription = dr["productdescription"].ToString();
                p.validationruleID   = int.Parse(dr["idStudioM_Inclusionvalidationrule"].ToString());
                p.Promotion          = bool.Parse(dr["Promotion"].ToString());
                DateTime.TryParse(dr["EffectiveDate"].ToString(), out dateValue);
                if (dateValue != (DateTime)System.Data.SqlTypes.SqlDateTime.MinValue)
                {
                    p.EffectiveDate = dateValue.AddHours(3);
                }
                p.Active = bool.Parse(dr["active"].ToString());
                if (p.Promotion)
                {
                    PromotionProducts.Add(p);
                }
                else if (p.Active)
                {
                    // upgrade products show only the active items
                    UpgradeOptionProducts.Add(p);
                }
            }
        }
コード例 #3
0
        public void GetStandardInclusion(string productid, string productname, int pstateid, string brandids)
        {
            client = new SQSAdminServiceClient();
            client.Endpoint.Address = new System.ServiceModel.EndpointAddress(CommonVariables.WcfEndpoint);
            DataSet ds = client.SQSAdmin_StandardInclusion_GetStandardInclusionProducts(productid, productname, pstateid, brandids);

            client.Close();
            StandarInclusionProducts.Clear();
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                GenericProduct p = new GenericProduct();
                p.BrandID            = int.Parse(dr["BrandID"].ToString());
                p.BrandName          = dr["BrandName"].ToString();
                p.ProductID          = dr["productid"].ToString();
                p.ProductName        = dr["productname"].ToString();
                p.ProductDescription = dr["productdescription"].ToString();
                p.validationruleID   = 0;

                StandarInclusionProducts.Add(p);
            }
            UpgradeOptionProducts.Clear();
            PromotionProducts.Clear();
        }