예제 #1
0
        private void toolStripButton2_Click(object sender, EventArgs e)
        {
            AddEntranceStock frm = new AddEntranceStock();

            pnlMain.Controls.Clear();
            frm.ShowDialog();
        }
        private void dgwStockEntranceList_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            AddEntranceStock frmAddEntranceStock = new AddEntranceStock();
            DataGridViewRow  currentRow          = dgwStockEntranceList.Rows[e.RowIndex];

            int id = ObjectHelper.GetValueFromAnonymousType <int>(currentRow.DataBoundItem, "Id");

            frmAddEntranceStock.loadDataForEditEntranceStock(id);

            frmAddEntranceStock.CallFromUserControll = this;
            frmAddEntranceStock.ShowDialog();
        }
        private void dgwStockEntranceList_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (modeReport == 1)
            {
                DataGridViewRow currentRow = dgwStockEntranceList.Rows[e.RowIndex];
                string          RecordCode = ObjectHelper.GetValueFromAnonymousType <string>(currentRow.DataBoundItem, "RecordCode");
                string          prefix     = RecordCode.Substring(0, 2);
                switch (prefix)
                {
                case BHConstant.PREFIX_FOR_ORDER:
                {
                    OrderService orderService = new OrderService();
                    Order        order        = orderService.GetOrders().Where(o => o.OrderCode == RecordCode).FirstOrDefault();
                    if (order != null)
                    {
                        AddOrder frmAddOrder = new AddOrder();
                        frmAddOrder.loadDataForEditOrder(order.Id);

                        frmAddOrder.CallFromUserControll = this;
                        frmAddOrder.ShowDialog();
                    }
                } break;

                case BHConstant.PREFIX_FOR_ENTRANCE:
                {
                    EntranceStockService stockService = new EntranceStockService();
                    EntranceStock        stock        = stockService.GetEntranceStocks().Where(r => r.EntranceCode == RecordCode).FirstOrDefault();
                    if (stock != null)
                    {
                        AddEntranceStock frmAddEntranceStock = new AddEntranceStock();
                        frmAddEntranceStock.loadDataForEditEntranceStock(stock.Id);

                        frmAddEntranceStock.CallFromUserControll = this;
                        frmAddEntranceStock.ShowDialog();
                    }
                } break;

                case BHConstant.PREFIX_FOR_PRODUCTION:
                {
                    ProductionRequestService requestService = new ProductionRequestService();
                    ProductionRequest        request        = requestService.GetProductionRequests().Where(r => r.ReqCode == RecordCode).FirstOrDefault();
                    if (request != null)
                    {
                        AddProductionRequest addProductionRequest = new AddProductionRequest();
                        addProductionRequest.loadDataForEditProductRequest(request.Id);

                        addProductionRequest.CallFromUserControll = this;
                        addProductionRequest.ShowDialog();
                    }
                } break;
                }
            }
        }
        private void dgwStockEntranceList_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            AddEntranceStock frmAddEntranceStock = new AddEntranceStock();
            DataGridViewRow currentRow = dgwStockEntranceList.Rows[e.RowIndex];

            int id = ObjectHelper.GetValueFromAnonymousType<int>(currentRow.DataBoundItem, "Id");
            frmAddEntranceStock.loadDataForEditEntranceStock(id);

            frmAddEntranceStock.CallFromUserControll = this;
            frmAddEntranceStock.ShowDialog();
        }
 private void btnCreateNK_Click(object sender, EventArgs e)
 {
     AddEntranceStock frm = new AddEntranceStock();
     frm.ShowDialog();
     ProductAttributeService productAttrService = new ProductAttributeService();
     productAttrs = new BindingList<ProductAttributeModel>(productAttrService.GetProductAndAttribute());
     ((DataGridViewComboBoxColumn)dgwOrderDetails.Columns[0]).DataSource = productAttrs;
 }
        private void dgwStockEntranceList_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (modeReport == 1)
            {
                DataGridViewRow currentRow = dgwStockEntranceList.Rows[e.RowIndex];
                string RecordCode = ObjectHelper.GetValueFromAnonymousType<string>(currentRow.DataBoundItem, "RecordCode");
                string prefix = RecordCode.Substring(0, 2);
                switch (prefix)
                {
                    case BHConstant.PREFIX_FOR_ORDER:
                        {
                            OrderService orderService = new OrderService();
                            Order order = orderService.GetOrders().Where(o => o.OrderCode == RecordCode).FirstOrDefault();
                            if (order != null)
                            {
                                AddOrder frmAddOrder = new AddOrder();
                                frmAddOrder.loadDataForEditOrder(order.Id);

                                frmAddOrder.CallFromUserControll = this;
                                frmAddOrder.ShowDialog();
                            }
                        } break;
                    case BHConstant.PREFIX_FOR_ENTRANCE:
                        {
                            EntranceStockService stockService = new EntranceStockService();
                            EntranceStock stock = stockService.GetEntranceStocks().Where(r => r.EntranceCode == RecordCode).FirstOrDefault();
                            if (stock != null)
                            {
                                AddEntranceStock frmAddEntranceStock = new AddEntranceStock();
                                frmAddEntranceStock.loadDataForEditEntranceStock(stock.Id);

                                frmAddEntranceStock.CallFromUserControll = this;
                                frmAddEntranceStock.ShowDialog();
                            }
                        } break;
                    case BHConstant.PREFIX_FOR_PRODUCTION:
                        {
                            ProductionRequestService requestService = new ProductionRequestService();
                            ProductionRequest request = requestService.GetProductionRequests().Where(r => r.ReqCode == RecordCode).FirstOrDefault();
                            if (request != null)
                            {
                                AddProductionRequest addProductionRequest = new AddProductionRequest();
                                addProductionRequest.loadDataForEditProductRequest(request.Id);

                                addProductionRequest.CallFromUserControll = this;
                                addProductionRequest.ShowDialog();
                            }
                        } break;
                }
            }
        }
예제 #7
0
 private void toolStripButton2_Click(object sender, EventArgs e)
 {
     AddEntranceStock frm = new AddEntranceStock();
     pnlMain.Controls.Clear();
     frm.ShowDialog();
 }