protected void Button2_Click(object sender, EventArgs e)
    {
        objp.built            = TextBox2.Text;
        objp.pulse            = TextBox26.Text;
        objp.bp               = TextBox5.Text;
        objp.rr               = TextBox3.Text;
        objp.pallor           = TextBox27.Text;
        objp.cyanosis         = TextBox2.Text;
        objp.clubing          = TextBox4.Text;
        objp.peripheral_pulse = TextBox28.Text;
        objp.jvp              = TextBox2.Text;
        objp.hjr              = TextBox29.Text;
        objp.oedema           = TextBox32.Text;
        objp.adenopathy       = TextBox2.Text;
        objp.icterus          = TextBox30.Text;
        objp.erruptions       = TextBox33.Text;
        objp.other            = TextBox47.Text;
        objp.cvs              = TextBox36.Text;
        objp.r_s              = TextBox42.Text;
        objp.p_a              = TextBox43.Text;
        objp.cns              = TextBox44.Text;
        objp.ps_pv            = TextBox45.Text;
        objp.opd_code         = Session["opd_code"].ToString();;
        objp.ref_doctor       = TextBox25.Text;
        objp.department       = DropDownList5.SelectedValue;
        objp.doctor_id        = DropDownList3.SelectedValue;

        objp.con_doctor = DropDownList3.SelectedItem.Text;


        objp.pateint_code = Session["pateint_code"].ToString();
        objp.emp_code     = Session["emp_code"].ToString();
        objp.is_check_in  = "1";

        obj.opdreg(objp);


        int cashmemo = obj.getcashmemo();

        por = df.palm_opd_registrations.Single(palm_opd_registration => palm_opd_registration.opd_code == TextBox21.Text);
        bill_master.cash_memo    = cashmemo;
        bill_master.pateint_code = por.pateint_code;
        bill_master.opd_code     = TextBox21.Text;
        bill_master.cash_memo    = cashmemo;
        bill_master.emp_id       = por.emp_code;
        bill_master.inserted_by  = Session["emp_code"].ToString();
        bill_master.inserted_on  = DateTime.Now;
        df.palm_opd_Bill_masters.InsertOnSubmit(bill_master);
        df.SubmitChanges();

        bill_master            = df.palm_opd_Bill_masters.Single(palm_opd_Bill_master => palm_opd_Bill_master.cash_memo == cashmemo);
        pde                    = df.palm_doctor_employees.Single(palm_doctor_employee => palm_doctor_employee.emp_code == bill_master.emp_id);
        bill_slave.opd_bill_id = bill_master.cash_memo;
        bill_slave.charge_name = "Consulting";
        bill_slave.description = "Consulting";
        bill_slave.units       = 1;
        bill_slave.amount      = pde.consulting_fees;
        df.palm_opd_Bill_slaves.InsertOnSubmit(bill_slave);
        df.SubmitChanges();


        Label00.Text = Convert.ToString(bill_master.cash_memo);
        Label81.Text = bill_master.opd_code;
        palm_department pd = new palm_department();

        pd            = df.palm_departments.Single(palm_department => palm_department.department_code == pde.department);
        Label02.Text  = pde.doctor_name;
        Label006.Text = pd.department_desc;
        ppm           = df.palm_pateint_masters.Single(palm_pateint_master => palm_pateint_master.pateint_code == bill_master.pateint_code);
        Label01.Text  = ppm.pateient_title + " ." + ppm.pateient_last_name + " " + ppm.pateient_first_name + " " + ppm.pateient_middle_name;
        Label84.Text  = ppm.gender;
        ppp           = df.palm_pateints_profiles.Single(palm_pateints_profile => palm_pateints_profile.pateint_code == bill_master.pateint_code);
        Label80.Text  = ppp.ref_doc;
        Label83.Text  = ppp.age;
        Label82.Text  = Convert.ToString(bill_master.inserted_on);
        bill_slave    = df.palm_opd_Bill_slaves.Single(palm_opd_Bill_slave => palm_opd_Bill_slave.opd_bill_id == bill_master.cash_memo);
        Label86.Text  = Convert.ToString(bill_slave.amount);
        Label001.Text = Convert.ToString(bill_slave.amount);
        Label90.Text  = Convert.ToString(bill_slave.amount);
        Label91.Text  = Convert.ToString(bill_slave.amount);

        MultiView1.ActiveViewIndex = 3;
    }