//muiBtnOK_Click private void muiBtnOK_Click(object sender, RoutedEventArgs e) { try { if (bus_tb_order.GetSumOrder("WHERE [PaymentID] = " + paymentid) > 0) { tblNotification.Text = FindResource("card").ToString() + (" ") + card + " " + FindResource("already_uses").ToString(); return; } else { if (bus_tb_payment.DeletePayment(new EC_tb_Payment() { PaymentID = paymentid }) == 1) { if (delete_delegate != null) { StaticClass.GeneralClass.list_ec_tb_setting_general.Clear(); delete_delegate(); this.Close(); } } } } catch (Exception ex) { tblNotification.Text = ex.Message; } }
//CalculateTotalPages private void CalculateTotalPagesForOrder(int salespersonid) { if (thread_calculatetotalpages_order != null && thread_calculatetotalpages_order.ThreadState == ThreadState.Running) { } else { thread_calculatetotalpages_order = new Thread(() => { current_page_order = 1; string con = "where [SalespersonID] = " + salespersonid; count_rows_order = bus_tb_order.GetSumOrder(con); this.total_page_order = count_rows_order / page_size_order; if (count_rows_order % page_size_order > 0) { this.total_page_order += 1; } }); thread_calculatetotalpages_order.Start(); thread_calculatetotalpages_order.Join(); } }