コード例 #1
0
        // Shipping Method Is
        private void LoadShippingMethodIsEditor(ShippingMethodIs q)
        {
            List <ShippingMethod> available = MyPage.MTApp.OrderServices.ShippingMethods.FindAll(MyPage.MTApp.CurrentStore.Id);

            List <FriendlyBvinDisplay> displayData = new List <FriendlyBvinDisplay>();

            foreach (string itemid in q.ItemIds())
            {
                FriendlyBvinDisplay item = new FriendlyBvinDisplay();
                item.bvin        = itemid;
                item.DisplayName = itemid;

                var t = available.Where(y => y.Bvin == itemid).FirstOrDefault();
                if (t != null)
                {
                    item.DisplayName = t.Name;
                    available.Remove(t);
                }
                displayData.Add(item);
            }

            this.lstShippingMethodIs.Items.Clear();
            this.lstShippingMethodIs.DataSource     = available;
            this.lstShippingMethodIs.DataTextField  = "Name";
            this.lstShippingMethodIs.DataValueField = "Bvin";
            this.lstShippingMethodIs.DataBind();

            this.gvShippingMethodIs.DataSource = displayData;
            this.gvShippingMethodIs.DataBind();
        }
コード例 #2
0
        protected void btnAddShippingMethodIs_Click(object sender, ImageClickEventArgs e)
        {
            Promotion        p = GetCurrentPromotion();
            ShippingMethodIs q = (ShippingMethodIs)GetCurrentQualification(p);

            if (q == null)
            {
                return;
            }
            q.AddItemId(this.lstShippingMethodIs.SelectedValue);
            MyPage.MTApp.MarketingServices.Promotions.Update(p);
            LoadShippingMethodIsEditor(q);
        }
コード例 #3
0
        protected void gvShippingMethodIs_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            Promotion        p = GetCurrentPromotion();
            ShippingMethodIs q = (ShippingMethodIs)GetCurrentQualification(p);

            if (q == null)
            {
                return;
            }
            string bvin = (string)e.Keys[0];

            q.RemoveItemId(bvin);
            MyPage.MTApp.MarketingServices.Promotions.Update(p);
            LoadShippingMethodIsEditor(q);
        }