Example #1
0
        private void tsbAddOrder_Click(object sender, EventArgs e)
        {
            AddOrder frmAddOrder = new AddOrder();

            pnlMain.Controls.Clear();
            try
            {
                frmAddOrder.ShowDialog();
            }
            catch { }
        }
        private void dgwOrderList_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            AddOrder        frmAddOrder = new AddOrder();
            DataGridViewRow currentRow  = dgwOrderList.Rows[e.RowIndex];

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

            frmAddOrder.loadDataForEditOrder(id);

            frmAddOrder.CallFromUserControll = this;
            frmAddOrder.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;
                }
            }
        }
Example #4
0
        private void dgwEmployeeCommissionList_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            DataGridViewRow currentRow   = dgwEmployeeCommissionList.Rows[e.RowIndex];
            string          RecordCode   = ObjectHelper.GetValueFromAnonymousType <string>(currentRow.DataBoundItem, "RecordCode");
            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();
            }
        }
Example #5
0
        private void dgwStockEntranceList_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            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_BILLING:
            {
                BillService billService = new BillService();
                Bill        bill        = billService.GetBills().Where(b => b.BillCode == RecordCode).FirstOrDefault();
                if (bill != null)
                {
                    AddBill frmAddBill = new AddBill();
                    frmAddBill.loadDataForEditBill(bill.Id);

                    frmAddBill.CallFromUserControll = this;
                    frmAddBill.ShowDialog();
                }
            } break;
            }
        }
        private void dgwOrderList_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            AddOrder frmAddOrder = new AddOrder();
            DataGridViewRow currentRow = dgwOrderList.Rows[e.RowIndex];

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

            frmAddOrder.CallFromUserControll = this;
            frmAddOrder.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 dgwEmployeeCommissionList_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            DataGridViewRow currentRow = dgwEmployeeCommissionList.Rows[e.RowIndex];
            string RecordCode = ObjectHelper.GetValueFromAnonymousType<string>(currentRow.DataBoundItem, "RecordCode");
            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();
            }
        }
 private void tsbAddOrder_Click(object sender, EventArgs e)
 {
     AddOrder frmAddOrder = new AddOrder();
     pnlMain.Controls.Clear();
     try
     {
         frmAddOrder.ShowDialog();
     }
     catch { }
 }
        private void dgwStockEntranceList_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            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_BILLING:
                    {
                        BillService billService = new BillService();
                        Bill bill = billService.GetBills().Where(b => b.BillCode == RecordCode).FirstOrDefault();
                        if (bill != null)
                        {
                            AddBill frmAddBill = new AddBill();
                            frmAddBill.loadDataForEditBill(bill.Id);

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