Пример #1
0
    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);
    }
Пример #2
0
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        int    empId            = Convert.ToInt32(Session["receptionistId"].ToString());
        string appointmentToken = Label3.Text;
        string appointmentDate  = TextBox1.Text;
        string appointmentTime  = TextBox2.Text;

        GetDoctorNameByAppointmentTokenBL objGetDoctorNameByAppointmentTokenBL = new GetDoctorNameByAppointmentTokenBL();
        string doctorName = objGetDoctorNameByAppointmentTokenBL.GetDoctorNameByAppointmentToken(Label3.Text);

        AddAppointmentInvoiceBL objAddAppointmentInvoiceBL = new AddAppointmentInvoiceBL();
        string invoiceId = objAddAppointmentInvoiceBL.AddAppointmentInvoice(empId, appointmentToken);

        PrintAppointmentInvoiceBL objPrintAppointmentInvoiceBL = new PrintAppointmentInvoiceBL();

        byte[] file = objPrintAppointmentInvoiceBL.PrintAppointmentInvoice(invoiceId, appointmentToken, doctorName, appointmentDate, appointmentTime);
        Response.Clear();
        Response.ContentType = "application/pdf";
        Response.AddHeader("Content-Disposition", "attachment; filename=AppointmentInvoice.pdf");
        Response.ContentType = "application/pdf";
        Response.Buffer      = true;
        Response.Cache.SetCacheability(HttpCacheability.NoCache);
        Response.BinaryWrite(file);
        Response.End();
        Response.Close();
    }
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        int empId = Convert.ToInt32(Session["receptionistId"].ToString());
        string appointmentToken = Label3.Text;
        string appointmentDate = TextBox1.Text;
        string appointmentTime = TextBox2.Text;

        GetDoctorNameByAppointmentTokenBL objGetDoctorNameByAppointmentTokenBL = new GetDoctorNameByAppointmentTokenBL();
        string doctorName = objGetDoctorNameByAppointmentTokenBL.GetDoctorNameByAppointmentToken(Label3.Text);

        AddAppointmentInvoiceBL objAddAppointmentInvoiceBL = new AddAppointmentInvoiceBL();
        string invoiceId = objAddAppointmentInvoiceBL.AddAppointmentInvoice(empId, appointmentToken);

        PrintAppointmentInvoiceBL objPrintAppointmentInvoiceBL = new PrintAppointmentInvoiceBL();
        byte[] file = objPrintAppointmentInvoiceBL.PrintAppointmentInvoice(invoiceId, appointmentToken, doctorName, appointmentDate, appointmentTime);
        Response.Clear();
        Response.ContentType = "application/pdf";
        Response.AddHeader("Content-Disposition", "attachment; filename=AppointmentInvoice.pdf");
        Response.ContentType = "application/pdf";
        Response.Buffer = true;
        Response.Cache.SetCacheability(HttpCacheability.NoCache);
        Response.BinaryWrite(file);
        Response.End();
        Response.Close();
    }
    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);
    }