Exemplo n.º 1
0
        /// <summary>
        /// Добавляем операцию и предоперационный протокол
        /// </summary>
        /// <param name="toHospitalizationWorker"></param>
        /// <param name="fromOperationWorker"></param>
        /// <param name="toOperationWorker"></param>
        /// <param name="fromOperationProtocolWorker"></param>
        /// <param name="toOperationProtocolWorker"></param>
        /// <param name="fromOperationId"></param>
        /// <param name="toHospitalizationId"></param>
        public static void AddOperationAndProtocol(
            CHospitalizationWorker toHospitalizationWorker,
            COperationWorker fromOperationWorker,
            COperationWorker toOperationWorker,
            COperationProtocolWorker fromOperationProtocolWorker,
            COperationProtocolWorker toOperationProtocolWorker,
            int fromOperationId,
            int toHospitalizationId)
        {
            CHospitalization toHospitalization = toHospitalizationWorker.GetById(toHospitalizationId);

            var toOperation = new COperation(fromOperationWorker.GetById(fromOperationId))
            {
                Id                = toOperationWorker.GetNewID(),
                PatientId         = toHospitalization.PatientId,
                HospitalizationId = toHospitalizationId
            };

            toOperationWorker.Update(toOperation);

            // Добавляем предоперационный протокол
            toOperationProtocolWorker.GetByOperationId(toOperation.Id);
            var toOperationProtocol = new COperationProtocol(
                fromOperationProtocolWorker.GetByOperationId(fromOperationId))
            {
                OperationId = toOperation.Id
            };

            toOperationProtocolWorker.Update(toOperationProtocol);
        }
Exemplo n.º 2
0
        /// <summary>
        ///  Получить выделенную операцию
        /// </summary>
        /// <returns></returns>
        private COperation GetSelectedOperation()
        {
            int currentNumber = OperationList.CurrentCellAddress.Y;
            int selectedId    = Convert.ToInt32(OperationList.Rows[currentNumber].Cells[0].Value);

            return(_operationWorker.GetById(selectedId));
        }