Exemplo n.º 1
0
        private void addSectionButton_Click(object sender, EventArgs e)
        {
            string  sectionName     = sectionsTextBox.Text.Trim();
            Section existingSection = ezkoController.GetSectionByName(sectionName);

            if (existingSection != null)
            {
                BasicMessagesHandler.ShowInformationMessage("Sekcia s daným názvom už existuje");
            }
            else
            {
                if (MessageBox.Show("Naozaj si želáte vytvoriť novú sekciu " + sectionName + "?",
                                    "Upozornenie", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    if (ezkoController.CreateSection(sectionName))
                    {
                        existingSection = ezkoController.GetSectionByName(sectionName);
                        InitializeSectionsTextBox();
                        sectionsTextBox.Text = sectionName;
                        fieldsLabelText      = sectionName;
                        FillFieldDataGridView(existingSection.Fields);
                        lastPickedSection = existingSection;
                        FillSectionsDataGridView(ezkoController.GetSections());
                    }
                    else
                    {
                        BasicMessagesHandler.ShowInformationMessage("Pri vytváraní sekcie sa vyskytla chyba");
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void LoadEvents(DateTime selectionStart, DateTime selectionEnd)
        {
            try
            {
                if (loadDurations)
                {
                    LoadDurations(DateTime.Now.AddMonths(-6), DateTime.Now.AddYears(1));
                }

                eventsFlowLayoutPanel.Controls.Clear();
                foreach (var item in ezkoController.GetEvents(selectionStart, selectionEnd))
                {
                    CalendarEventCard card = new CalendarEventCard(item, visitUserControl,
                                                                   item.StateID == (int)DatabaseCommunicator.Enums.EventStateEnum.Payed);
                    card.Width = eventsFlowLayoutPanel.Width - 25;

                    //for AutoSize only in vertical direction
                    card.MaximumSize = new Size(eventsFlowLayoutPanel.Width - 25, 0);
                    card.MinimumSize = new Size(eventsFlowLayoutPanel.Width - 25, 0);

                    eventsFlowLayoutPanel.Controls.Add(card);
                }

                monthView.Invalidate();
            }
            catch (Exception e)
            {
                BasicMessagesHandler.ShowErrorMessage("Udalosti sa nepodarilo načítať", e);
            }
        }
Exemplo n.º 3
0
        public EventOverviewForm(CalendarEvent calendarEvent)
        {
            InitializeComponent();

            try
            {
                ezkoController     = GlobalSettings.EzkoController;
                this.calendarEvent = calendarEvent;

                patientName = calendarEvent.Patient.FullName;
                eventDate   = calendarEvent.StartDate.ToString("dd.MM.yyyy HH:mm");
                state       = calendarEvent.EventState.ToString().ToLower();
                if (calendarEvent.PaymentDate.HasValue)
                {
                    paymentDateLabel.Font  = new Font(paymentDateLabel.Font, FontStyle.Regular);
                    paymentDate            = calendarEvent.PaymentDate.Value.ToString("dd.MM.yyyy HH:mm");
                    payEventButton.Visible = false;
                }
                else if (calendarEvent.StateID != (int)EventStateEnum.Done)
                {
                    payEventButton.Visible = false;
                }

                doneText = calendarEvent.ExecutedActionText;

                InitializeDoneActionsGrid();
                InitializeBillingGrid();
            }
            catch (Exception ex)
            {
                BasicMessagesHandler.ShowErrorMessage("Pri načítaní podrobností o návšteve sa vyskytla chyba", ex);
            }
        }
Exemplo n.º 4
0
        private void addBudgetItemButton_Click(object sender, EventArgs e)
        {
            countSum += count;
            priceSum += (count * price);

            if (itemName != null)
            {
                int index = dataGridView.Rows.Count - 1;
                dataGridView.Rows.Insert(index, new object[]
                                         { itemName, GetCountString(), GetPriceString(), "", "x" });

                dataGridView.ClearSelection();
                dataGridView.Rows[index].Selected = true;

                //dataGridView.Rows.Insert(0, new object[]
                //{ itemName, GetCountString(), GetPriceString(), "", "x"});

                UpdateSumRow();
            }
            else
            {
                BasicMessagesHandler.ShowInformationMessage("Musíte zadať názov položky");
                itemNameTextBox.Focus();
            }
        }
Exemplo n.º 5
0
        private void dataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            DataGridView senderGrid = (DataGridView)sender;

            if (senderGrid.Columns[e.ColumnIndex] is DataGridViewButtonColumn && e.RowIndex >= 0)
            {
                Budget item = senderGrid.Rows[e.RowIndex].Tag as Budget;
                if (senderGrid.Columns[e.ColumnIndex].Name == "Edit")
                {
                    EditItem(item);
                }
                else if (senderGrid.Columns[e.ColumnIndex].Name == "Remove")
                {
                    RemoveItem(item);
                }
                else if (senderGrid.Columns[e.ColumnIndex].Name == "Pdf")
                {
                    string      path        = DirectoriesController.GetPatientDocumentsFolder(item.Patient) + @"\" + item.PdfFile();
                    BudgetToPDF budgetToPdf = new BudgetToPDF(path, item);
                    if (budgetToPdf.CreatePdf())
                    {
                        System.Diagnostics.Process.Start(path);
                    }
                    else
                    {
                        BasicMessagesHandler.ShowInformationMessage("Pri vytváraní PDF súboru sa vyskytla chyba");
                    }
                }
            }
        }
Exemplo n.º 6
0
        private bool ValidateData()
        {
            bool result = true;

            try
            {
                if (name == null)
                {
                    BasicMessagesHandler.ShowInformationMessage("Musíte zadať názov rozpočtu");
                    nameTextBox.Focus();
                    result = false;
                }
                else if (patient == null)
                {
                    BasicMessagesHandler.ShowInformationMessage("Musíte vybrať pacienta");
                    patientTextBox.Focus();
                    result = false;
                }
                else if (dataGridView.Rows.Count <= 1)
                {
                    BasicMessagesHandler.ShowInformationMessage("Rozpočet musí obsahovať aspoň jednu položku");
                    patientTextBox.Focus();
                    result = false;
                }
            }
            catch (Exception e)
            {
                result = false;
                BasicMessagesHandler.LogException(e);
            }

            return(result);
        }
Exemplo n.º 7
0
        private void UpdateData()
        {
            try
            {
                Cursor = Cursors.WaitCursor;
                if (ValidateData())
                {
                    List <BudgetItem> budgetItems = GetBudgetItems();
                    if (budgetItems == null || !ezkoController.EditBudget(budget, name, budgetItems))
                    {
                        BasicMessagesHandler.ShowErrorMessage("Počas úpravy rozpočtu sa vyskytla chyba");
                    }
                }
                else
                {
                    DialogResult = DialogResult.None;
                }
            }
            catch (Exception e)
            {
                BasicMessagesHandler.LogException(e);
            }

            Cursor = Cursors.Default;
        }
Exemplo n.º 8
0
        private void CreateData()
        {
            try
            {
                Cursor = Cursors.WaitCursor;
                if (ValidateData())
                {
                    List <EventBillItem> billItems = GetBillItems();

                    if (billItems == null)
                    {
                        DialogResult = DialogResult.None;
                    }
                    else
                    {
                        if (!ezkoController.CreateEventBill(calendarEvent, billItems))
                        {
                            DialogResult = DialogResult.None;
                            BasicMessagesHandler.ShowErrorMessage("Účet sa nepodarilo vytvoriť");
                        }
                    }
                }
                else
                {
                    DialogResult = DialogResult.None;
                }
            }
            catch (Exception e)
            {
                BasicMessagesHandler.LogException(e);
            }

            Cursor = Cursors.Default;
        }
Exemplo n.º 9
0
        private void CreateData()
        {
            try
            {
                Cursor = Cursors.WaitCursor;
                if (ValidateData())
                {
                    if (ezkoController.CreateSection(name))
                    {
                        BasicMessagesHandler.ShowInformationMessage("Sekcia EZKO bola úspešne vytvorená");
                    }
                    else
                    {
                        BasicMessagesHandler.ShowErrorMessage("Počas vytvárania sekcie EZKO sa vyskytla chyba");
                    }
                }
                else
                {
                    DialogResult = DialogResult.None;
                }
            }
            catch (Exception e)
            {
                BasicMessagesHandler.LogException(e);
            }

            Cursor = Cursors.Default;
        }
Exemplo n.º 10
0
        private bool ValidateData()
        {
            bool result = true;

            try
            {
                if (priceSum < 0)
                {
                    result = false;
                    BasicMessagesHandler.ShowInformationMessage("Hodnota výsledného účtu nesmie byť záp**ná!");
                }
                else if (calendarEvent == null)
                {
                    result = false;
                    BasicMessagesHandler.ShowInformationMessage("Nepodarilo sa načítať návštevu");
                }
            }
            catch (Exception e)
            {
                result = false;
                BasicMessagesHandler.LogException(e);
            }

            return(result);
        }
Exemplo n.º 11
0
        private List <EventBillItem> GetBillItems()
        {
            List <EventBillItem> result = new List <EventBillItem>();

            try
            {
                for (int row = 0; row < billingItemsGridView.RowCount - 1; row++)
                {
                    DataGridViewRow gridRow  = billingItemsGridView.Rows[row];
                    EventBillItem   billItem = new EventBillItem()
                    {
                        Name      = gridRow.Cells["Name"].Value.ToString().Trim(),
                        Count     = int.Parse(gridRow.Cells["Count"].Value.ToString().Split(new[] { ' ' })[0]),
                        UnitPrice = decimal.Parse(gridRow.Cells["Price"].Value.ToString().Split(new[] { ' ' })[0]),
                        Discount  = decimal.Parse(gridRow.Cells["Discount"].Value.ToString().Split(new[] { ' ' })[0])
                    };
                    result.Add(billItem);
                }
            }
            catch (Exception ex)
            {
                result = null;
                BasicMessagesHandler.ShowErrorMessage("Počas vytvárania položiek účtu sa vyskytla chyba!", ex);
            }

            return(result);
        }
Exemplo n.º 12
0
        private void CreateData()
        {
            try
            {
                Cursor = Cursors.WaitCursor;
                if (ValidateData())
                {
                    if (ezkoController.CreateInfrastructure(name, description, costs.Value, margin.Value))
                    {
                        BasicMessagesHandler.ShowInformationMessage("Infraštruktúra bola úspešne vytvorená");
                    }
                    else
                    {
                        BasicMessagesHandler.ShowErrorMessage("Počas vytvárania infraštruktúry sa vyskytla chyba");
                    }
                }
                else
                {
                    DialogResult = DialogResult.None;
                }
            }
            catch (Exception e)
            {
                BasicMessagesHandler.LogException(e);
            }

            Cursor = Cursors.Default;
        }
Exemplo n.º 13
0
        private bool ValidateData()
        {
            bool result = true;

            try
            {
                if (name == null || name.Length < 3)
                {
                    BasicMessagesHandler.ShowInformationMessage("Názov infraštruktúry musí mať aspoň 3 znaky!");
                    nameTextBox.Focus();
                    result = false;
                }
                else if (costs == null)
                {
                    BasicMessagesHandler.ShowInformationMessage("Musíte zadať výšku nákladov");
                    costsNumericUpDown.Focus();
                    result = false;
                }
                else if (margin == null)
                {
                    BasicMessagesHandler.ShowInformationMessage("Musíte zadať výšku marže");
                    marginNumericUpDown.Focus();
                    result = false;
                }
            }
            catch (Exception e)
            {
                result = false;
                BasicMessagesHandler.LogException(e);
            }

            return(result);
        }
Exemplo n.º 14
0
 private void EditFormularForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (DialogResult != DialogResult.OK && BasicMessagesHandler.ShowWarningMessage("Vykonané zmeny nebudú uložené, želáte si pokračovať?") != DialogResult.Yes)
     {
         e.Cancel = true;
     }
 }
Exemplo n.º 15
0
        private void LoadCard()
        {
            try
            {
                eventStatus = calendarEvent.EventState.ToString();
                if (!calendarEvent.IsTemporaryGoogleEvent)
                {
                    patientLabel.Visible = true;
                    patientName          = calendarEvent.Patient.FullName;
                }
                else
                {
                    patientLabel.Visible = false;
                    patientName          = calendarEvent.Summary;
                }
                noteTextLabel.Text     = calendarEvent.Description;
                noteTextLabel.Location = new Point(noteLabel.Location.X + noteLabel.Width, noteTextLabel.Location.Y);

                startTextLabel.Text  = calendarEvent.StartDate.ToString("dd-MM-yyyy, HH:mm");
                endTextLabel.Text    = calendarEvent.EndDate.ToString("dd-MM-yyyy, HH:mm");
                doctorTextLabel.Text = GetUsersLabel(calendarEvent.Users.Where(x => x.RoleID == (int)UserRoleEnum.Doctor));
                nurseTextLabel.Text  = GetUsersLabel(calendarEvent.Users.Where(x => x.RoleID == (int)UserRoleEnum.Nurse));

                SetPlannedActions(calendarEvent.Actions);
                SetInfrastructure(calendarEvent.Infrastructures);
                SetPatientImage(calendarEvent.Patient?.AvatarImagePath);
                SetBorderColor();
            }
            catch (Exception e)
            {
                BasicMessagesHandler.ShowErrorMessage("Návštevu sa nepodarilo načítať", e);
            }
        }
Exemplo n.º 16
0
        private bool ValidateData()
        {
            bool result = true;

            try
            {
                if (name == null)
                {
                    BasicMessagesHandler.ShowInformationMessage("Musíte zadať meno pacienta");
                    nameTextBox.Focus();
                    result = false;
                }
                else if (surname == null)
                {
                    BasicMessagesHandler.ShowInformationMessage("Musíte zadať priezvisko pacienta");
                    surnameTextBox.Focus();
                    result = false;
                }
                else if (BIFO != null && BIFO.Length != 10)
                {
                    BasicMessagesHandler.ShowInformationMessage("BIFO musí byť 10 znakový kód");
                    bifoTextBox.Focus();
                    result = false;
                }
            }
            catch (Exception e)
            {
                result = false;
                BasicMessagesHandler.LogException(e);
            }

            return(result);
        }
Exemplo n.º 17
0
        private bool ValidateData()
        {
            bool result = true;

            try
            {
                if (itemName == null)
                {
                    BasicMessagesHandler.ShowInformationMessage("Musíte zadať názov položky");
                    itemNameTextBox.Focus();
                    result = false;
                }
                else if (count <= 0)
                {
                    BasicMessagesHandler.ShowInformationMessage("Musíte zadať kladný počet");
                    countUpDown.Focus();
                    result = false;
                }
            }
            catch (Exception e)
            {
                result = false;
                BasicMessagesHandler.LogException(e);
            }

            return(result);
        }
Exemplo n.º 18
0
 private void LoadAction()
 {
     if (action == null)
     {
         return;
     }
     try
     {
         actionName        = action.Name;
         shortName         = action.ShortName;
         longName          = action.LongName;
         material          = action.Material;
         recommendedLength = action.RecommendedLength;
         costs             = action.Costs;
         margin            = action.Margin;
         if (action.Field != null)
         {
             field = action.Field;
         }
         insuranceCompany       = action.InsuranceCompany;
         insuranceCompanyMargin = action.InsuranceCompanyMargin;
         hasSpecification       = action.HasSpecification;
     }
     catch (Exception e)
     {
         BasicMessagesHandler.ShowErrorMessage("Pri načítavaní výkonu sa vyskytla chyba", e);
     }
 }
Exemplo n.º 19
0
        private void CreateData()
        {
            try
            {
                Cursor = Cursors.WaitCursor;
                if (ValidateData())
                {
                    List <BudgetItem> budgetItems = GetBudgetItems();
                    if (budgetItems != null && ezkoController.CreateBudget(name, patient, budgetItems))
                    {
                        BasicMessagesHandler.ShowInformationMessage("Rozpočet bol úspešne vytvorený");
                    }
                    else
                    {
                        BasicMessagesHandler.ShowErrorMessage("Počas vytvárania rozpočtu sa vyskytla chyba");
                    }
                }
                else
                {
                    DialogResult = DialogResult.None;
                }
            }
            catch (Exception e)
            {
                BasicMessagesHandler.LogException(e);
            }

            Cursor = Cursors.Default;
        }
Exemplo n.º 20
0
        private void CreateData()
        {
            try
            {
                Cursor = Cursors.WaitCursor;
                if (ValidateData())
                {
                    if (ezkoController.CreateAction(actionName, shortName, longName,
                                                    material, recommendedLength, costs, margin, insuranceCompanyMargin,
                                                    insuranceCompany, field, hasSpecification))
                    {
                        BasicMessagesHandler.ShowInformationMessage("Výkon bol úspešne vytvorený");
                    }
                    else
                    {
                        BasicMessagesHandler.ShowErrorMessage("Počas vytvárania výkonu sa vyskytla chyba");
                    }
                }
                else
                {
                    DialogResult = DialogResult.None;
                }
            }
            catch (Exception e)
            {
                BasicMessagesHandler.LogException(e);
            }

            Cursor = Cursors.Default;
        }
Exemplo n.º 21
0
        private List <BudgetItem> GetBudgetItems()
        {
            List <BudgetItem> result = new List <BudgetItem>();

            try
            {
                for (int i = 0; i < dataGridView.Rows.Count - 1; i++)
                {
                    DataGridViewRow gridRow    = dataGridView.Rows[i];
                    BudgetItem      budgetItem = new BudgetItem()
                    {
                        Name      = gridRow.Cells["Name"].Value.ToString(),
                        Count     = int.Parse(gridRow.Cells["Count"].Value.ToString().Split(new[] { ' ' })[0]),
                        UnitPrice = decimal.Parse(gridRow.Cells["Price"].Value.ToString().Split(new[] { ' ' })[0]),
                    };
                    result.Add(budgetItem);
                }
            }
            catch (Exception ex)
            {
                BasicMessagesHandler.ShowErrorMessage("Po4as vytvárania rozpočtu sa vyskytla chyba", ex);
                result = null;
            }

            return(result);
        }
Exemplo n.º 22
0
        private void UpdateData()
        {
            try
            {
                Cursor = Cursors.WaitCursor;
                if (ValidateData())
                {
                    if (!ezkoController.EditAction(action, actionName, shortName, longName,
                                                   material, recommendedLength, costs, margin, insuranceCompanyMargin,
                                                   insuranceCompany, field, hasSpecification))
                    {
                        BasicMessagesHandler.ShowErrorMessage("Počas úpravy výkonu sa vyskytla chyba");
                    }
                }
                else
                {
                    DialogResult = DialogResult.None;
                }
            }
            catch (Exception e)
            {
                BasicMessagesHandler.LogException(e);
            }

            Cursor = Cursors.Default;
        }
Exemplo n.º 23
0
        private void dataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                DataGridView senderGrid = (DataGridView)sender;

                if (senderGrid.Columns[e.ColumnIndex] is DataGridViewButtonColumn && e.RowIndex >= 0)
                {
                    if (senderGrid.Columns[e.ColumnIndex].Name == "Remove")
                    {
                        DataGridViewRow clickedRow    = senderGrid.Rows[e.RowIndex];
                        int             countToRemove = int.Parse(clickedRow.Cells["Count"].Value.ToString().Split(new[] { ' ' })[0]);
                        decimal         priceToRemove = decimal.Parse(clickedRow.Cells["Price"].Value.ToString().Split(new[] { ' ' })[0]);

                        countSum -= countToRemove;
                        priceSum -= (countToRemove * priceToRemove);

                        senderGrid.Rows.RemoveAt(e.RowIndex);

                        UpdateSumRow();
                    }
                }
            }
            catch (Exception ex)
            {
                BasicMessagesHandler.ShowErrorMessage("Pri pokuse o odstránenie položky sa vyskytla chyba", ex);
            }
        }
Exemplo n.º 24
0
        /// <summary>
        /// Returns path to supplied image in the EZKO directory structure for supplied user
        /// </summary>
        /// <param name="userName">Supplied user</param>
        /// <param name="imagePath">Original image path</param>
        //public static string GetEzkoUserImagePath(string userName, string imagePath)
        //{
        //    if (imagePath == null)
        //        return null;

        //    string imageName = Path.GetFileName(imagePath);
        //    return GetUserImageFolder(userName) + @"\" + imageName;
        //}

        /// <summary>
        /// Creates the EZKO directory structure for the supplied patient
        /// </summary>
        /// <param name="patient">Patient whose directory structure has to be created</param>
        /// <returns>Value indicating wheter the directory structure creation was succesful</returns>
        public static bool CreatePatientFolderStructure(Patient patient)
        {
            bool result = true;

            try
            {
                var path = GetPatientImageFolder(patient);
                if (!Directory.Exists(path))
                {
                    Directory.CreateDirectory(path);
                }

                path = GetPatientDocumentsFolder(patient);
                if (!Directory.Exists(path))
                {
                    Directory.CreateDirectory(path);
                }
            }
            catch (Exception e)
            {
                BasicMessagesHandler.LogException(e);
                result = false;
            }

            return(result);
        }
Exemplo n.º 25
0
        /// <summary>
        /// Marks database events which belong to deleted google calendar events as deleted
        /// </summary>
        private void MarkAsDeleted(DateTime startDate, DateTime endDate, List <CalendarItem> dbItems, List <CalendarItem> updateItems)
        {
            try
            {
                // Define parameters of request.
                EventsResource.ListRequest request = service.Events.List(calendarID);
                request.TimeMin      = startDate;
                request.TimeMax      = endDate;
                request.ShowDeleted  = false;
                request.SingleEvents = false;
                //request.MaxResults = 10;
                request.OrderBy = EventsResource.ListRequest.OrderByEnum.Updated;

                // List events
                Events events = request.Execute();

                foreach (var item in dbItems)
                {
                    if (events.Items.FirstOrDefault(x => x.Id == item.GoogleEventID) == null)
                    {
                        item.IsDeleted = true;

                        if (!updateItems.Contains(item))
                        {
                            updateItems.Add(item);
                        }
                    }
                }
            }
            catch (Exception e)
            {
                BasicMessagesHandler.ShowErrorMessage("Vyskytla sa chyba pri synchronizácií Google kalendára.", e);
            }
        }
Exemplo n.º 26
0
        private void CreateData()
        {
            try
            {
                Cursor = Cursors.WaitCursor;
                if (ValidateData())
                {
                    if (ezkoController.CreateField(name, standardNumber, otherName, fieldType, section, description, fieldValues, question))
                    {
                        BasicMessagesHandler.ShowInformationMessage("Pole EZKO bolo úspešne vytvorené");
                    }
                    else
                    {
                        BasicMessagesHandler.ShowErrorMessage("Počas vytvárania poľa EZKO sa vyskytla chyba");
                    }
                }
                else
                {
                    DialogResult = DialogResult.None;
                }
            }
            catch (Exception e)
            {
                BasicMessagesHandler.LogException(e);
            }

            Cursor = Cursors.Default;
        }
Exemplo n.º 27
0
        public void LoadEvents(CalendarEventFilter filter)
        {
            try
            {
                loadDurations = true;
                monthView.EventsDurationByDate = new Dictionary <DateTime, int>();
                eventsFlowLayoutPanel.Controls.Clear();
                foreach (var item in ezkoController.GetEvents(filter))
                {
                    CalendarEventCard card = new CalendarEventCard(item, visitUserControl,
                                                                   item.StateID == (int)DatabaseCommunicator.Enums.EventStateEnum.Payed);
                    card.Width = eventsFlowLayoutPanel.Width - 25;

                    //for AutoSize only in vertical direction
                    card.MaximumSize = new Size(eventsFlowLayoutPanel.Width - 25, 0);
                    card.MinimumSize = new Size(eventsFlowLayoutPanel.Width - 25, 0);

                    eventsFlowLayoutPanel.Controls.Add(card);

                    UpdateDurations(item.StartDate, item.EndDate, false);
                }

                monthView.Invalidate();
            }
            catch (Exception e)
            {
                BasicMessagesHandler.ShowErrorMessage("Udalosti sa nepodarilo načítať", e);
            }
        }
Exemplo n.º 28
0
        private void CreateUser()
        {
            if (ValidateData())
            {
                string rootDirectoryPath   = DirectoriesController.GetUserRootFolder(login);
                string ezkoAvatarImagePath = DirectoriesController.GetEzkoUserImagePath(login, avatarImagePath);

                //if creation of new user is succesful, we need co create EZKO directory
                //structure for newly created user and copy image to that location
                if (ezkoController.CreateUser(login, email, roleID, password, rootDirectoryPath, ezkoAvatarImagePath) &&
                    DirectoriesController.CreateUserFolderStructure(login) &&
                    DirectoriesController.CopyFile(avatarImagePath, ezkoAvatarImagePath))
                {
                    BasicMessagesHandler.ShowInformationMessage("Požívateľ bol úspešne vytvorený");
                }
                else
                {
                    BasicMessagesHandler.ShowErrorMessage("Pri vytváraní požívateľa sa vyskytla chyba");
                }
            }
            else
            {
                DialogResult = DialogResult.None;
            }
        }
Exemplo n.º 29
0
        public TmpForm()
        {
            InitializeComponent();

            //GlobalSettings.Load();
            BasicMessagesHandler.SetLogFilePath(GlobalSettings.LogFilePath);
        }
Exemplo n.º 30
0
        private void addFiledButton_Click(object sender, EventArgs e)
        {
            try
            {
                EditFieldForm form = new EditFieldForm();
                if (form.ShowDialog() == DialogResult.OK)
                {
                    section         = null;
                    fieldsLabelText = "Všetky sekcie";
                    FillFieldDataGridView(ezkoController.GetFields());

                    //if new field was added into edited formular
                    if (formular != null)
                    {
                        foreach (var item in formular.FieldForms.Where(x => !x.Field.IsDeleted))
                        {
                            if (formular.FieldForms.Any(x => x.Field.ID == item.Field.ID))
                            {
                                formEditor.UpdateFieldForm(item);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                BasicMessagesHandler.ShowErrorMessage("Pri vytváraní poľa EZKO sa vyskytla chyba", ex);
            }
        }