void o_Click(object sender, EventArgs e) { if (isTransfer) { FrmDelete confirm = new FrmDelete(); var formLayout = (FrmLayout)(((TransButton)sender).FindForm()); if (((TransButton)sender).invoiceNum != "") { confirm.label1.Text = "Bạn có thực sự muốn gộp với bàn " + ((TransButton)sender).tableName + " ?"; if (confirm.ShowDialog() == DialogResult.OK) { formLayout.formBanHang.combine(((TransButton)sender).tableName, this.Text, ((TransButton)sender).invoiceNum); Alert.Show("Đã gộp sang bàn " + ((TransButton)sender).tableName); } } else { confirm.label1.Text = "Bạn có thực sự muốn chuyển bàn " + ((TransButton)sender).tableName + " ?"; if (confirm.ShowDialog() == DialogResult.OK) { formLayout.formBanHang.transfer(((TransButton)sender).tableName, this.Text); Alert.Show("Đã chuyển sang bàn :" + ((TransButton)sender).tableName); } } formLayout.Dispose(); } else { if (((TransButton)sender).cashierId != StaticClass.cashierId && ((TransButton)sender).cashierId != "") { if (!Employee.CheckGrant(StaticClass.storeId, StaticClass.cashierId, Employee.XEM_BAN_KHAC)) { return; } } banhang = new FrmBanHang(); var tmpBut = (TransButton)sender; banhang.formLayout = (FrmLayout)((TransButton)sender).FindForm(); banhang.formLogin = ((FrmLayout)((TransButton)sender).FindForm()).formLogin; if (tmpBut.invoiceNum == "") { banhang.isOnHold = false; } else { banhang.isOnHold = true; } DataTable InvoiceNumTab = getGui.OpenTable(StaticClass.storeId, this.Text, StaticClass.stationId, tmpBut.tableName, StaticClass.cashierId, StaticClass.custNum, DateTime.Now, "", "", "", "", ""); string InvoiceNum = InvoiceNumTab.Rows[0][0].ToString(); banhang.invoiceNum = InvoiceNum; banhang.tableName = tmpBut.tableName; banhang.formLogin.RequestMess("UpdateForm"); banhang.ShowDialog(); } }
private void btClean_Click() { try{ var activesheet = (Excel.Worksheet)_excelapp.ActiveSheet; if (!_parser.checkTablePresent(activesheet)) { return; } using (var lForm = new FrmDelete(_excelapp.Hwnd)) { lForm.Reports = _parser.GetReportsList(activesheet.ListObjects[1]); lForm.AssociatedInstance = _settings.GetWorksheetParam("DelInstance", "SPECIFIED"); if (lForm.ShowDialog() != DialogResult.OK) { return; } var reports = _parser.ParseListObjectToReports(activesheet.ListObjects[1], true); _settings.SetWorksheetParam("DelInstance", lForm.AssociatedInstance); var scheduler = new SchedulerManager(_session); var runner = new FrmRunner(_session.Logger, scheduler.Cancel); var exitcode = runner.Execute(() => scheduler.DeleteReportsInstance(ref reports, lForm.AssociatedInstance) ); if (exitcode == ExitCode.FAILED || exitcode == ExitCode.CANCELED) { return; } _parser.UpdateListObjectStatus(activesheet.ListObjects[1], reports); } } catch (Exception ex) { new BusinessObjectsUtils.FrmException(_excelapp.Hwnd, ex).ShowDialog(); } }
void o_Click(object sender, EventArgs e) { if(isTransfer) { FrmDelete confirm = new FrmDelete(); var formLayout = (FrmLayout)(((TransButton)sender).FindForm()); if (((TransButton)sender).invoiceNum != "") { confirm.label1.Text = "Bạn có thực sự muốn gộp với bàn " + ((TransButton)sender).tableName + " ?"; if (confirm.ShowDialog() == DialogResult.OK) { formLayout.formBanHang.combine(((TransButton)sender).tableName, this.Text, ((TransButton)sender).invoiceNum); Alert.Show("Đã gộp sang bàn " + ((TransButton) sender).tableName); } } else { confirm.label1.Text = "Bạn có thực sự muốn chuyển bàn " + ((TransButton)sender).tableName + " ?"; if (confirm.ShowDialog() == DialogResult.OK) { formLayout.formBanHang.transfer(((TransButton) sender).tableName,this.Text); Alert.Show("Đã chuyển sang bàn :" + ((TransButton) sender).tableName); } } formLayout.Dispose(); } else { if (((TransButton)sender).cashierId != StaticClass.cashierId && ((TransButton)sender).cashierId != "") { if(!Employee.CheckGrant(StaticClass.storeId,StaticClass.cashierId,Employee.XEM_BAN_KHAC)) { return; } } banhang = new FrmBanHang(); var tmpBut = (TransButton)sender; banhang.formLayout = (FrmLayout)((TransButton) sender).FindForm(); banhang.formLogin = ((FrmLayout)((TransButton)sender).FindForm()).formLogin; if(tmpBut.invoiceNum == "") { banhang.isOnHold = false; } else { banhang.isOnHold = true; } DataTable InvoiceNumTab = getGui.OpenTable(StaticClass.storeId,this.Text,StaticClass.stationId,tmpBut.tableName,StaticClass.cashierId,StaticClass.custNum,DateTime.Now,"","","","",""); string InvoiceNum = InvoiceNumTab.Rows[0][0].ToString(); banhang.invoiceNum = InvoiceNum; banhang.tableName = tmpBut.tableName; banhang.formLogin.RequestMess("UpdateForm"); banhang.ShowDialog(); } }