Exemplo n.º 1
0
        public static void SaveNewPresc(PrescDetail newPresc)
        {
            cmdString = new OracleCommand();

            try
            {
                cntString.Open();

                cmdString.Connection  = cntString;
                cmdString.CommandText = "TESTSP_PRESC";
                cmdString.CommandType = CommandType.StoredProcedure;

                cmdString.ArrayBindCount = newPresc.MedID.Length;


                cmdString.Parameters.Add("@PARA_PREID", OracleDbType.Varchar2).Value = newPresc.PrescID;

                //cmdString.Parameters.Add("@PARA_MEDID", OracleDbType.Varchar2);
                //cmdString.Parameters[0].Value = newPresc.MedID;
                cmdString.Parameters.Add("@PARA_MEDID", OracleDbType.Varchar2).Value = newPresc.MedID;


                //cmdString.Parameters.Add("@PARA_MEDQTY", OracleDbType.Varchar2);
                //cmdString.Parameters[1].Value = newPresc.MedQty;
                cmdString.Parameters.Add("@PARA_MEDQTY", OracleDbType.Varchar2).Value = newPresc.MedQty;

                cmdString.ExecuteNonQuery();
            }

            finally
            {
                cntString.Close();
            }
        }
Exemplo n.º 2
0
        protected void save(object sender, EventArgs e)
        {
            // Populating array of Prescription ID, same length of Medication IDs and Medication Quantities
            string TPrescID = displayPrescID.Text;

            string[] PrescID = new string[MediArray.Length];
            for (int i = 0; i < MediArray.Length; i++)
            {
                PrescID[i] = TPrescID;
            }

            PrescDetail newPrescDetails = new PrescDetail(PrescID, MediIDArray, MediQtyArray);

            try
            {
                ConnectionClass.SaveNewPresc(newPrescDetails);

                ClientScript.RegisterStartupScript(GetType(), "message", "<script>alert(' Prescription saved successfully! ');</script>");
            }
            catch
            {
                ClientScript.RegisterStartupScript(GetType(), "message", "<script>alert(' Cancelled ');</script>");
            }
        }