예제 #1
0
        public void InsertPrescription(DTO_ToaThuoc Prescription)
        {
            OracleCommand command = new OracleCommand($"{_dbSchema}.INSERT_TT", _conn);

            command.CommandType = CommandType.StoredProcedure;

            OracleParameter param1 = new OracleParameter("I_MADONTHUOC", OracleDbType.Varchar2);

            param1.Value = Prescription.MaDonThuoc;
            OracleParameter param2 = new OracleParameter("I_NGAYLAPDON", OracleDbType.Varchar2);

            param2.Value = Prescription.NgayLapDon;
            OracleParameter param3 = new OracleParameter("I_TRIEUCHUNG", OracleDbType.Int16);

            param3.Value = Prescription.TongTien;

            command.Parameters.Add(param1);
            command.Parameters.Add(param2);
            command.Parameters.Add(param3);

            try
            {
                _conn.Open();
                command.ExecuteNonQuery();
                _conn.Close();
            }
            catch (OracleException e)
            {
                _conn.Close();
                throw new Exception(e.Message);
            }
        }
예제 #2
0
        public List <DTO_ToaThuoc> GetPrescriptionByMakhambenh(string MKB)
        {
            List <DTO_ToaThuoc> result = new List <DTO_ToaThuoc>();
            DataTable           data   = DAO_ToaThuoc.Instance.GetPrescriptionByMaKhamBenh(MKB);

            foreach (DataRow row in data.Rows)
            {
                DTO_ToaThuoc tmpObject = new DTO_ToaThuoc();
                tmpObject.MaDonThuoc = row["MADONTHUOC"].ToString();
                tmpObject.NgayLapDon = row["NGAYLAPDON"].ToString();

                tmpObject.TongTien   = double.Parse(row["TONGTIEN"].ToString());
                tmpObject.MaKhamBenh = row["MAKHAMBENH"].ToString();
                result.Add(tmpObject);
            }
            return(result);
        }