Exemplo n.º 1
0
        protected void saveAppointment_Click(object sender, EventArgs e)
        {
            VetID        = vetIDList.SelectedValue.ToString();
            PetID        = petIDList.SelectedValue.ToString();
            VetApptTime  = year.SelectedItem.ToString() + month.SelectedItem.ToString() + day.SelectedItem.ToString() + time.SelectedItem.ToString();
            VetApptNote  = note.Text;
            VetApptPrice = price.Text;

            VetAppointment newVetAppointment = new VetAppointment(VetID, PetID, VetApptTime, VetApptNote, VetApptPrice);

            try
            {
                ConnectionClass.ConfirmNewAppointment(newVetAppointment);
                Response.Write("<script type='text/javascript'>");
                Response.Write("alert('New Appointment Saved Successfully! ');");
                Response.Write("</script>");
            }

            catch
            {
                Response.Write("<script type='text/javascript'>");
                Response.Write("alert('Please check required fields again. ');");
                Response.Write("</script>");
            }

            finally
            {
            }
        }
Exemplo n.º 2
0
        public static void ConfirmNewAppointment(VetAppointment newappt)
        {
            string jQuery = string.Format(@"INSERT INTO VET_APPOINTMENT (ID,VET_ID,PET_ID,DATE_TIME,NOTES,PRICE,DISCOUNT)
VALUES(VETAPPT_ID_SEQ.nextval,'{0}','{1}',TO_DATE('{2}','YYYYMONDDHH24:MI'),'{3}','{4}',SEARCHDISCOUNT({1}))", newappt.VetID, newappt.PetID, newappt.VetApptTime, newappt.VetApptNote, newappt.VetApptPrice);

            // Convert.ToInt64
            // SEARCHDISCOUNT : function

            cmdString = new OracleCommand(jQuery, cntString);

            try
            {
                cntString.Open();
                cmdString.ExecuteNonQuery();
            }

            finally
            {
                cntString.Close();
            }
        }