Esempio n. 1
0
        private void LoadOrder()
        {
            if (CurrentOrder != null)
            {
                lblOrderNumber.Text     = "Order " + CurrentOrder.OrderNumber + " ";
                lblShippingAddress.Text = CurrentOrder.ShippingAddress.ToHtmlString();
                lblShippingTotal.Text   = CurrentOrder.TotalShippingAfterDiscounts.ToString("c");

                ItemsGridView.DataSource = CurrentOrder.Items;
                ItemsGridView.DataBind();

                if (!CurrentOrder.Items.Any())
                {
                    pnlShip.Visible = false;
                }

                var packages = CurrentOrder.FindShippedPackages();
                packages.ForEach(p => { p.ShipDateUtc = DateHelper.ConvertUtcToStoreTime(HccApp, p.ShipDateUtc); });
                PackagesGridView.DataSource = packages;
                PackagesGridView.DataBind();

                if (packages == null || !packages.Any())
                {
                    hPackage.Visible = false;
                }
                else
                {
                    hPackage.Visible = true;
                }

                lblUserSelectedShippingMethod.Text = "User Selected Shipping Method: <strong>" +
                                                     CurrentOrder.ShippingMethodDisplayName + "</strong>";
                if (lstTrackingProvider.Items.FindByValue(CurrentOrder.ShippingMethodId) != null)
                {
                    lstTrackingProvider.ClearSelection();
                    lstTrackingProvider.Items.FindByValue(CurrentOrder.ShippingMethodId).Selected = true;
                    lstTrackingProvider.SelectedValue = CurrentOrder.ShippingMethodId;
                }

                ShippingProviderServices();
                if (lstTrackingProviderServices.Items.FindByValue(CurrentOrder.ShippingProviderServiceCode) != null)
                {
                    lstTrackingProviderServices.ClearSelection();
                    lstTrackingProviderServices.Items.FindByValue(CurrentOrder.ShippingProviderServiceCode).Selected =
                        true;
                    lstTrackingProviderServices.SelectedValue = CurrentOrder.ShippingProviderServiceCode;
                }

                CheckShippedQty(CurrentOrder.Items);
            }
            else
            {
                pnlShip.Visible = false;
            }
        }
Esempio n. 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string Cat  = "";
        string Size = "";
        string Var  = "";
        NameValueCollection coll = Request.QueryString;

        if (coll["Cat"] != null && coll["Cat"].ToString().Length > 0)
        {
            Cat             = coll["Cat"].ToString().Replace("?", "_");
            CatTextBox.Text = coll["Cat"].ToString();
        }
        if (coll["Size"] != null && coll["Size"].ToString().Length > 0)
        {
            Size             = coll["Size"].ToString().Replace("?", "_");
            SizeTextBox.Text = coll["Size"].ToString();
        }
        if (coll["Var"] != null && coll["Var"].ToString().Length > 0)
        {
            Var             = coll["Var"].ToString().Replace("?", "_");
            VarTextBox.Text = coll["Var"].ToString();
        }
        // get the items.
        ds = SqlHelper.ExecuteDataset(connectionString, "pSSSearchItems",
                                      new SqlParameter("@SearchCat", Cat),
                                      new SqlParameter("@SearchSize", Size),
                                      new SqlParameter("@SearchVar", Var));
        if (ds.Tables.Count >= 1)
        {
            if (ds.Tables.Count == 1)
            {
                // We only go one table back, something is wrong
                dt = ds.Tables[0];
                if (dt.Rows.Count > 0)
                {
                    ShowPageMessage("Item not found.", 2);
                }
            }
            else
            {
                dt = ds.Tables[1];
                if (dt.Rows.Count == 0)
                {
                    ShowPageMessage("No Items found.", 2);
                }
                else
                {
                    ItemsGridView.DataSource = dt;
                    ItemsGridView.DataBind();
                    ShowPageMessage(dt.Rows.Count.ToString() + " Items found. Maximum is 500", 0);
                }
            }
        }
    }
Esempio n. 3
0
 public void LoadItem()
 {
     try
     {
         int    Id   = Convert.ToInt32(CategoriesDropDownList.SelectedValue);
         string size = SizeDropDownList.SelectedItem.ToString();
         ItemsGridView.DataSource = _ItemRepository.GetAllItems(Id, size);
         ItemsGridView.DataBind();
     }
     catch { }
 }
Esempio n. 4
0
 public void GetItem(string Cat)
 {
     try
     {
         string Size = ddlDiameter.SelectedValue + ddlLength.SelectedValue;
         //string Var = ddlPackage.SelectedItem.Value + ddlPlating.SelectedItem.Value;
         if (Size.Length < 4)
         {
             Size += "__";
         }
         // get the items.
         string Var = "___";
         BuiltItem.Text = Cat + "-" + Size + "-" + Var;
         ds             = SqlHelper.ExecuteDataset(connectionString, "pSSSearchItems",
                                                   new SqlParameter("@SearchCat", Cat),
                                                   new SqlParameter("@SearchSize", Size),
                                                   new SqlParameter("@SearchVar", Var));
         if (ds.Tables.Count >= 1)
         {
             if (ds.Tables.Count == 1)
             {
                 // We only go one table back, something is wrong
                 dt = ds.Tables[0];
                 if (dt.Rows.Count > 0)
                 {
                     ShowPageMessage("Item not found.", 2);
                 }
             }
             else
             {
                 dt = ds.Tables[1];
                 if (dt.Rows.Count == 0)
                 {
                     ShowPageMessage("No Items found.", 2);
                 }
                 else
                 {
                     ItemsGridView.DataSource = dt;
                     ItemsGridView.DataBind();
                     ItemsUpdatePanel.Update();
                     ShowPageMessage(dt.Rows.Count.ToString() + " Items found. Maximum is 500", 0);
                 }
             }
         }
     }
     catch (Exception ex)
     { //return "";
     }
 }
Esempio n. 5
0
    protected void btnAddSpool_Click(object sender, EventArgs e)
    {
        VIEW_SITE_JC_SPLTableAdapter jc_items = new VIEW_SITE_JC_SPLTableAdapter();

        try
        {
            jc_items.InsertQuery(decimal.Parse(Request.QueryString["JC_ID"]),
                                 decimal.Parse(cboNewSpool.SelectedValue),
                                 string.Empty, string.Empty, string.Empty);
            ItemsGridView.DataBind();
            Master.ShowMessage("Spool added.");
        }
        catch (Exception ex)
        {
            Master.ShowWarn(ex.Message);
        }
        finally
        {
            jc_items.Dispose();
        }
    }
Esempio n. 6
0
    protected void btnAddSpool_Click(object sender, EventArgs e)
    {
        Decimal spl_pkl_id = decimal.Parse(Request.QueryString["SPL_PICKLING_ID"]);
        VIEW_ADAPTER_PKLNG_SPL_DETAILTableAdapter pnt_items = new VIEW_ADAPTER_PKLNG_SPL_DETAILTableAdapter();

        try
        {
            foreach (RadComboBoxItem item in cboNewSpool.CheckedItems)
            {
                pnt_items.InsertQuery(spl_pkl_id, Decimal.Parse(item.Value), null);
            }
            ItemsGridView.DataBind();
            Master.ShowMessage("Spool added.");
        }
        catch (Exception ex)
        {
            Master.ShowWarn(ex.Message);
        }
        finally
        {
            pnt_items.Dispose();
        }
    }
 /// <summary>
 /// we check if this page was loaded before
 /// we call the method from out database to parse the data from files
 /// we set default value of the pricebox to zero and select the data from the Goods
 /// after that we go through the List and set data to the new list with structure for out table
 /// after that we set values to our dropdownlists
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (ReadData())
         {
             priceBox.Text            = "0";
             ItemsGridView.DataSource = Goods.Values;
             var deliveryInfo = new List <DeliveryInfo>();
             var ids          = new SortedSet <int>();
             foreach (var deliver in Deliveries)
             {
                 deliveryInfo.Add(new DeliveryInfo
                 {
                     Id             = deliver.Id,
                     Date           = deliver.Date,
                     Name           = deliver.Name,
                     SizeDeliveries = deliver.SizeDeliveries,
                     Price          = deliver.Price,
                 });
                 ids.Add(deliver.Id);
             }
             DeliveriesGridView.DataSource = deliveryInfo;
             ItemsGridView.DataBind();
             DeliveriesGridView.DataBind();
             idDropDownList.Items.Clear();
             foreach (var selected in ids)
             {
                 idDropDownList.Items.Add(selected.ToString());
             }
             foreach (var name in Goods)
             {
                 NameDropDownList.Items.Add(name.Value.Name.ToString());
             }
         }
     }
 }
Esempio n. 8
0
 private void BindItems()
 {
     ItemsGridView.DataSource = objectDataSource;
     ItemsGridView.DataBind();
 }
Esempio n. 9
0
 public void LoadItems()
 {
     ItemsGridView.DataSource = _ItemRepository.GetAllItems();
     ItemsGridView.DataBind();
 }