protected void searchButton_Click(object sender, EventArgs e)
        {
            ViewPaymentInfo aPaymentInfo = new ViewPaymentInfo();

            if (mobileNumberTextBox.Text != String.Empty || billNumberTextBox.Text != String.Empty)
            {
                string text = billNumberTextBox.Text != String.Empty
                    ? billNumberTextBox.Text:mobileNumberTextBox.Text;

                if (_aPaymentManager.IsThisVaild(text))
                {
                    aPaymentInfo = (billNumberTextBox.Text != String.Empty)
                        ? _aPaymentManager.GetPaymentInfo(billNumberTextBox.Text)
                        : _aPaymentManager.GetPaymentInfo(mobileNumberTextBox.Text);
                    billStatusLabel.Text   = aPaymentInfo.BillStatus;
                    amountTextBox.Text     = aPaymentInfo.TotalAmount.ToString();
                    dueDateTextBox.Text    = aPaymentInfo.DueDate;
                    ViewState["patientId"] = text;
                }
                else
                {
                    billStatusLabel.Text = "Invalid Search";
                }
            }

            else
            {
                billStatusLabel.Text = "Please Insert the Bill or Mobile Number";
            }
        }
Exemplo n.º 2
0
        public ViewPaymentInfo GetPaymentInfo(string text)
        {
            ViewPaymentInfo aPaymentInfo = new ViewPaymentInfo();
            string          query        = "SELECT *FROM BillInformation WHERE BillNumber='" + text + "' OR P_MobileNumber='" + text + "';";

            Command.CommandText = query;
            Connection.Open();
            SqlDataReader reader = Command.ExecuteReader();

            reader.Read();
            aPaymentInfo.BillStatus  = reader["BillStatus"].ToString();
            aPaymentInfo.TotalAmount = Convert.ToDouble(reader["TotalAmount"]);
            aPaymentInfo.DueDate     = reader["Date"].ToString();
            Connection.Close();
            return(aPaymentInfo);
        }