protected void Button1_Click(object sender, EventArgs e)
    {
        int medicineTypeId = Convert.ToInt32(DropDownList1.SelectedValue);
        int medicineNameId = Convert.ToInt32(DropDownList2.SelectedValue);
        string medicineStrength = TextBox1.Text;
        string medicineQuantity = TextBox4.Text;
        string medicineStartDate = DateTime.ParseExact(TextBox5.Text, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString();
        int numberOfRefills = Convert.ToInt32(TextBox2.Text);
        string quantityOnRefills = TextBox6.Text;
        string medicineInstructions = TextBox3.Text;

        Doctor_OPDTreatmentMedicineBO objOPDTreatmentMedicineBO = new Doctor_OPDTreatmentMedicineBO();
        objOPDTreatmentMedicineBO.medicineInstructions = medicineInstructions;
        objOPDTreatmentMedicineBO.medicineType = DropDownList1.SelectedItem.Text;
        objOPDTreatmentMedicineBO.medicineName = DropDownList2.SelectedItem.Text;
        objOPDTreatmentMedicineBO.medicineStrength = TextBox1.Text;
        objOPDTreatmentMedicineBO.medicineQuantity = TextBox4.Text;
        objOPDTreatmentMedicineBO.medicineStartDate = TextBox5.Text;
        objOPDTreatmentMedicineBO.numberOfRefills = Convert.ToInt32(TextBox2.Text);
        objOPDTreatmentMedicineBO.quantityOnRefills = TextBox6.Text;
        objOPDTreatmentMedicineBO.medicineInstructions = TextBox3.Text;

        objOPDTreatmentMedicineBOList.Add(objOPDTreatmentMedicineBO);

        Doctor_AddOPDTreatmentMedicineBL objAddOPDTreatmentMedicineBL = new Doctor_AddOPDTreatmentMedicineBL();
        objAddOPDTreatmentMedicineBL.Doctor_AddOPDTreatmentMedicine(appointmentToken, medicineTypeId,
            medicineNameId, medicineStrength, medicineQuantity, medicineStartDate, numberOfRefills,
            quantityOnRefills, medicineInstructions);

        Doctor_GetOPDTreatmentMedicineBL objGetOPDTreatmentMedicineBL = new Doctor_GetOPDTreatmentMedicineBL();
        GridView3.DataSource = objGetOPDTreatmentMedicineBL.Doctor_GetOPDTreatmentMedicine(appointmentToken);
        GridView3.DataBind();
        Panel4.Visible = true;
        LinkButton2.Visible = false;
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        int    medicineTypeId       = Convert.ToInt32(DropDownList1.SelectedValue);
        int    medicineNameId       = Convert.ToInt32(DropDownList2.SelectedValue);
        string medicineStrength     = TextBox1.Text;
        string medicineQuantity     = TextBox4.Text;
        string medicineStartDate    = DateTime.ParseExact(TextBox5.Text, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString();
        int    numberOfRefills      = Convert.ToInt32(TextBox2.Text);
        string quantityOnRefills    = TextBox6.Text;
        string medicineInstructions = TextBox3.Text;

        Doctor_OPDTreatmentMedicineBO objOPDTreatmentMedicineBO = new Doctor_OPDTreatmentMedicineBO();

        objOPDTreatmentMedicineBO.medicineInstructions = medicineInstructions;
        objOPDTreatmentMedicineBO.medicineType         = DropDownList1.SelectedItem.Text;
        objOPDTreatmentMedicineBO.medicineName         = DropDownList2.SelectedItem.Text;
        objOPDTreatmentMedicineBO.medicineStrength     = TextBox1.Text;
        objOPDTreatmentMedicineBO.medicineQuantity     = TextBox4.Text;
        objOPDTreatmentMedicineBO.medicineStartDate    = TextBox5.Text;
        objOPDTreatmentMedicineBO.numberOfRefills      = Convert.ToInt32(TextBox2.Text);
        objOPDTreatmentMedicineBO.quantityOnRefills    = TextBox6.Text;
        objOPDTreatmentMedicineBO.medicineInstructions = TextBox3.Text;

        objOPDTreatmentMedicineBOList.Add(objOPDTreatmentMedicineBO);

        Doctor_AddOPDTreatmentMedicineBL objAddOPDTreatmentMedicineBL = new Doctor_AddOPDTreatmentMedicineBL();

        objAddOPDTreatmentMedicineBL.Doctor_AddOPDTreatmentMedicine(appointmentToken, medicineTypeId,
                                                                    medicineNameId, medicineStrength, medicineQuantity, medicineStartDate, numberOfRefills,
                                                                    quantityOnRefills, medicineInstructions);

        Doctor_GetOPDTreatmentMedicineBL objGetOPDTreatmentMedicineBL = new Doctor_GetOPDTreatmentMedicineBL();

        GridView3.DataSource = objGetOPDTreatmentMedicineBL.Doctor_GetOPDTreatmentMedicine(appointmentToken);
        GridView3.DataBind();
        Panel4.Visible      = true;
        LinkButton2.Visible = false;
    }