Пример #1
0
        protected void btnRushAction_Command(object sender, System.Web.UI.WebControls.CommandEventArgs e)
        {
            if (Page.IsValid)
            {
                ShippingOptionType shippingType = ShippingOptionType.TotalAmount;
                if (e.CommandName == "RushOrderWeight")
                {
                    shippingType = ShippingOptionType.Weight;
                }
                using (CSCommerceDataContext context = new CSCommerceDataContext(ConfigHelper.GetDBConnection()))
                {
                    CSData.ShippingOrderValue cat = new CSData.ShippingOrderValue
                    {
                        OrderTotal          = 0,
                        Cost                = 0,
                        TypeId              = (int)shippingType,
                        IncludeRushShipping = true,
                        PrefId              = DefaultSitePrefereceId
                    };


                    context.ShippingOrderValues.InsertOnSubmit(cat);
                    context.SubmitChanges();
                }

                BindAll(shippingType, true);

                //CategoryDAL.UpdateCategory(0, txtCategory.Text, true);
            }
        }
        protected void btnAction_Command(object sender, System.Web.UI.WebControls.CommandEventArgs e)
        {
            if (Page.IsValid)
            {
                ShippingOptionType shippingType = ShippingOptionType.TotalAmount;
                if (e.CommandName == "OrderWeight")
                {
                    shippingType = ShippingOptionType.Weight;
                }

                using (CSCommerceDataContext context = new CSCommerceDataContext(ConfigHelper.GetDBConnection()))
                {
                    CSData.ShippingOrderValue cat = new CSData.ShippingOrderValue
                    {
                        OrderTotal          = 0,
                        Cost                = 0,
                        TypeId              = (int)shippingType,
                        IncludeRushShipping = false,
                        PrefId              = PrefId
                    };
                    context.ShippingOrderValues.InsertOnSubmit(cat);
                    context.SubmitChanges();
                }

                BindAll(shippingType, false, PrefId);
            }
        }