Exemplo n.º 1
0
        void SaveLocationQuantity(int productID)
        {
            try
            {
                foreach (DataGridViewRow row in dgvLocation.Rows)
                {
                    if (row.IsNewRow)
                    {
                        continue;
                    }

                    int locID = ((DataGridViewComboBoxCell)row.Cells[0]).Value.ToInt();
                    int qty   = row.Cells[1].Value.ToInt();

                    _prodLoc.Add(new ProductLocation {
                        LocationID = locID, ProductID = productID, Quantity = qty
                    });
                }
            }
            catch (Exception ex)
            {
                _logger.LogError(ex, OperationStatus.FAILURE, "ucNewProduct", "SaveLocationQuantity");
                Helper.ShowMessage(OperationStatus.FAILURE + "\n" + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }