private void txt_itemCode_KeyUp(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { DataTable dt = new DataTable(); DataTable stock = new DataTable(); string itemCode = txt_itemCode.Text; //get item data and fill data dt = MANAGEDB.getItemDataForStockEntry(itemCode); if (dt.Rows.Count >= 1) { txt_itemId.Text = dt.Rows[0]["itemId"].ToString(); txt_itemName.Text = dt.Rows[0]["itemName"].ToString(); txt_itemCode.Text = dt.Rows[0]["itemCode"].ToString(); //get stock entry for item stock = MANAGEDB.getStockEntryForItem(dt.Rows[0]["itemCode"].ToString()); if (stock.Rows.Count > 0) { txt_inStockQty.Text = MANAGEDB.getTotalStockAmountForItem(itemCode).ToString(); txt_stockIdQty.Text = stock.Rows[0]["remainQuantity"].ToString(); txt_UnitPrice.Text = stock.Rows[0]["sellingUnitPrice"].ToString(); txt_stockEntryId.Text = stock.Rows[0]["stockEntryId"].ToString(); //STOCK_ID_LIST.Add(txt_stockEntryId.Text); txt_releaseQty.Focus(); //System.Media.SystemSounds.Beep.Play(); //System.Media.SystemSounds.Asterisk.Play(); //System.Media.SystemSounds.Exclamation.Play(); //System.Media.SystemSounds.Question.Play(); //System.Media.SystemSounds.Hand.Play(); } else { COM_MESSAGE.warningMessage("There are no Remain Quantity for the item you entered", "No Items Remain"); } } else { txt_itemCode.Clear(); //System.Media.SystemSounds.Beep.Play(); //System.Media.SystemSounds.Asterisk.Play(); //System.Media.SystemSounds.Exclamation.Play(); //System.Media.SystemSounds.Question.Play(); //System.Media.SystemSounds.Hand.Play(); } } } catch (Exception ex) { COM_MESSAGE.exceptionMessage(ex.Message); } }
/// <summary> /// clear all text boxes /// </summary> /// <param name="con"></param> //private void clearAllText(Control con) //{ // foreach (Control c in con.Controls) // { // if (c is TextBox) // ((TextBox)c).Clear(); // else // clearAllText(c); // } //} private void btn_delete_Click(object sender, EventArgs e) { DialogResult result = COM_MESSAGE.warningMessage("You are going to DELETE the user....\n\r Are you Sure???", "Delete the User"); if (result == DialogResult.Yes) { if (MANAGEDB.deleteUser(Convert.ToInt16(txt_userID.Text))) { IS_SUCCESS_MESSAGE = true; this.Close(); COM_MESSAGE.successfullMessage("Successfully deleted the User"); } } }
private void txt_itemCode_KeyUp(object sender, KeyEventArgs e) { try { if (e.KeyCode == Keys.Enter) { DataTable dt = new DataTable(); //get item data and fill data dt = MANAGEDB.getItemDataForStockEntry(txt_itemCode.Text); if (dt.Rows.Count >= 1) { //System.Media.SystemSounds.Beep.Play(); //System.Media.SystemSounds.Asterisk.Play(); //System.Media.SystemSounds.Exclamation.Play(); //System.Media.SystemSounds.Question.Play(); //System.Media.SystemSounds.Hand.Play(); btn_search.PerformClick(); } else { COM_MESSAGE.warningMessage("The Item you are searching is not found", "Not Found"); txt_itemCode.Clear(); txt_itemCode.Focus(); //System.Media.SystemSounds.Beep.Play(); //System.Media.SystemSounds.Asterisk.Play(); //System.Media.SystemSounds.Exclamation.Play(); //System.Media.SystemSounds.Question.Play(); //System.Media.SystemSounds.Hand.Play(); } } } catch (Exception ex) { COM_MESSAGE.exceptionMessage(ex.Message); } }
private void btn_delete_Click(object sender, EventArgs e) { try { DialogResult result = COM_MESSAGE.warningMessage("You are going to DELETE a Unit....\n\r Are you Sure???", "Delete A Measure Unit"); if (result == DialogResult.Yes) { if (MANAGEDB.deleteUnit(Convert.ToInt32(txt_unitId.Text))) { IS_SUCCESS_MESSAGE = true; this.Close(); COM_MESSAGE.successfullMessage("Successfully deleted the Asset"); } } } catch (Exception ex) { COM_MESSAGE.exceptionMessage(ex.Message); } }
private void grd_stockCurrent_CellContentClick(object sender, DataGridViewCellEventArgs e) { var senderGrid = (DataGridView)sender; long stockEntryId = 0; BLL.ClsStockData stockData = new BLL.ClsStockData(); try { //check for do action if (COMM_METHODS.checkActPermission(this.Name, USERNAME)) { if (senderGrid.Columns[e.ColumnIndex] is DataGridViewButtonColumn && e.RowIndex >= 0) { stockEntryId = Convert.ToInt64(senderGrid.SelectedCells[e.ColumnIndex].Value); stockData = MANAGEDB.getSingleStockDetail(stockEntryId); if (stockData._releaseFlg == 0) { FrmAdjustStock frmUser = new FrmAdjustStock(stockData, USERNAME); frmUser.WindowState = FormWindowState.Normal; frmUser.ShowDialog(); fillGrid(); } else { COM_MESSAGE.warningMessage("The Entry you are trying to edit is released !!!", "Released Entry"); } } } else { COM_MESSAGE.permissionMessage("Sorry You dont have permission to do action !!!"); } } catch (Exception ex) { COM_MESSAGE.exceptionMessage(ex.Message); } }