I need your help.
I am in function of sms sending on Booking date and on 2 days before of consultation.
private void SendSmS()
{
SqlDataReader rdr = null;
int Day = 2;
try
{
string cnn = ConfigurationManager.ConnectionStrings["MSCon"].ToString();
SqlConnection cn = new SqlConnection(cnn);
cn.Open();
SqlCommand cmd = new SqlCommand("Get_PatientPhoneNo", cn);
cmd.CommandType = CommandType.StoredProcedure;
rdr = cmd.ExecuteReader();
while (rdr.Read())
{
Phone = rdr["PHONE"].ToString();
DoctorName = rdr["DOCTOR"].ToString();
patientName = rdr["PATIENT"].ToString();
bookingDate =Convert.ToDateTime(rdr["DATE"].ToString());
string msgLine = "Dear " + patientName + ",\nYour Consultation with Dr." + DoctorName + " is fixed for " + bookingDate + ".Please ascertain the exact time in advance";
if (VerifyPhoneNumber(Phone))
{
string strCount = SMS(userID, Pswrd, Phone, msgLine, DoctorName, bookingDate, patientName);
if (strCount == "1")
{
UpdatePhoneNo();
}
}
}
Reminder = bookingDate.AddDays(-2);
}
catch (Exception ex)
{
MessageBox.Show(ex + "SMS03", "SMS", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}
I just saved the booking date - 2 days into Reminder. And when the reminder value become true, i want to execute the function of sms
Please help me