public CashRegisterWindow(Model.User userLoggedIn, Model.Statement statement, Model.Patient patient)
		{
			this.InitializeComponent();

            FillPatients();

            _userLoggedIn = userLoggedIn;
            _statement = statement;
            _selectedPatient = patient;
            _isStatement = _statement != null;

            if (_statement != null)
            {
                this.Title = "Abonar/Liquidar estado de cuenta";
                lblAccountStatusNumber.ToolTip = lblAccountStatusNumber.Content = _statement.StatementId.ToString();
                gbAccountStatusNumber.Visibility = System.Windows.Visibility.Visible;
                btnClearForm.Visibility = System.Windows.Visibility.Hidden;
                cbPatients.IsEnabled = false;
                FillTreatments();
                FillPayments();

                SelectPatient();
            }
            else
            {
                gbAccountStatusNumber.Header = "Estado de cuenta activo";
            }

            UpdateTotals();
        }
        public AddInstrumentTreatmentsModal(Model.Instrument instrument)
        {
            this.InitializeComponent();

            _instrument = instrument;
            FillTreatments();
        }
示例#3
0
		public void Initialize()
		{
			var lightBarrier1 = new LightBarrier(position: 200);
			var lightBarrier2 = new LightBarrier(position: 400);

			var detectorLeft = new OverheadDetector(Lane.Left, position: 400);
			var detectorRight = new OverheadDetector(Lane.Right, position: 400);
			var detectorFinal = new OverheadDetector(Lane.Left, position: 600);

			var trafficLights = new TrafficLights();

			var preControl = new OriginalPreControl(lightBarrier1);
			var mainControl = new OriginalMainControl(lightBarrier2, detectorLeft, detectorRight, timeout: 30);
			var endControl = new OriginalEndControl(detectorFinal, timeout: 10);

			var vehicle1 = new Vehicle(VehicleKind.OverheightTruck);
			var vehicle2 = new Vehicle(VehicleKind.Truck);
			var vehicle3 = new Vehicle(VehicleKind.OverheightTruck);

			var heightControl = new HeightControl(preControl, mainControl, endControl, trafficLights);
			var vehicles = new VehicleCollection(vehicle1, vehicle2, vehicle3);

			_model = new Model();
			_model.AddRootComponents(heightControl, vehicles);

			Bind(vehicles, lightBarrier1);
			Bind(vehicles, lightBarrier2);
			Bind(vehicles, detectorLeft);
			Bind(vehicles, detectorRight);
			Bind(vehicles, detectorFinal);

			_model.Bind(vehicles.RequiredPorts.IsTunnelClosed = trafficLights.ProvidedPorts.IsRed);
		}
        public ChangeCleanedActionModal(Model.CleanedMaterial cleanedMaterialToUpdate, CleaningType cleaningTypeToUpdate, Model.User userLoggedIn)
		{
			this.InitializeComponent();

            _userLoggedIn = userLoggedIn;
            _cleanedMaterialToUpdate = cleanedMaterialToUpdate;
            txtDate.ToolTip = txtDate.Text = DateTime.Now.ToString("dd/MMMM/yyyy");

            _cleaningTypeToUpdate = cleaningTypeToUpdate;

            switch (_cleaningTypeToUpdate)
            {
                case CleaningType.CLEANED:
                    this.Title += "Lavado";
                    break;
                case CleaningType.PACKAGED:
                    this.Title += "Empaquetado";
                    break;
                case CleaningType.STERILIZED:
                    this.Title += "Esterilizado";
                    txtGroup.ToolTip = txtGroup.Text = GetNextGroupLetter();
                    break;
                default:
                    break;
            }
		}
        public MainWindow(Model.User userLoggedIn)
        {
            CheckGlobalConfigurations();

            this.InitializeComponent();

            _userLoggedIn = userLoggedIn;
            HideButtonsForNonAdminUsers();
            lblLoggedIn.ToolTip = lblLoggedIn.Content = _userLoggedIn.FirstName + " " + _userLoggedIn.LastName;
            lblLoggedIn.FontWeight = _userLoggedIn.IsAdmin ? FontWeights.Bold : lblLoggedIn.FontWeight;

            RefreshMedicinesStackPanel();
            RefreshDotationsStackPanel();

            _checkExpiredStatementsThread = new Thread(CheckExpiredStatements);
            _checkExpiredStatementsThread.SetApartmentState(ApartmentState.STA);
            _checkExpiredStatementsThread.IsBackground = true;
            _checkExpiredStatementsThread.Start();

            _checkFinishedEventsThread = new Thread(CheckFinishedEvents);
            _checkFinishedEventsThread.SetApartmentState(ApartmentState.STA);
            _checkFinishedEventsThread.IsBackground = true;
            _checkFinishedEventsThread.Start();

            _checkRemindersThread = new Thread(RefreshReminders);
            _checkRemindersThread.SetApartmentState(ApartmentState.STA);
            _checkRemindersThread.IsBackground = true;
            _checkRemindersThread.Start();
        }
        public ManageTreatmentPricesWindow(Model.User userLoggedIn)
		{
			this.InitializeComponent();

            _userLoggedIn = userLoggedIn;
            dtudSelectedYear.Value = DateTime.Now;
            UpdateAllGrid();
        }
        public DrawerControl(Model.Drawer selectedDrawer, Model.User userLoggedIn)
		{
			this.InitializeComponent();

            _selectedDrawer = selectedDrawer;
            _userLoggedIn = userLoggedIn;

            FillDrawerInformation();
		}
        public FinishedEventsControl(Model.Event eventToRender, Model.User userLoggedIn)
		{
			this.InitializeComponent();

            _userLoggedIn = userLoggedIn;
            _eventToRender = eventToRender;
            _schedulerEvent = new WpfScheduler.Event() { EventInfo = _eventToRender };

            LoadEventInfo();
		}
        public ViewPaymentFolioDetailWindow(Model.PaymentFolio folio, Model.User userLoggedIn)
        {
            this.InitializeComponent();

            _folio = folio;
            _userLoggedIn = userLoggedIn;

            lblPatientName.ToolTip = lblPatientName.Content = string.Format("(Exp. No. {0}) {1} {2}", _folio.Patient.AssignedId, _folio.Patient.FirstName, _folio.Patient.LastName);
            lblFolioNumber.ToolTip = lblFolioNumber.Content = _folio.FolioNumber.ToString();

            UpdateFolioInfo();
        }
        public AddEditBudgetDetailsModal(Model.BudgetDetail budgetDetailToUpdate)
		{
			this.InitializeComponent();

            _budgetDetailToUpdate = budgetDetailToUpdate;
            _isUpdateBudgetDetial = _budgetDetailToUpdate.BudgetDetailId != -1;
            FillTreatments();

            if (_isUpdateBudgetDetial)
            {
                PrepareWindowForUpdates();
            }
		}
        public AddEditInitialDentalNoteWindow(Model.Patient patientToUpdate)
		{
			this.InitializeComponent();

            FillTreatments();
            AddEmptyItemToComboBoxes();

            _patientToUpdate = patientToUpdate;
            _isUpdateDentalInitialNote = patientToUpdate != null;

            if (_isUpdateDentalInitialNote)
                PrepareWindowForUpdates();
		}
        public ViewStatementWindow(Model.Statement statement, Model.User userLoggedIn)
        {
            this.InitializeComponent();

            _statement = statement;
            _userLoggedIn = userLoggedIn;

            lblPatientName.ToolTip = lblPatientName.Content = string.Format("(Exp. No. {0}) {1} {2}", _statement.Patient.AssignedId, _statement.Patient.FirstName, _statement.Patient.LastName);
            lblAccountStatusNumber.ToolTip = lblAccountStatusNumber.Content = _statement.StatementId.ToString();

            UpdateStatementInfo();
            LoadPatientPicture();
        }
        public AddEventModal(WpfScheduler.Scheduler scheduler, DateTime eventStart, Model.User userLoggedIn)
		{
			this.InitializeComponent();

            _scheduler = scheduler;
            _eventStart = eventStart;
            _userLoggedIn = userLoggedIn;

            this.Title = "Agendar cita (" + eventStart.ToString("D") + ")";
            lblEventStartTime.ToolTip = lblEventStartTime.Text = eventStart.ToString("HH:mm") + " hrs";

            FillPatients();
            FillTreatments();
		}
        public AddEditOutgoingInvoicesModal(Model.OutgoingInvoice invoiceToUpdate)
		{
			this.InitializeComponent();

            _invoiceToUpdate = invoiceToUpdate;
            _isUpdateInvoice = invoiceToUpdate != null;
            dtpPaidDate.SelectedDate = dtpInvoiceDate.SelectedDate = DateTime.Now;
            FillPatients();

            if (_isUpdateInvoice)
            {
                PrepareWindowForUpdates();
            }
        }
        public AddEditReceivedInvoicesModal(Model.ReceivedInvoice invoiceToUpdate)
		{
			this.InitializeComponent();

            _invoiceToUpdate = invoiceToUpdate;
            _isUpdateInvoice = invoiceToUpdate != null;
            dtpPurchaseDate.SelectedDate = dtpInvoiceDate.SelectedDate = DateTime.Now;
            dtpInvoiceDate.SelectedDate = null;
            FillProviderComboBox();

            if (_isUpdateInvoice)
            {
                PrepareWindowForUpdates();
            }
        }
        public AgendaWindow(Model.User userLoggedIn)
        {
            InitializeComponent();

            InitializeEventStatusFilters();

            _userLoggedIn = userLoggedIn;
            scheduler.UserLoggedIn = _userLoggedIn;
            lblLoggedIn.ToolTip = lblLoggedIn.Content = _userLoggedIn.FirstName + " " + _userLoggedIn.LastName;
            lblLoggedIn.FontWeight = _userLoggedIn.IsAdmin ? FontWeights.Bold : lblLoggedIn.FontWeight;

            calendar.SelectedDate = DateTime.Now;

            SetSchedulerColors();
        }
        public AddEditTreatmentPaymentModal(Model.TreatmentPayment treatment, TreatmentPriceControl treatmentControl)
		{
			this.InitializeComponent();

            cbDiscount.SelectedIndex = 0;
            _treatmentControl = treatmentControl;
            _treatment = treatment;
            _isUpdateTreatment = _treatment != null;
            
            if (_isUpdateTreatment)
            {
                PrepareWindowForUpdates();
                UpdateTotalFieldChanged();
            }
		}
        public AddEditLaboratoryWorksModal(Model.LaboratoryWork laboratoryWorkToUpdate)
		{
			this.InitializeComponent();

            _laboratoryWorkToUpdate = laboratoryWorkToUpdate;
            _isUpdateLaboratoryWork = laboratoryWorkToUpdate != null;
            dtpDeliveryDate.SelectedDate = DateTime.Now;
            FillPatients();
            FillTechnicals();

            if (_isUpdateLaboratoryWork)
            {
                PrepareWindowForUpdates();
            }
		}
        public CanceledEventsSendEmailModal(List<Model.Event> canceledEventsInARow, List<Model.Event> canceledEventsOfSameTreatment, Model.Patient patient, Model.Treatment treatment)
        {
            this.InitializeComponent();

            _canceledEventsInARow = canceledEventsInARow;
            _canceledEventsOfSameTreatment = canceledEventsOfSameTreatment;
            _patient = patient;
            _treatment = treatment;

            lblEmailLogMessage.Content = string.Format("Enviando correo(s) al paciente {1} {2} (Exp. No. {0})\npor los siguientes motivos:\n", _patient.AssignedId, _patient.FirstName, _patient.LastName);
            lblEmailLogMessage.Content += _canceledEventsInARow == null 
                                                ? string.Empty 
                                                : "\n- 3 citas canceladas consecutivas.";
            lblEmailLogMessage.Content += _canceledEventsOfSameTreatment == null 
                                                ? string.Empty
                                                : string.Format("\n- 3 citas canceladas para el tratamiento de '{0}'.", _treatment.Name);
        }
        public AddEditPaymentModal(Model.Payment paymentToUpdate, PaymentType paymentType, PaymentControl paymentControl, Model.Bank bank)
		{
			this.InitializeComponent();

            _bank = bank;
            _paymentControl = paymentControl;
            _paymentType = paymentType;
            _paymentToUpdate = paymentToUpdate;
            _isUpdatePayment = _paymentToUpdate != null;

            FillBanks();
            AdjustWindowForPaymentType();

            if (_isUpdatePayment)
            {
                PrepareWindowForUpdates();
            }

            this.Title += " (" + paymentType.ToString() + ")";
        }
示例#21
0
        public ActionResult MeusDados(Model.UsuarioModel model)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    using (Web.UsuarioProxy.UsuarioServiceClient proxy = new Web.UsuarioProxy.UsuarioServiceClient())
                    {
                        proxy.Update(model);
                    }

                    return RedirectToAction("Index");
                }
            }
            catch (Exception ex)
            {
                Utils.HelperLog.WriteText(ex, "HomeController.MeusDados[POST]");
            }
            return View(model);
        }
 private void FillRectangleColor(Xceed.Wpf.Toolkit.ColorPicker cpEvents, Model.Configuration eventColor)
 {
     if (eventColor != null)
     {
         cpEvents.Background = (SolidColorBrush)(new BrushConverter().ConvertFrom(eventColor.Value));
     }
 }
 private void AddInvoice(Model.OutgoingInvoice invoiceToAdd)
 {
     if (Controllers.BusinessController.Instance.Add<Model.OutgoingInvoice>(invoiceToAdd))
     {
         this.Close();
     }
     else
     {
         MessageBox.Show("No se pudo agregar la factura", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }
 private void UpdateInvoice(Model.OutgoingInvoice invoiceToUpdate)
 {
     if (Controllers.BusinessController.Instance.Update<Model.OutgoingInvoice>(invoiceToUpdate))
     {
         this.Close();
     }
     else
     {
         MessageBox.Show("No se pudo actualizar la factura", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }
        private bool AreValidFields(string amountText, Model.Bank bank, string voucherCheckNumber, out decimal amount)
        {
            amount = 0;

            if (decimal.TryParse(amountText, out amount) == false)
	        {
		        MessageBox.Show("Cantidad inválida", "Información", MessageBoxButton.OK, MessageBoxImage.Information);
                return false;
	        }
            else if (amount <= 0m)
            {
                MessageBox.Show("La cantidad debe ser mayor a 0", "Información", MessageBoxButton.OK, MessageBoxImage.Information);
                return false;
            }

            if (_paymentType != PaymentType.Efectivo)
            {
                if (bank == null)
                {
                    MessageBox.Show("Seleccione un banco", "Información", MessageBoxButton.OK, MessageBoxImage.Information);
                    return false;
                }

                if (string.IsNullOrEmpty(voucherCheckNumber))
                {
                    MessageBox.Show("Ingrese un " + lblVoucherCheckNumber.Content.ToString().Replace(":", ""), "Información", MessageBoxButton.OK, MessageBoxImage.Information);
                    return false;
                }
            }

            return true;
        }
        private IElement GetPatinetInfo(Model.Patient selectedPatient, out string gender)
        {
            var paragraph = new iTextSharp.text.Paragraph(new Chunk("NOMBRE DEL PACIENTE: ", _boldFont));
            paragraph.Add(new Chunk(selectedPatient.FullName, _font));
            gender = GetNote("Genero");

            string patientInfo = string.Format("\nPaciente {0} de {1} años de edad, acude a consulta por {2}",
                                                gender,
                                                GetNote("Edad"),
                                                GetNote("Motivo de la consulta")
                                                );

            paragraph.Add(new Chunk(patientInfo, _font));
            return paragraph;
        }
        private iTextSharp.text.Paragraph GetNotaInicialDentalPdfContent(Model.Patient selectedPatient)
        {
            string gender = string.Empty;
            var paragraph = new iTextSharp.text.Paragraph("");

            paragraph.Add(GetTitle());
            paragraph.Add(new iTextSharp.text.Paragraph(" "));
            paragraph.Add(GetPatinetInfo(selectedPatient, out gender));
            paragraph.Add(new iTextSharp.text.Paragraph(" "));
            paragraph.Add(GetAntecedentesHeredofamiliares());
            paragraph.Add(new iTextSharp.text.Paragraph(" "));
            paragraph.Add(GetAntecedentesPersonalesNoPatologicos());
            paragraph.Add(new iTextSharp.text.Paragraph(" "));
            paragraph.Add(GetAntecedentesGinecoObstetricos(gender));
            paragraph.Add(new iTextSharp.text.Paragraph(" "));
            paragraph.Add(GetAntecedentesPersonalesPatologicos());
            paragraph.Add(new iTextSharp.text.Paragraph(" "));
            paragraph.Add(GetAntecedentesPadecimientoActual());
            paragraph.Add(new iTextSharp.text.Paragraph(" "));
            paragraph.Add(GetExploracionFisica());
            paragraph.Add(new iTextSharp.text.Paragraph(" "));
            paragraph.Add(GetMusculosPalpacion());
            paragraph.Add(new iTextSharp.text.Paragraph(" "));
            paragraph.Add(GetExploracionFisica2());
            paragraph.Add(GetFluorosis());
            paragraph.Add(new iTextSharp.text.Paragraph(" "));
            paragraph.Add(GetMaloclusiones());
            paragraph.Add(GetRetencionesDentarias());
            paragraph.Add(new iTextSharp.text.Paragraph(" "));
            paragraph.Add(GetTratamientos());
            paragraph.Add(new iTextSharp.text.Paragraph(" "));
            paragraph.Add(GetFirma());

            return paragraph;
        }
        private void ExportToPdf(string path, Model.Patient selectedPatient)
        {
            _initialDentalNote = BusinessController.Instance.FindBy<Model.InitialDentalNote>(p => p.PatientId == selectedPatient.PatientId).ToList();

            iTextSharp.text.Paragraph pdfContent = GetNotaInicialDentalPdfContent(selectedPatient); 

            //Create the PDF Document
            using (Document pdfDoc = new Document(PageSize.A4, 10f, 10f, 10f, 10f))
            {
                using (FileStream fs = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.None))
                {
                    using (var writer = PdfWriter.GetInstance(pdfDoc, fs))
                    {
                        pdfDoc.Open();

                        //byte[] pngByteArrayImage = MainWindow.ImageToByteArray("pack://application:,,,/MyDentApplication;component/Images/Budget_image_1.PNG");
                        //iTextSharp.text.Image pngImage = iTextSharp.text.Image.GetInstance(pngByteArrayImage);
                        //pngImage.ScalePercent(80f);
                        //pngImage.SetAbsolutePosition(10f, pdfDoc.PageSize.Height - 90f);
                        //pdfDoc.Add(pngImage);

                        pdfDoc.Add(pdfContent);

                        pdfDoc.Close();
                    }
                }
            }
        }
        public static Model.Event OverlappedWithExistingEvent(Model.Event eventToAdd, List<WpfScheduler.Event> events)
        {
            events = events.Where(e => e.EventInfo.IsCanceled == false && e.EventInfo.PatientSkips == false)
                            .OrderBy(e => e.EventInfo.StartEvent)
                            .ToList();

            foreach (WpfScheduler.Event e in events)
            {
                if (Utils.IsOverlappedTime(eventToAdd.StartEvent, eventToAdd.EndEvent, e.EventInfo.StartEvent, e.EventInfo.EndEvent))
                {
                    return e.EventInfo;
                }
            }

            return null;
        }
 private void UpdateLaboratoryWork(Model.LaboratoryWork laboratoryWorkToUpdate)
 {
     if (Controllers.BusinessController.Instance.Update<Model.LaboratoryWork>(laboratoryWorkToUpdate))
     {
         this.Close();
     }
     else
     {
         MessageBox.Show("No se pudo actualizar el trabajo de laboratorio", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
     }
 }