public async Task <bool> AddPOSMain(POSMainModel model) { POSMain main = new POSMain() { CustomerId = model.CustomerId, Id = model.Id, PosDate = model.PosDate, TotalAmount = model.TotalAmount, TotalQuantity = model.TotalQuantity }; await _dbContext.POSMains.AddAsync(main); int affectedRows = await _dbContext.SaveChangesAsync(); return(affectedRows > 0); }
public ButtonKeyEventhandler(List <Button> buttonlist, POSMain posmain_d) { this.ButtonList = buttonlist; this.posmain = posmain_d; //this.ButtonList[0].Click += new System.EventHandler(this.btnEscape_Click); this.ButtonList[1].Click += new System.EventHandler(this.btnF1_Click); this.ButtonList[2].Click += new System.EventHandler(this.btnF2_Click); this.ButtonList[3].Click += new System.EventHandler(this.btnF3_Click); this.ButtonList[4].Click += new System.EventHandler(this.btnF4_Click); this.ButtonList[5].Click += new System.EventHandler(this.btnF5_Click); this.ButtonList[6].Click += new System.EventHandler(this.btnF6_Click); this.ButtonList[7].Click += new System.EventHandler(this.btnF7_Click); this.ButtonList[8].Click += new System.EventHandler(this.btnF8_Click); this.ButtonList[9].Click += new System.EventHandler(this.btnF9_Click); this.ButtonList[10].Click += new System.EventHandler(this.btnF10_Click); this.ButtonList[11].Click += new System.EventHandler(this.btnF11_Click); this.ButtonList[12].Click += new System.EventHandler(this.btnF12_Click); }
private void frmChange_c_Shown(object sender, EventArgs e) { if (Visible && flag) { flag = false; int temp = 0; bool retry = false; do { retry = false; frmLoad loadForm = new frmLoad("Saving Transaction", "Loading Screen"); loadForm.BackgroundWorker.DoWork += (sender1, e1) => { temp = POSMain.save_transaction_thread(tran); }; loadForm.ShowDialog(); if (temp == 0) { LogsHelper.Print("Tender success"); } else if (temp == 1) { fncFilter.alert("Member transaction was unable to complete due to connection problems. F8 - Payment to try again."); LogsHelper.Print("Tender failed: Member Feature Offline"); isTransactionDone = false; } else if (temp == -1) { LogsHelper.Print("Tender failed: General Saving failure"); if (DialogHelper.ShowDialog("An error occured in saving transaction. Would you like to retry?", MessageBoxButtons.YesNo) == DialogResult.Yes) { retry = true; LogsHelper.Print("Tender failure popup: Retry"); } else { LogsHelper.Print("Tender failure popup: Ignore"); fncHardware.print_receipt(tran, false, false); } } }while (retry); } }
public frmPOSMainExt(POSMain mainform) { InitializeComponent(); this.mainform = mainform; }