Esempio n. 1
0
 private void BtnSelectItemRepo_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
 {
     try
     {
         if (ItemsGridView.GetFocusedRow() is AOQDetails item)
         {
             UnitOfWork unitOfWork = new UnitOfWork();
             po = unitOfWork.PurchaseOrdersRepo.Find(x => x.Id == po.Id);
             po.PODetails.Add(new PODetails()
             {
                 Item        = item.Item,
                 POId        = po.Id,
                 ItemNo      = item.ItemNo ?? 0,
                 Category    = item.Category ?? "",
                 Cost        = item.Cost ?? 0,
                 Quantity    = item.Quantity ?? 0,
                 TotalAmount = item.TotalAmount ?? 0,
                 UOM         = item.UOM
             });
             unitOfWork.Save();
             this.ItemsGridView.DeleteRow(ItemsGridView.FocusedRowHandle);
             frm.ItemsGridControl.DataSource = new BindingList <PODetails>(unitOfWork.PODetailsRepo.Get(x => x.POId == po.Id));
         }
         // Init();
     }
     catch (Exception exception)
     {
     }
 }
Esempio n. 2
0
        private void PhotosPage_Loaded(object sender, RoutedEventArgs args)
        {
            //var scrollViewer = ItemsGridView.GetScrollViewer();
            //if (scrollViewer == null) return;
            //scrollViewer.LayoutUpdated += (s, _) =>
            //{
            //    Debug.WriteLine(scrollViewer.VerticalOffset);
            //    //scrollViewer.ScrollableHeight == scrollViewer.VerticalOffset //到底
            //};

            //return;
            var scrollViewer = ItemsGridView.FindDescendant <ScrollViewer>();
            var scrollbars   = scrollViewer.GetDescendantsOfType <ScrollBar>().ToList();
            var verticalBar  = scrollbars.FirstOrDefault(x => x.Orientation == Orientation.Vertical);

            scrollViewer.ViewChanged += (_, e) =>
            {
                if (e.IsIntermediate)
                {
                    return;
                }
                TopAppBarButton.Visibility =
                    scrollViewer.VerticalOffset == 0 ?
                    Visibility.Collapsed :
                    Visibility.Visible;
            };
            TopAppBarButton.Click += (s, e) =>
            {
                scrollViewer.ChangeView(null, 0, null, false);
            };
            RefreshAppBarButton.Click += AppBarButton_Click;
        }
Esempio n. 3
0
 private void btnDeleteItemRepo_ButtonClick(object sender,
                                            DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
 {
     if (ItemsGridView.GetFocusedRow() is AIRDetails item)
     {
         try
         {
             if (MessageBox.Show("Do you want to delete this?", "Delete", MessageBoxButtons.YesNo,
                                 MessageBoxIcon.Question) == DialogResult.No)
             {
                 return;
             }
             UnitOfWork unitOfWork = new UnitOfWork();
             unitOfWork.AIRDetailsRepo.Delete(x => x.Id == item.Id);
             unitOfWork.Save();
             ItemsGridControl.DataSource =
                 new BindingList <AIRDetails>(
                     new UnitOfWork(false, false).AIRDetailsRepo.Get(x => x.AIReportId == item.AIReportId));
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message, ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
 }
Esempio n. 4
0
 private void ItemsGridView_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
 {
     if (ItemsGridView.GetRow(e.RowHandle) is APRDetails item)
     {
         item.TotalAmount = (item.Quantity ?? 1) * (item.Cost ?? 0);
     }
 }
        private void ItemsGridView_ItemClick(object sender, ItemClickEventArgs e)
        {
            ConnectedAnimationData.AnimationIsEnabled = enableAnimation.IsChecked.GetValueOrDefault();
            // On vérifie si on utilise la connnected animation
            if (ConnectedAnimationData.AnimationIsEnabled)
            {
                var container = ItemsGridView.ContainerFromItem(e.ClickedItem) as GridViewItem;
                if (container != null)
                {
                    var root  = (FrameworkElement)container.ContentTemplateRoot;
                    var image = (UIElement)root.FindName("ImageItem");
                    ConnectedAnimationService.GetForCurrentView().PrepareToAnimate("Image", image);
                }
            }

            var item = (Thumbnail)e.ClickedItem;

            // Add a fade out effect
            Transitions = new TransitionCollection
            {
                new ContentThemeTransition()
            };
            _navigatedUri = item.ImageUrl;
            //ConnectedAnimationData.CurrentThumbnail = item;
            Frame.Navigate(typeof(ConnectedAnimationDetail), item);
        }
Esempio n. 6
0
 private void txtSearch_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Down)
     {
         ItemsGridView.Focus();
     }
 }
        private void ItemsGridView_ItemClick(object sender, ItemClickEventArgs e)
        {
            ConnectedAnimationService.GetForCurrentView().DefaultDuration = TimeSpan.FromSeconds(0.5);

            s_persistedItemIndex = ItemsGridView.Items.IndexOf(e.ClickedItem);
            ItemsGridView.PrepareConnectedAnimation("BorderSource", e.ClickedItem, "BorderSource");

            Frame.Navigate(typeof(NavigationFlowDestinationPage), s_persistedItemIndex);
        }
Esempio n. 8
0
        private void ItemsGridView_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var item = e.AddedItems.OfType <福利>().FirstOrDefault();

            if (item != null)
            {
                ItemsGridView.ScrollIntoView(item);
            }
        }
Esempio n. 9
0
        private void AddButton_Click(object sender, EventArgs e)
        {
            AddButton.Enabled = false;
            Items.Insert(0, new Item());
            DataGridViewCell newNameCell = ItemsGridView.Rows[0].Cells["name"];

            ItemsGridView.CurrentCell = newNameCell;
            ItemsGridView.BeginEdit(true);
        }
Esempio n. 10
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. 11
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. 12
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. 13
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. 14
0
 private void BtnDeleteItemRepo_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
 {
     try
     {
         if (ItemsGridView.GetFocusedRow() is AOQDetails item)
         {
             UnitOfWork unitOfWork = new UnitOfWork();
             unitOfWork.AOQDetailsRepo.Delete(x => x.Id == item.Id);
             unitOfWork.Save();
             ItemsGridControl.DataSource =
                 new BindingList <AOQDetails>(unitOfWork.AOQDetailsRepo.Get(x => x.AOQId == item.AOQId));
         }
     }
     catch (Exception exception)
     {
     }
 }
        private void ItemsGridView_ItemClick(object sender, ItemClickEventArgs e)
        {
            var container = ItemsGridView.ContainerFromItem(e.ClickedItem) as GridViewItem;

            if (container != null)
            {
                var root  = (FrameworkElement)container.ContentTemplateRoot;
                var image = (UIElement)root.FindName("Image");

                ConnectedAnimationService.GetForCurrentView().PrepareToAnimate("Image", image);
            }

            var item = (Thumbnail)e.ClickedItem;

            // Add a fade out effect
            Transitions = new TransitionCollection();
            Transitions.Add(new ContentThemeTransition());

            Frame.Navigate(typeof(ConnectedAnimationDetail), _navigatedUri = item.ImageUrl);
        }
        private void enableImplicitAnimation_Checked(object sender, RoutedEventArgs e)
        {
            if (ItemsGridView != null)
            {
                foreach (var item in ItemsGridView.Items)
                {
                    var container     = ItemsGridView.ContainerFromItem(item) as GridViewItem;
                    var elementVisual = ElementCompositionPreview.GetElementVisual(container);

                    if (enableImplicitAnimation.IsChecked.GetValueOrDefault())
                    {
                        elementVisual.ImplicitAnimations = _elementImplicitAnimation;
                    }
                    else
                    {
                        elementVisual.ImplicitAnimations = null;
                    }
                }
            }
        }
Esempio n. 17
0
    protected void btnYes_Click(object sender, EventArgs e)
    {
        try
        {
            //ItemsGridView.DeleteRow(ItemsGridView.SelectedIndex);
            GridDataItem item = (GridDataItem)ItemsGridView.SelectedItems[0];
            //JC_ID,BOM_ID
            string jc_id  = item.GetDataKeyValue("JC_ID").ToString();
            string bom_id = item.GetDataKeyValue("SPL_ID").ToString();

            dsErectionTableAdapters.VIEW_SITE_JC_SPLTableAdapter rec = new VIEW_SITE_JC_SPLTableAdapter();
            rec.DeleteQuery(decimal.Parse(jc_id), decimal.Parse(bom_id));
            Master.ShowMessage("Spool deleted");
            ItemsGridView.Rebind();
        }
        catch (Exception ex)
        {
            Master.ShowWarn(ex.Message);
        }
    }
Esempio n. 18
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. 19
0
 private void btnDeleteItemRepo_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
 {
     try
     {
         UnitOfWork unitOfWork = new UnitOfWork();
         if (ItemsGridView.GetFocusedRow() is PISDetails item)
         {
             if (MessageBox.Show("Do you want to delete this?", "Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
             {
                 return;
             }
             unitOfWork.PISDetailsRepo.Delete(x => x.Id == item.Id);
             unitOfWork.Save();
             this.ItemsGridControl.DataSource =
                 new BindingList <PISDetails>(unitOfWork.PISDetailsRepo.Get(x => x.PISId == item.PISId));
         }
     }
     catch (Exception exception)
     {
     }
 }
Esempio n. 20
0
 private void btnDeleteItemRepo_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
 {
     if (ItemsGridView.GetFocusedRow() is APRDetails item)
     {
         if (MessageBox.Show("Do you want to delete this?", "Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
         {
             return;
         }
         UnitOfWork unitOfWork = new UnitOfWork();
         unitOfWork.APRDetailsRepo.Delete(x => x.Id == item.Id);
         unitOfWork.Save();
         var counter = 1;
         foreach (var i in unitOfWork.APRDetailsRepo.Get(x => x.APRId == this.aPRs.Id))
         {
             i.ItemNo = counter;
             counter++;
         }
         unitOfWork.Save();
         ItemsGridControl.DataSource =
             new BindingList <APRDetails>(unitOfWork.APRDetailsRepo.Get(x => x.APRId == this.aPRs.Id));
     }
 }
Esempio n. 21
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();
        }
    }
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     base.OnNavigatedTo(e);
     if (e.NavigationMode == NavigationMode.Back)
     {
         ItemsGridView.Loaded += async(o_, e_) =>
         {
             var connectedAnimation = ConnectedAnimationService
                                      .GetForCurrentView()
                                      .GetAnimation("BorderDest");
             if (connectedAnimation != null)
             {
                 var item = ItemsGridView.Items[s_persistedItemIndex];
                 ItemsGridView.ScrollIntoView(item);
                 await ItemsGridView.TryStartConnectedAnimationAsync(
                     connectedAnimation,
                     item,
                     "BorderSource"
                     );
             }
         };
     }
 }
 /// <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());
             }
         }
     }
 }
        private void ItemsGridView_Loaded(object sender, RoutedEventArgs e)
        {
            if (_navigatedUri != null)
            {
                // May be able to perform backwards Connected Animation
                var animation = ConnectedAnimationService.GetForCurrentView().GetAnimation("Image");
                if (animation != null)
                {
                    var item = Model.Items.Where(compare => compare.ImageUrl == _navigatedUri).First();

                    ItemsGridView.ScrollIntoView(item, ScrollIntoViewAlignment.Default);
                    ItemsGridView.UpdateLayout();

                    var container = ItemsGridView.ContainerFromItem(item) as GridViewItem;
                    if (container != null)
                    {
                        var root  = (FrameworkElement)container.ContentTemplateRoot;
                        var image = (Image)root.FindName("Image");

                        // Wait for image opened. In future Insider Preview releases, this won't be necessary.
                        image.Opacity      = 0;
                        image.ImageOpened += (sender_, e_) =>
                        {
                            image.Opacity = 1;
                            animation.TryStart(image);
                        };
                    }
                    else
                    {
                        animation.Cancel();
                    }
                }

                _navigatedUri = null;
            }
        }
        private async void ItemsGridView_Loaded(object sender, RoutedEventArgs e)
        {
            if (ConnectedAnimationData.AnimationIsEnabled)
            {
                if (_navigatedUri != null)
                {
                    //récupération de l'animation
                    var animation = ConnectedAnimationService.GetForCurrentView().GetAnimation("Image");
                    if (animation != null)
                    {
                        var item = ViewModel.Items.First(compare => compare.ImageUrl == _navigatedUri);

                        //on scroll vers l'item
                        ItemsGridView.ScrollIntoView(item, ScrollIntoViewAlignment.Default);

                        await Task.Yield();

                        var container = ItemsGridView.ContainerFromItem(item) as GridViewItem;
                        if (container != null)
                        {
                            var root  = (FrameworkElement)container.ContentTemplateRoot;
                            var image = (Image)root.FindName("ImageItem");
                            image.Opacity = 1;
                            //on lance l'animation
                            animation.TryStart(image);
                        }
                        else
                        {
                            animation.Cancel();
                        }
                    }

                    _navigatedUri = null;
                }
            }
        }
Esempio n. 26
0
 private string formatItem(ItemsGridView itm)
 {
     return(itm.Sku + " " + itm.SeasonID + " " +
            itm.ColorID + " " + itm.Color2ID + " " + itm.Color3ID + " " + itm.SizeType +
            " " + itm.SizeVal + " " + itm.StyleType + " " + itm.Design + " " + itm.Price);
 }
Esempio n. 27
0
 public void LoadItems()
 {
     ItemsGridView.DataSource = _ItemRepository.GetAllItems();
     ItemsGridView.DataBind();
 }
Esempio n. 28
0
 private void BindItems()
 {
     ItemsGridView.DataSource = objectDataSource;
     ItemsGridView.DataBind();
 }