예제 #1
0
        public List <ReceiptInfoModel> GetList()
        {
            DbConnect_init();
            string sql = "select patient_id,name ,patient_classification,doctor_in_charge,diagnostic_experience " +
                         "from RECEIPTINFO inner join PATIENTINFO On patient_id = id ";

            OracleCommand comm = new OracleCommand();

            comm.Connection  = conn;
            comm.CommandText = sql;

            OracleDataReader        reader            = comm.ExecuteReader(CommandBehavior.CloseConnection);
            List <ReceiptInfoModel> receiptInfoModels = new List <ReceiptInfoModel>();


            while (reader.Read())
            {
                ReceiptInfoModel receiptInfoModel = new ReceiptInfoModel();
                receiptInfoModel.patient_name           = reader.GetString(reader.GetOrdinal("name"));
                receiptInfoModel.patient_id             = reader.GetInt32(reader.GetOrdinal("patient_id"));
                receiptInfoModel.patient_classification = reader.GetString(reader.GetOrdinal("patient_classification"));
                receiptInfoModel.doctor_in_charge       = reader.GetString(reader.GetOrdinal("doctor_in_charge"));
                receiptInfoModel.diagnostic_experience  = reader.GetString(reader.GetOrdinal("diagnostic_experience"));

                receiptInfoModels.Add(receiptInfoModel);
            }
            reader.Close();
            return(receiptInfoModels);
        }
        public JsonNetResult SaveReceipt(ReceiptInfoModel receipt)
        {
            if (receipt == null)
            {
                throw new ArgumentNullException("The receipt is null.");
            }

            if (!this.ValidateReceipt(receipt))
            {
                return(JsonNet(new ResponseResult(false, "The receipt is invalid.", ErrorCodes.RequireField)));
            }

            var entity = new ReceiptInfoEntity
            {
                Id         = receipt.Id,
                Title      = receipt.Title,
                Tax        = receipt.Tax,
                HospitalId = receipt.HospitalId
            };

            new ReceiptInfoService().Save(entity);

            receipt.Id = entity.Id;
            return(JsonNet(new ResponseResult(true, receipt)));
        }
예제 #3
0
        public bool Insert(ReceiptInfoModel objNewreceiptInfo)
        {
            if (objNewreceiptInfo.patient_id == 0)
            {
                return(false);
            }
            DbConnect_init();
            String sql =
                "INSERT INTO receiptInfo" +
                "(patient_id, patient_classification, doctor_in_charge, series, diagnostic_experience, last_visit, receipt_memo, reservation_time) VALUES " +
                "('" + objNewreceiptInfo.patient_id + "', '" + objNewreceiptInfo.patient_classification + "', '" + objNewreceiptInfo.doctor_in_charge + "', '" + objNewreceiptInfo.series + "'," +
                " '" + objNewreceiptInfo.diagnostic_experience + "', '" + objNewreceiptInfo.last_visit + "', '" + objNewreceiptInfo.receipt_memo + "', '" + objNewreceiptInfo.reservation_time + "')";


            OracleCommand comm = new OracleCommand();

            comm.Connection  = conn;
            comm.CommandText = sql;

            try
            {
                comm.ExecuteNonQuery();
            }
            catch (Exception error)
            {
                conn.Close();
                return(false);
            }
            conn.Close();
            return(true);
        }
예제 #4
0
 // receiptInfo 모델 복사
 public void CopyData(ReceiptInfoModel param)
 {
     this.patient_id             = param.patient_id;
     this.patient_classification = param.patient_classification;
     this.doctor_in_charge       = param.doctor_in_charge;
     this.series = param.series;
     this.diagnostic_experience = param.diagnostic_experience;
     this.last_visit            = param.last_visit;
     this.receipt_memo          = param.receipt_memo;
     this.reservation_time      = param.reservation_time;
 }
        private bool ValidateReceipt(ReceiptInfoModel receipt)
        {
            if (string.IsNullOrEmpty(receipt.Title))
            {
                return(false);
            }

            if (receipt.Tax < 0)
            {
                return(false);
            }

            return(true);
        }
예제 #6
0
 private void OnclickReceiptCommend()
 {
     ReceiptInfo.patient_id = PatientInfo.id;
     if (ObjRececiptInfoService.Insert(ReceiptInfo))
     {
         MessageBox.Show("접수되었습니다.");
         Receipted   = ObjRececiptInfoService.GetList();
         ReceiptInfo = new ReceiptInfoModel();
     }
     else
     {
         MessageBox.Show("입력정보를 확인해주세요");
     }
 }
예제 #7
0
        public ReceiptInfoModel GetOrderInfo(int orderId)
        {
            using (var connection = new MySqlConnection(this.connectionString))
            {
                var orderInfo = connection.QuerySingleOrDefault <OrderInfoModel>("SELECT * FROM Orders WHERE id = @orderId;", new { orderId });

                var orderRows = connection.Query <OrderRowsModel>("SELECT * FROM OrderRows WHERE orderid = @orderId;", new { orderId }).ToList();

                var receiptInfo = new ReceiptInfoModel();
                receiptInfo.OrderInfo = orderInfo;
                receiptInfo.OrderRows = orderRows;

                return(receiptInfo);
            }
        }
예제 #8
0
        public ReceiptManageViewModel()
        {
            ObjPatientInfoService  = new PatientInfoService();
            ObjRececiptInfoService = new ReceiptInfoService();
            OnclickSearchCommand   = new RelayCommand(OnclickSearchCommend, null);
            OnclickNewCommand      = new RelayCommand(OnclickNewCommend, null);
            OnclickSaveCommand     = new RelayCommand(OnclickSaveCommend, null);
            OnclickModifyCommand   = new RelayCommand(OnclickModifyCommend, null);
            OnclickDeleteCommand   = new RelayCommand(OnclickDeleteCommend, null);

            OnclickReceiptCommand            = new RelayCommand(OnclickReceiptCommend, null);
            OnclickReceiptModifyCommand      = new RelayCommand(OnclickReceiptModifyCommend, null);
            OnclickReceiptReservationCommand = new RelayCommand(OnclickReceiptReservationCommend, null);
            PatientInfo = new PatientInfoModel();
            ReceiptInfo = new ReceiptInfoModel();
            Receipted   = new List <ReceiptInfoModel>();
            ReadOn      = true;
            Comboclick  = false;
            Receipted   = ObjRececiptInfoService.GetList();
        }