private void BTN_SAVE_Click(object sender, EventArgs e)
 {
     if (DGV_ITEMS_LIST.Rows.Count == 0)
     {
         TXT_ITEMNAME.Focus();
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Alert(), "PLEASE ADD ITEMS FIRST!", MessageAlertImage.Alert());
         mdg.ShowDialog();
     }
     else if (CMB_SUPPLIER.SelectedIndex == -1)
     {
         CMB_SUPPLIER.Focus();
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Alert(), "PLEASE SELECT SUPPLIER!", MessageAlertImage.Alert());
         mdg.ShowDialog();
     }
     else if (Convert.ToDouble(TXT_CARD.Text) <= 0 && TXT_CARD_NO.Text == string.Empty)
     {
         TXT_CARD_NO.Focus();
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Alert(), "PLEASE ENTER CARD NO!", MessageAlertImage.Alert());
         mdg.ShowDialog();
     }
     else if (Convert.ToDouble(TXT_CHEQUE.Text) > 0 && (TXT_CHEQUE_NO.Text == string.Empty || CMB_CHEQUE_BANK.SelectedIndex == -1))
     {
         TXT_CHEQUE_NO.Focus();
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Alert(), "PLEASE ENTER CHEQUE INFORMATIONS!", MessageAlertImage.Alert());
         mdg.ShowDialog();
     }
     else
     {
         SAVEGRN();
     }
 }
Exemplo n.º 2
0
 private void CMB_CATEGORY_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         TXT_ITEMNAME.Focus();
     }
 }
 private void CLEAR_BOX()
 {
     TXT_QTY.Text  = "0.000";
     TXT_COST.Text = "0.00";
     TXT_SALE.Text = "0.00";
     TXT_ITEMNAME.Clear();
 }
Exemplo n.º 4
0
 private void BTN_SAVE_Click(object sender, EventArgs e)
 {
     if (CMB_CATEGORY.SelectedIndex == -1)
     {
         CMB_CATEGORY.Focus();
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Warning(), "PLEASE SELECT CATEGORY", MessageAlertImage.Warning());
         mdg.ShowDialog();
     }
     else if (TXT_ITEMNAME.Text == String.Empty)
     {
         TXT_ITEMNAME.Focus();
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Warning(), "PLEASE ENTER ITEM NAME", MessageAlertImage.Warning());
         mdg.ShowDialog();
     }
     else if (CMB_ITEM_TYPE.SelectedIndex < 0)
     {
         CMB_ITEM_TYPE.Focus();
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Warning(), "PLEASE SELECT ITEM TYPE", MessageAlertImage.Warning());
         mdg.ShowDialog();
     }
     else if (BTN_SAVE.Text == "SAVE")
     {
         SAVE_ITEMS();
         LOAD_ITEM_lIST();
         BTN_SAVE.Text = "SAVE";
         DisableControls();
         BTN_NEW.Focus();
     }
     else if (BTN_SAVE.Text == "UPDATE")
     {
         UPDATE_ITEMS();
         LOAD_ITEM_lIST();
         BTN_NEW.Focus();
     }
 }
Exemplo n.º 5
0
 private void clearAll()
 {
     LBL_ITEM_ID.Text           = "N/A";
     CMB_CATEGORY.SelectedIndex = -1;
     TXT_BARCODE.Clear();
     TXT_ITEMNAME.Clear();
     CHK_SEARCH_ITEMNAME.Checked = false;
     CHK_QTY_HANDEL.Checked      = false;
     CMB_ITEM_TYPE.SelectedIndex = -1;
 }
        private void GRN_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.F1)
            {
                TXT_ITEMNAME.Focus();
            }

            if (e.KeyCode == Keys.Add)
            {
                TXT_CASH.Focus();
            }
        }
 private void BTN_ADD_Click(object sender, EventArgs e)
 {
     if (ITEM_CODE == String.Empty)
     {
         TXT_QTY.Focus();
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Alert(), "PLEASE SELECT ITEM!", MessageAlertImage.Alert());
         mdg.ShowDialog();
     }
     else if (Convert.ToDouble(TXT_QTY.Text) <= 0)
     {
         TXT_QTY.Focus();
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Alert(), "PLEASE ENTER QTY!", MessageAlertImage.Alert());
         mdg.ShowDialog();
     }
     else if (Convert.ToDouble(TXT_COST.Text) <= 0)
     {
         TXT_COST.Focus();
         MSGBOX mdg = new MSGBOX(MessageAlertHeder.Alert(), "PLEASE ENTER COST PRICE!", MessageAlertImage.Alert());
         mdg.ShowDialog();
     }
     //else if(Convert.ToDouble(TXT_SALE.Text) <= 0)
     //{
     //    TXT_SALE.Focus();
     //    MSGBOX mdg = new MSGBOX(MessageAlertHeder.Alert(), "PLEASE ENTER SALE PRICE!", MessageAlertImage.Alert());
     //    mdg.ShowDialog();
     //}
     //else if(Convert.ToDouble(TXT_SALE.Text) <= Convert.ToDouble(TXT_COST.Text))
     //{
     //    TXT_SALE.Focus();
     //    MSGBOX mdg = new MSGBOX(MessageAlertHeder.Alert(), "ENTERD SALE PRICE IS LESS THAN OR EQUAL COST PRICE!", MessageAlertImage.Alert());
     //    mdg.ShowDialog();
     //}
     else
     {
         ADD_TO_TABLE();
         CLEAR_BOX();
         CAL_TOTAL_COST();
         LBL_TOTAL_PAYABLE.Text = (Convert.ToDouble(LBL_TOT_GRN.Text) + Convert.ToDouble(LBL_PREVIOUS_DUES.Text)).ToString("F2");
         ITEM_CODE = String.Empty;
         ITEM_NAME = String.Empty;
         BARCODE   = String.Empty;
         TXT_ITEMNAME.Focus();
     }
 }
 private void LST_ITEM_LIST_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Up)
     {
         if (LST_ITEM_LIST.Items[0].Selected == true)
         {
             TXT_ITEMNAME.Focus();
         }
     }
     if (e.KeyCode == Keys.Enter)
     {
         ITEM_CODE         = LST_ITEM_LIST.SelectedItems[0].SubItems[0].Text;
         ITEM_NAME         = LST_ITEM_LIST.SelectedItems[0].SubItems[2].Text;
         BARCODE           = LST_ITEM_LIST.SelectedItems[0].SubItems[1].Text;
         TXT_ITEMNAME.Text = ITEM_NAME;
         LST_ITEM_LIST.Hide();
         TXT_QTY.Focus();
     }
 }