protected void LinkButton2_Click(object sender, EventArgs e) { string oldAppointmentDate = Request.QueryString["Date"].ToString(); string newAppointmentDate = TextBox1.Text; string newAppointmentTime = TextBox2.Text; SMS.APIType = SMSGateway.Site2SMS; SMS.MashapeKey = "qsdptI9i8PmshCC3BzZtyTTZVMtqp1CKzOYjsnHn0tfnCt11sT"; SMS.Username = "******"; SMS.Password = "******"; string appointmentToken = Session["appointmentToken"].ToString(); GetDoctorNameByAppointmentTokenBL objGetDoctorNameByAppointmentTokenBL = new GetDoctorNameByAppointmentTokenBL(); string doctorName = objGetDoctorNameByAppointmentTokenBL.GetDoctorNameByAppointmentToken(appointmentToken); DataSet ds = new DataSet(); GetPatientInfoByAppointmentTokenBL objGetPatientInfoByAppointmentTokenBL = new GetPatientInfoByAppointmentTokenBL(); ds = objGetPatientInfoByAppointmentTokenBL.GetPatientInfoByAppointmentToken(appointmentToken); string patientPrimaryPhone = ds.Tables[0].Rows[0]["PATIENT_PRIMARY_PHONE"].ToString(); Common_GetSMSTemplateBL objGetSMSTemplateBL = new Common_GetSMSTemplateBL(); string SMStemplate = objGetSMSTemplateBL.Common_GetSMSTemplate(1); var regex = new Regex(Regex.Escape("#")); string SMSMessage = regex.Replace(SMStemplate, doctorName, 1); SMSMessage = regex.Replace(SMSMessage, oldAppointmentDate, 2); SMSMessage = regex.Replace(SMSMessage, newAppointmentDate, 3); SMSMessage = regex.Replace(SMSMessage, newAppointmentTime, 4); SMS.SendSms(patientPrimaryPhone, SMSMessage); }
protected void LinkButton2_Click(object sender, EventArgs e) { string oldAppointmentDate = Request.QueryString["Date"].ToString(); string newAppointmentDate = TextBox1.Text; string newAppointmentTime = TextBox2.Text; SMS.APIType = SMSGateway.Site2SMS; SMS.MashapeKey = "qsdptI9i8PmshCC3BzZtyTTZVMtqp1CKzOYjsnHn0tfnCt11sT"; SMS.Username = "******"; SMS.Password = "******"; string appointmentToken = Session["appointmentToken"].ToString(); GetDoctorNameByAppointmentTokenBL objGetDoctorNameByAppointmentTokenBL = new GetDoctorNameByAppointmentTokenBL(); string doctorName = objGetDoctorNameByAppointmentTokenBL.GetDoctorNameByAppointmentToken(appointmentToken); DataSet ds = new DataSet(); GetPatientInfoByAppointmentTokenBL objGetPatientInfoByAppointmentTokenBL = new GetPatientInfoByAppointmentTokenBL(); ds = objGetPatientInfoByAppointmentTokenBL.GetPatientInfoByAppointmentToken(appointmentToken); string patientPrimaryPhone = ds.Tables[0].Rows[0]["PATIENT_PRIMARY_PHONE"].ToString(); Common_GetSMSTemplateBL objGetSMSTemplateBL = new Common_GetSMSTemplateBL(); string SMStemplate = objGetSMSTemplateBL.Common_GetSMSTemplate(1); var regex = new Regex(Regex.Escape("#")); string SMSMessage = regex.Replace(SMStemplate, doctorName, 1); SMSMessage = regex.Replace(SMSMessage, oldAppointmentDate, 2); SMSMessage = regex.Replace(SMSMessage, newAppointmentDate, 3); SMSMessage = regex.Replace(SMSMessage, newAppointmentTime, 4); SMS.SendSms(patientPrimaryPhone, SMSMessage); }