Пример #1
0
 private void viewPurchaseOrder(object sender, EventArgs e)
 {
     if (ID != 0)
     {
         PurchaseReceiptOrderForm purchaseOrderForm = new PurchaseReceiptOrderForm();
         purchaseOrderForm.PurchaseReceiveOrderId = ID;
         purchaseOrderForm.ShowDialog();
     }
 }
        private void grvProductInOutDetail_CellEnter(object sender, DataGridViewCellEventArgs e)
        {
            int id = 0;

            if (!int.TryParse(grvProductInOutDetail.CurrentRow.Cells[Constant.ProductSearch.ProductInOutDetailGridColumnName.ID].Value.ToString(), out id))
            {
                return;
            }
            //string action = grvProductInOutDetail.CurrentRow.Cells[Constant.ProductSearch.ProductInOutDetailGridColumnName.ACTION].Value.ToString();
            string inOutTypeCode = grvProductInOutDetail.CurrentRow.Cells[Constant.ProductSearch.ProductInOutDetailGridColumnName.IN_OUT_TYPE_CODE].Value.ToString().Trim();

            if (inOutTypeCode == Constant.OutputType.XBH || inOutTypeCode == Constant.OutputType.XTH)
            {
                PurchaseReceiptOrderForm purchaseOrderForm = new PurchaseReceiptOrderForm();
                purchaseOrderForm.PurchaseReceiveOrderId = id;
                purchaseOrderForm.ShowDialog();
                return;
            }

            if (inOutTypeCode == Constant.OutputType.XCK)
            {
                PurchaseReceiptOrderForm purchaseOrderForm = new PurchaseReceiptOrderForm();
                purchaseOrderForm.ProductTransOrderId = id;
                purchaseOrderForm.ShowDialog();
                return;
            }

            if (inOutTypeCode == Constant.InputType.NH)
            {
                productInputForm productInputForm = new productInputForm();
                productInputForm.ProductInputOrderId = id;
                productInputForm.ShowDialog();
                return;
            }
            if (inOutTypeCode == Constant.InputType.NCK)
            {
                productInputForm productInputForm = new productInputForm();
                productInputForm.ProductTransOrderId = id;
                productInputForm.ShowDialog();
                return;
            }
        }
        private void gridViewCashDetail_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            DataGridViewRow row = gridViewCashDetail.Rows[e.RowIndex];

            if (row.IsNewRow)
            {
                return;
            }

            string action = row.Cells[ACTION_COLUMN_NAME].Value.ToString();
            int    id     = int.Parse(row.Cells[ID_COLUMN_NAME].Value.ToString());

            switch (action)
            {
            case BILL_OF_COST:
                CostsForm costForm = new CostsForm();
                costForm.costId        = id;
                costForm.StartPosition = FormStartPosition.CenterScreen;
                costForm.ShowDialog();
                return;

            case BILL_OF_INCOME:
                IncomeForm incomeForm = new IncomeForm();
                incomeForm.incomeId      = id;
                incomeForm.StartPosition = FormStartPosition.CenterScreen;
                incomeForm.ShowDialog();
                return;

            case BILL_OF_ORDER:
                PurchaseReceiptOrderForm proForm = new PurchaseReceiptOrderForm();
                proForm.PurchaseReceiveOrderId = id;
                proForm.StartPosition          = FormStartPosition.CenterScreen;
                proForm.ShowDialog();
                return;
            }
        }