Ejemplo n.º 1
0
        private void ShowInOut(InOrOut inOrOut)
        {
            if (listViewItem.SelectedItems.Count >= 1)
            {
                ItemService            itemService            = new ItemService(_context);
                DRService              drService              = new DRService(_context);
                HistoryService         historyService         = new HistoryService(_context);
                ReturnedHistoryService returnedHistoryService = new ReturnedHistoryService(_context);

                InOutService inOutService = new InOutService(itemService, historyService
                                                             , drService, returnedHistoryService);

                long itemId       = Convert.ToInt64(listViewItem.SelectedItems[0].SubItems[0].Text);
                Item selectedItem = _items.FirstOrDefault(i => i.Id == itemId);

                InOutWithOutDRForm f = new InOutWithOutDRForm(itemService, inOutService,
                                                              inOrOut, selectedItem, _name);

                f.ShowDialog();
                if (f.HaveChangedQuantity)
                {
                    SearchItem();
                }
            }
            else
            {
                MessageBox.Show("Please select Item from the list", "",
                                MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Ejemplo n.º 2
0
        private void DisplayItems(InOrOut inOut)
        {
            IXLWorksheet tempSheet = inOut == InOrOut.In ? _inSheet : _outSheet;

            foreach (var item in _dto.Records)
            {
                double qty = inOut == InOrOut.In ? item.In : item.Out;

                if (HasInOutHistory(qty))
                {
                    IncrementRowIndex(inOut, 2);

                    var id = tempSheet.Cell(GetAppopriateRowIndex(inOut), 1);
                    id.Value = item.Id;

                    var itemDesc = tempSheet.Cell(GetAppopriateRowIndex(inOut), 2);
                    itemDesc.Value = item.ItemName;

                    var total = tempSheet.Cell(GetAppopriateRowIndex(inOut), 3);
                    total.Value = qty;

                    List <string> notes = inOut == InOrOut.In ? item.NotesForIn : item.NotesForOut;

                    foreach (var n in notes)
                    {
                        IncrementRowIndex(inOut, 1);

                        var comment = tempSheet.Cell(GetAppopriateRowIndex(inOut), 4);
                        comment.Value = n;
                    }
                }
            }
        }
Ejemplo n.º 3
0
        private void DisplayColumns(InOrOut inOut)
        {
            IXLWorksheet tempSheet = inOut == InOrOut.In ? _inSheet : _outSheet;

            var idColumn = tempSheet.Cell(1, 1);

            idColumn.Value = "ID";
            idColumn.Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
            idColumn.Style.Font.Bold            = true;

            var itemNameColumn = tempSheet.Cell(1, 2);

            itemNameColumn.Value = "Item Desc";
            itemNameColumn.Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
            itemNameColumn.Style.Font.Bold            = true;

            var totalColumn = tempSheet.Cell(1, 3);

            totalColumn.Value = "Total";
            totalColumn.Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
            totalColumn.Style.Font.Bold            = true;

            var commentsColumn = tempSheet.Cell(1, 4);

            commentsColumn.Value = "Comments";
            commentsColumn.Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Center;
            commentsColumn.Style.Font.Bold            = true;
        }
Ejemplo n.º 4
0
 public virtual void FadeInAnimation(bool dontDestroy = true)
 {
     AnimationRunning = true;
     InOrOutMovement  = InOrOut.IN;
     FadeInBackground();
     FadeInContent();
     DontDestroyAfterAnim = dontDestroy;
 }
Ejemplo n.º 5
0
 public InOutWithOutDRForm(ItemService itemService, InOutService inOutService,
                           InOrOut inOrOut, Item selectedItem, string name)
 {
     _itemService  = itemService;
     _inOutService = inOutService;
     _inOrOut      = inOrOut;
     _item         = selectedItem;
     _name         = name;
     InitializeComponent();
 }
Ejemplo n.º 6
0
 private void IncrementRowIndex(InOrOut inOut, int incrementBy)
 {
     if (inOut == InOrOut.In)
     {
         _inRowIndex = _inRowIndex + incrementBy;
     }
     else if (inOut == InOrOut.Out)
     {
         _outRowIndex = _outRowIndex + incrementBy;
     }
 }
Ejemplo n.º 7
0
        private int GetAppopriateRowIndex(InOrOut inOut)
        {
            int rowIndex = 0;

            if (inOut == InOrOut.In)
            {
                rowIndex = _inRowIndex;
            }
            else if (inOut == InOrOut.Out)
            {
                rowIndex = _outRowIndex;
            }

            return(rowIndex);
        }
Ejemplo n.º 8
0
 private void SetAutoAdjustColumnToContent(InOrOut inOut)
 {
     if (inOut == InOrOut.In)
     {
         _inSheet.Column(1).AdjustToContents();
         _inSheet.Column(2).AdjustToContents();
         _inSheet.Column(3).AdjustToContents();
         _inSheet.Column(4).AdjustToContents();
     }
     else if (inOut == InOrOut.Out)
     {
         _outSheet.Column(1).AdjustToContents();
         _outSheet.Column(2).AdjustToContents();
         _outSheet.Column(3).AdjustToContents();
         _outSheet.Column(4).AdjustToContents();
     }
 }
Ejemplo n.º 9
0
    void OnTriggerExit(Collider other)
    {
        var layerName = LayerMask.LayerToName(other.gameObject.layer);

        //Debug.Log(other.name);
        if (layerName == "Player_Pack")
        {
            if (inOrOut == InOrOut.OUT)
            {
                inOrOut = InOrOut.IN;
                exit.OnNext(inOrOut);
            }
            else
            {
                inOrOut = InOrOut.OUT;
                exit.OnNext(inOrOut);
            }
        }
    }
Ejemplo n.º 10
0
 public void AddEdge(Edge edge, InOrOut direction)
 {
     if (direction == InOrOut.IN)
     {
         inEdges.Add(edge);
         ++inDegree;
         ++edgeCount;
         Edge.count++;
     }
     else
     {
         outEdges.Add(edge);
         ++outDegree;
         ++edgeCount;
         Edge.count++;
     }
     if (EdgeAdded != null)
     {
         EdgeAdded();
     }
 }
Ejemplo n.º 11
0
 private void CreateSheetForOut()
 {
     _sheetForOut  = _wb.Worksheets.Add("Weekly Out");
     _currentSheet = InOrOut.Out;
     CreateSheet();
 }
Ejemplo n.º 12
0
 private void CreateSheetForIn()
 {
     _sheetForIn   = _wb.Worksheets.Add("Weekly In");
     _currentSheet = InOrOut.In;
     CreateSheet();
 }