Пример #1
0
 public IHttpActionResult Post([FromBody] AgendaForm model)
 {
     using (var repository = new AgendaRepository())
     {
         try
         {
             return(Ok(CreateResponse(true, "Agendamento realizado com sucesso", repository.SalvarAgendamento(model))));
         }
         catch (System.Exception ex)
         {
             return(Content(HttpStatusCode.BadRequest, CreateResponse(false, "Erro ao salvar o agendamento", ex.Message)));
         }
     }
 }
Пример #2
0
        private void Agenda_button_Click(object sender, EventArgs e)
        {
            AgendaForm form = new AgendaForm(Administration.User, CalendarEventAdministration);

            form.Agenda_monthCalendar_DateChanged(null, null);
            this.Visible = false;
            var closing = form.ShowDialog();

            if (closing == DialogResult.OK)
            {
                this.CalendarEventAdministration = form.CalendarEventAdministration;
                WriteToBinaryFile <List <CalendarEvent> >(@"Agenda.bin", CalendarEventAdministration.Agenda);
                UserRefresh();
                this.Visible = true;
            }
        }
Пример #3
0
        private void AgendaItem_Load(object sender, EventArgs e)
        {
            AgendaForm _AgendaForm = new AgendaForm();

            cProjects.Items.Clear();
            cClient.Items.Clear();
            cActivity.Items.Clear();

            NUhourprice.DecimalPlaces = 2;

            try
            {
                if (Global_variables._Gitems.Count > 0)
                {
                    foreach (CalendarItem item in Global_variables._Gitems)
                    {
                        string _projects = item._project;
                        _projects = _projects.ToLower();


                        if (!cProjects.Items.Contains(_projects))
                        {
                            if (_projects.Length > 0)
                            {
                                cProjects.Items.Add(_projects);
                            }
                        }


                        string _clients = item._client;
                        _clients = _clients.ToLower();

                        if (!cClient.Items.Contains(_clients))
                        {
                            if (_clients.Length > 0)
                            {
                                cClient.Items.Add(_clients);
                            }
                        }

                        string _activities = item._activity;
                        _activities = _activities.ToLower();

                        if (!cActivity.Items.Contains(_activities))
                        {
                            if (_activities.Length > 0)
                            {
                                cActivity.Items.Add(_activities);
                            }
                        }
                    }

                    //cActivity.SelectedIndex = 0;
                    //cClient.SelectedIndex = 0;
                    //c
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }


            _Color = Color.White;
            // CYAN:
            _ColorName = "-16711681";

            tAgendaText.Text = "--";

            if (Global_variables._GActiveCalendarItem == null)
            {
            }
            else
            {
                try
                {
                    cClient.Text      = Global_variables._GActiveCalendarItem._client;
                    NUhourprice.Value = Convert.ToDecimal(Global_variables._GActiveCalendarItem._price);

                    nUKil.Value      = Convert.ToDecimal(Global_variables._GActiveCalendarItem._Kil);
                    nUKilprice.Value = Convert.ToDecimal(Global_variables._GActiveCalendarItem._Kilprice);

                    nUVariousCosts.Value = Convert.ToDecimal(Global_variables._GActiveCalendarItem._variouscosts);
                    tAgendaText.Text     = Global_variables._GActiveCalendarItem.Text;
                    bPickColor.BackColor = Global_variables._GActiveCalendarItem.BackgroundColor;
                    cProjects.Text       = Global_variables._GActiveCalendarItem._project;
                    cActivity.Text       = Global_variables._GActiveCalendarItem._activity;
                    tNote.Text           = Global_variables._GActiveCalendarItem._note;
                    //_ColorHex = Global_variables._GActiveCalendarItem.BackgroundColor.Name;

                    //Global_variables._GActiveCalendarItem.Date.TimeOfDay

                    _Color     = Global_variables._GActiveCalendarItem.BackgroundColor;
                    _ColorName = _Color.ToArgb().ToString();
                    // MessageBox.Show(_ColorName);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }
            }
        }