Exemplo n.º 1
0
        private void dgwBillingList_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            AddBill         frmAddBill = new AddBill();
            DataGridViewRow currentRow = dgwBillingList.Rows[e.RowIndex];

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

            frmAddBill.loadDataForEditBill(id);

            frmAddBill.CallFromUserControll = this;
            frmAddBill.ShowDialog();
        }
Exemplo n.º 2
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 dgwBillingList_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            AddBill frmAddBill = new AddBill();
            DataGridViewRow currentRow = dgwBillingList.Rows[e.RowIndex];

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

            frmAddBill.CallFromUserControll = this;
            frmAddBill.ShowDialog();
        }
        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;
            }
        }