Пример #1
0
 public void AtualizarAgendamento(
     Guid aprovadorId,
     EnumStatusAgendamento status,
     string justificativa = null)
 {
     this.DataAtualizacaoStatus = DateTime.Now;
     AprovadorId   = aprovadorId;
     Status        = status;
     Justificativa = justificativa;
 }
Пример #2
0
        /// <summary>
        /// Este método é uma sobrecarga do método acima, diferenciando pela data do agendamento e status do agendamento
        /// </summary>
        /// <param name="p_Enum_TipoExibicaoAgenda"></param>
        /// <param name="p_enumStatusAgendamento"></param>
        /// <param name="data"></param>
        /// <param name="hora"></param>
        /// <param name="atendente"></param>
        /// <param name="cliente"></param>
        /// <param name="tel_cel"></param>
        /// <param name="serv_prod"></param>
        /// <param name="posicao"></param>
        /// <returns></returns>
        Panel ConstrutorAgendamentos(Enum_TipoExibicaoAgenda p_Enum_TipoExibicaoAgenda, EnumStatusAgendamento p_enumStatusAgendamento, string data, string hora, string atendente, string cliente, string tel_cel, List <ProdutoVO> Serv_prod, int posicao)
        {
            #region panAgendamento
            Panel panAgendamento = new Panel();
            panAgendamento.Name         = posicao.ToString();
            panAgendamento.Anchor       = System.Windows.Forms.AnchorStyles.Top;
            panAgendamento.BackColor    = System.Drawing.Color.White;
            panAgendamento.Size         = new System.Drawing.Size(1218, 40);
            panAgendamento.Cursor       = Cursors.Hand;
            panAgendamento.DoubleClick += new EventHandler(Agendamento_DoubleClick);
            panAgendamento.MouseHover  += new EventHandler(panAgendamento_MouseHover);
            panAgendamento.MouseLeave  += new EventHandler(panAgendamento_MouseLeave);
            #endregion

            #region ptbStatus
            PictureBox ptbStatus = new PictureBox();
            ptbStatus.Name   = "ptbStatus" + posicao;
            ptbStatus.Anchor = AnchorStyles.Top;
            if (EnumStatusAgendamento.confirmado == p_enumStatusAgendamento)
            {
                ptbStatus.BackgroundImage = Properties.Resources.status_confirmado;
            }
            else if (EnumStatusAgendamento.cancelado == p_enumStatusAgendamento)
            {
                ptbStatus.BackgroundImage = Properties.Resources.status_cancelado;
            }
            else if (EnumStatusAgendamento.pendente == p_enumStatusAgendamento)
            {
                ptbStatus.BackgroundImage = Properties.Resources.status_pendente;
            }
            ptbStatus.BackgroundImageLayout = ImageLayout.Zoom;
            ptbStatus.Location = new Point(38, 3);
            ptbStatus.Size     = new Size(34, 34);
            #endregion

            #region txtHorario
            TextBox txtHorario = new TextBox();
            txtHorario.Name        = "txtHorario" + posicao;
            txtHorario.BackColor   = Color.White;
            txtHorario.BorderStyle = BorderStyle.None;
            txtHorario.Font        = new Font("Century Gothic", 12F, FontStyle.Regular, GraphicsUnit.Point, (0));
            txtHorario.ForeColor   = Color.Black;
            txtHorario.Location    = new Point(100, 8);
            txtHorario.ReadOnly    = true;
            txtHorario.Size        = new Size(128, 20);
            txtHorario.TextAlign   = HorizontalAlignment.Center;
            txtHorario.Enabled     = false;
            if (p_Enum_TipoExibicaoAgenda == Enum_TipoExibicaoAgenda.mes)
            {
                txtHorario.Text = data + " " + hora;
            }
            else if (p_Enum_TipoExibicaoAgenda == Enum_TipoExibicaoAgenda.semana)
            {
                txtHorario.Text = hora;
            }
            #endregion

            #region txtAtendente
            TextBox txtAtendente = new TextBox();
            txtAtendente.Name        = "txtAtentende" + posicao;
            txtAtendente.BackColor   = Color.White;
            txtAtendente.BorderStyle = BorderStyle.None;
            txtAtendente.Font        = new Font("Century Gothic", 12F, FontStyle.Regular, GraphicsUnit.Point, (0));
            txtAtendente.ForeColor   = Color.Black;
            txtAtendente.Location    = new Point(234, 8);
            txtAtendente.ReadOnly    = true;
            txtAtendente.Size        = new Size(200, 20);
            txtAtendente.TextAlign   = HorizontalAlignment.Center;
            txtAtendente.Enabled     = false;
            if (atendente != "")
            {
                txtAtendente.Text = atendente;
            }
            else
            {
                txtAtendente.Text = "Não informado";
            }
            #endregion

            #region txtCliente
            TextBox txtCliente = new TextBox();
            txtCliente.Name        = "txtCliente" + posicao;
            txtCliente.BackColor   = Color.White;
            txtCliente.BorderStyle = BorderStyle.None;
            txtCliente.Font        = new Font("Century Gothic", 12F, FontStyle.Regular, GraphicsUnit.Point, (0));
            txtCliente.ForeColor   = Color.Black;
            txtCliente.Location    = new Point(440, 8);
            txtCliente.ReadOnly    = true;
            txtCliente.Size        = new Size(205, 20);
            txtCliente.TextAlign   = HorizontalAlignment.Center;
            txtCliente.Enabled     = false;
            txtCliente.Text        = cliente;
            #endregion

            #region txtTelCel
            TextBox txtTelCel = new TextBox();
            txtTelCel.Name        = "txtTelCel" + posicao;
            txtTelCel.BackColor   = Color.White;
            txtTelCel.BorderStyle = BorderStyle.None;
            txtTelCel.Font        = new Font("Century Gothic", 12F, FontStyle.Regular, GraphicsUnit.Point, (0));
            txtTelCel.ForeColor   = Color.Black;
            txtTelCel.Location    = new Point(651, 8);
            txtTelCel.ReadOnly    = true;
            txtTelCel.Size        = new Size(167, 24);
            txtTelCel.TextAlign   = HorizontalAlignment.Center;
            txtTelCel.Enabled     = false;
            txtTelCel.Text        = tel_cel;
            #endregion

            #region cbSerProd
            ComboBox cbServProd = new ComboBox();
            cbServProd.Name              = "cbServProd" + posicao;
            cbServProd.Anchor            = AnchorStyles.Top;
            cbServProd.BackColor         = Color.White;
            cbServProd.Cursor            = Cursors.Hand;
            cbServProd.DropDownStyle     = ComboBoxStyle.DropDownList;
            cbServProd.FlatStyle         = FlatStyle.Flat;
            cbServProd.Font              = new Font("Century Gothic", 12F, FontStyle.Regular, GraphicsUnit.Point, (0));
            cbServProd.FormattingEnabled = true;
            foreach (ProdutoVO x in Serv_prod)
            {
                cbServProd.Items.Add(x.Descricao);
            }
            if (cbServProd.Items.Count != 0)
            {
                cbServProd.SelectedIndex = 0;
            }
            cbServProd.Location = new Point(824, 5);
            cbServProd.Size     = new Size(231, 29);
            #endregion

            #region ptbConfirmar
            PictureBox ptbConfirmar = new PictureBox();
            ptbConfirmar.Name                  = "ptbConfirmar" + posicao;
            ptbConfirmar.Anchor                = AnchorStyles.Top;
            ptbConfirmar.BackColor             = Color.DarkSeaGreen;
            ptbConfirmar.BackgroundImage       = Properties.Resources.checked__2_;
            ptbConfirmar.BackgroundImageLayout = ImageLayout.Zoom;
            ptbConfirmar.Location              = new Point(1142, 3);
            ptbConfirmar.Size                  = new Size(34, 34);
            ptbConfirmar.MouseLeave           += new EventHandler(ptbConfirmar_MouseLeave);
            ptbConfirmar.MouseHover           += new EventHandler(ptbConfirmar_MouseHover);
            ptbConfirmar.Click                += new EventHandler(ptbConfirmar_Click);
            #endregion

            #region ptbCancelar
            PictureBox ptbCancelar = new PictureBox();
            ptbCancelar.Name                  = "ptbCancelar" + posicao;
            ptbCancelar.Anchor                = AnchorStyles.Top;
            ptbCancelar.BackColor             = Color.IndianRed;
            ptbCancelar.BackgroundImage       = Properties.Resources.excluir;
            ptbCancelar.BackgroundImageLayout = ImageLayout.Zoom;
            ptbCancelar.Location              = new Point(1180, 3);
            ptbCancelar.Size                  = new Size(34, 34);
            ptbCancelar.MouseLeave           += new EventHandler(ptbCancelar_MouseLeave);
            ptbCancelar.MouseHover           += new EventHandler(ptbCancelar_MouseHover);
            ptbCancelar.Click                += new EventHandler(ptbCancelar_Click);
            #endregion

            #region Add controls ao panAgendamento
            panAgendamento.Controls.Add(ptbStatus);
            panAgendamento.Controls.Add(txtHorario);
            panAgendamento.Controls.Add(txtAtendente);
            panAgendamento.Controls.Add(txtCliente);
            panAgendamento.Controls.Add(txtTelCel);
            panAgendamento.Controls.Add(cbServProd);
            if (Convert.ToDateTime(data) <= DateTime.Now)
            {
                panAgendamento.Controls.Add(ptbConfirmar);
            }
            panAgendamento.Controls.Add(ptbCancelar);
            #endregion

            return(panAgendamento);
        }