Ejemplo n.º 1
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            try
            {
                int[]       selRows      = ((GridView)grdPOrders.MainView).GetSelectedRows();
                DataRowView oPOrder      = (DataRowView)(((GridView)grdPOrders.MainView).GetRow(selRows[0]));
                DataRowView OrderDate    = (DataRowView)(((GridView)grdPOrders.MainView).GetRow(selRows[0]));
                DateTime    dChallanDate = Convert.ToDateTime(OrderDate["OrderDate"]);

                if (oPOrder == null)
                {
                    MessageBox.Show("select an item to edit", "Item not yet selected", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }

                if (Global.CurrentUser.ISEditable == 1)
                {
                    if (dChallanDate < DateTime.Today)
                    {
                        MessageBox.Show("This order can't be editable, Please contact BD Team", "Unauthorized Access", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        return;
                    }
                }

                fPurchaseOrder frm = new fPurchaseOrder();
                frm.ItemChanged = RefreshPreOrderList;
                frm.ShowDlg(Convert.ToInt32(oPOrder["POrderID"]));
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Ejemplo n.º 2
0
        private void btnPOInvoice_Click(object sender, EventArgs e)
        {
            try
            {
                int[]       selRows   = ((GridView)grdPOrders.MainView).GetSelectedRows();
                DataRowView oPOrderID = (DataRowView)(((GridView)grdPOrders.MainView).GetRow(selRows[0]));
                int         nPOrderID = Convert.ToInt32(oPOrderID["POrderID"]);


                if (nPOrderID <= 0)
                {
                    MessageBox.Show("select an item for BC Generate", "Item not yet selected", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }

                POrder oPOr = null;
                if (nPOrderID > 0)
                {
                    oPOr = db.POrders.FirstOrDefault(po => po.POrderID == nPOrderID);
                }

                if (oPOr != null)
                {
                    fPurchaseOrder fPO = new fPurchaseOrder();
                    fPO.PrintPOInvoice(oPOr);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Ejemplo n.º 3
0
        private void btnPOrderNew_Click(object sender, EventArgs e)
        {
            fPurchaseOrder frm = new fPurchaseOrder();

            frm.ItemChanged = RefreshPreOrderList;
            frm.ShowDlg(0);
        }