}// #endregion //onclick panel item void Product_Clicked(object sender, EventArgs e, MDB_ProductModel product) { G_POS.POS.Forms.POSForm pf = (G_POS.POS.Forms.POSForm) this.ParentForm; pf.connect_store_n_receipt_send_this_item(product); this.putSearchOnFocus(); connector_in_clear_search(); }
private void storeItemsDataGridView_DoubleClick(object sender, EventArgs e) { var selIndex = get_selected_row(); if (selIndex == -1) { return; } var prodObj = getProductObjectFromId(selIndex); //MessageBox.Show("selce"); G_POS.POS.Forms.POSForm pf = (G_POS.POS.Forms.POSForm) this.ParentForm; pf.connect_store_n_receipt_send_this_item(prodObj); this.putSearchOnFocus(); connector_in_clear_search(); storeItemsDataGridView.Refresh(); }
// private void storeItemsDataGridView_KeyDown(object sender, KeyEventArgs e) { if ((int)e.KeyCode == 13) //'Enter Key { this.storeItemsDataGridView.CurrentRow.Selected = true; e.Handled = true; var selIndex = get_selected_row(); if (selIndex == -1) { return; } var prodObj = getProductObjectFromId(selIndex); //MessageBox.Show("selce"); G_POS.POS.Forms.POSForm pf = (G_POS.POS.Forms.POSForm) this.ParentForm; pf.connect_store_n_receipt_send_this_item(prodObj); this.putSearchOnFocus(); connector_in_clear_search(); storeItemsDataGridView.Refresh(); } }
private void loginBtn_Click_1(object sender, EventArgs e) { loadingLbl.Text = "signing in ..."; loadingLbl.Visible = true; if (usernameTxt.Text == null || usernameTxt.Text == "" || passwordTxt.Text == null || passwordTxt.Text == "") { MessageBox.Show("Username and password are required!!"); } //MessageBox.Show(usernameTxt.Text + ":" + passwordTxt.Text); MDB_UserModel res = userController.login_user(new MDB_UserModel() { username = usernameTxt.Text, password = passwordTxt.Text }); if (res != null) { int r = userController.saveCurrentUser(res); if (r == 0) { loadingLbl.Text = "OK"; //System.Threading.Thread.Sleep(2000); var f = new POSForm(); f.ShowDialog(); this.Close(); } else { loadingLbl.Text = "Cant Save current user!!"; } } else { loadingLbl.Text = "Sorry invalid credentials!!"; } }
private void clearReceiptSectBtn_Click(object sender, EventArgs e) { //clearReceiptSectBtn //tell parent form want to tell the receipt control that am done... G_POS.POS.Forms.POSForm pf = (G_POS.POS.Forms.POSForm) this.ParentForm; pf.connect_store_n_receipt_gen_clear_all(); }
//clicks eg buttons #region ui_clicks private void UI_BTN_CLICKS(object sender, EventArgs e) { Button input = (Button)sender; switch (input.Name) {// case "salesBtn": { SalesForm sform = new SalesForm(); sform.ShowDialog(); break; } case "refreshRecentlyListBtn": { currentListOfProducts = productController.getStartUpProductsFromStore(); this.renderProductsUI(); break; } case "switchDisplayFormatBtn": { this.switchCurrentDisplayFormat(); this.searchKeyTxt.Text = ""; currentListOfProducts = productController.getStartUpProductsFromStore(); this.renderProductsUI(); break; } case "goToDashBoardBtn": { //F_OrdersMaintainer pf = (F_OrdersMaintainer)this.ParentForm; //pf.Connector_2_dashboard(); break; } case "searchBtn": { //currentListOfProducts = productController.getProductsBasedOnSearchKey(searchKeyTxt.Text); if (searchKeyTxt.Text == "") { currentListOfProducts = productController.getStartUpProductsFromStore(); } else { currentListOfProducts = productController.getProductsBasedOnSearchKey(searchKeyTxt.Text); } this.renderProductsUI(); if (this.autoSelectItemCheckBox.Checked == true && currentListOfProducts.Count == 1) { //MessageBox.Show("Auto select"); G_POS.POS.Forms.POSForm pf = (G_POS.POS.Forms.POSForm) this.ParentForm; pf.connect_store_n_receipt_send_this_item(currentListOfProducts[0]); this.putSearchOnFocus(); this.searchKeyTxt.Text = ""; } break; } case "btnClearSearchBox": { this.searchKeyTxt.Text = ""; currentListOfProducts = productController.getStartUpProductsFromStore(); this.renderProductsUI(); break; } case "EXITBtn": //clearReceiptSectBtn { pollDisplay("0"); Application.Exit(); /*F_OrdersMaintainer pf = (F_OrdersMaintainer)this.ParentForm; * pf.Connector_store_2_receipt_clear_receipt_items(); * //hide table no show * tableNoLbl.Visible = false; * tableNoTxt.Visible = false; * tableNoTxt.Text = -1 + ""; * this.TABLE_NO_SHOW = 0;*/ //this.putSearchOnFocus(); break; } case "forTableBtn": { if ((tableNoLbl.Visible == true) && (tableNoTxt.Visible = true)) { tableNoLbl.Visible = false; tableNoTxt.Visible = false; this.TABLE_NO_SHOW = 0; } else { tableNoLbl.Visible = true; tableNoTxt.Visible = true; this.TABLE_NO_SHOW = 1; } break; } //prev and next btn case "nextBtn": { int max_page = (this.currentListOfProducts.Count / this.COUNTS_PER_PAGE); if (this.CURRENT_PAGE == max_page) { this.COUNTS_REMAINDER = (this.currentListOfProducts.Count % this.COUNTS_PER_PAGE); } if (this.COUNTS_REMAINDER != 0) { max_page += 1; } //MessageBox.Show("items :" + currentListOfProducts.Count + "\nmax:" + max_page + "\nCurr:" + this.CURRENT_PAGE + "\nRemainder" + this.COUNTS_REMAINDER); //check if (!(this.CURRENT_PAGE >= max_page)) { this.CURRENT_PAGE += 1; this.renderProductsUI(); } else { } //max page this.putSearchOnFocus(); break; } case "prevBtn": { this.COUNTS_REMAINDER = 0; //basic if (!(this.CURRENT_PAGE - 1 == 0)) { this.CURRENT_PAGE -= 1; this.renderProductsUI(); } else { } //-1 this.putSearchOnFocus(); break; } case "currentOrdersBtn": //MyRestaurant.Restaurant.Controls.OrdersFlow.CurrentOrders.CurrentOrdersForm fm = new MyRestaurant.Restaurant.Controls.OrdersFlow.CurrentOrders.CurrentOrdersForm(); //fm.ShowDialog(); break; case "x": break; } }