示例#1
0
 private void billButton_Click(object sender, EventArgs e)
 {
     if (orderTypeDD.SelectedIndex == 0)
     {
         if (retrunedTXt.Text != "" && floorDD.SelectedIndex != -1 && tableDD.SelectedIndex != -1)
         {
             int ch = Updates.updateOrder(Convert.ToInt64(orderidTxt.Text), Convert.ToSingle(paidTxt.Text), Convert.ToSingle(retrunedTXt.Text), 2);
             if (ch > 0)
             {
                 DialogResult dr = MessageBox.Show("Order completed successfully", "Success..", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 if (dr == DialogResult.OK)
                 {
                     rd = new ReportDocument();
                     RetrivalData.loadReport(rd, crystalReportViewer1, 2, null, Convert.ToInt32(tableDD.SelectedValue.ToString()));
                 }
             }
         }
     }
     else
     {
         if (retrunedTXt.Text != "" && phoneTxt.Text != "")
         {
             int ch = Updates.updateOrder(Convert.ToInt64(orderidTxt.Text), Convert.ToSingle(paidTxt.Text), Convert.ToSingle(retrunedTXt.Text), 2);
             if (ch > 0)
             {
                 DialogResult dr = MessageBox.Show("Order completed successfully", "Success..", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 if (dr == DialogResult.OK)
                 {
                     rd = new ReportDocument();
                     RetrivalData.loadReport(rd, crystalReportViewer1, 2, phoneTxt.Text);
                 }
             }
         }
     }
 }