protected void btnAtualizarServico_Click(object sender, EventArgs e)
        {
            try
            {
                int codigoservico = Convert.ToInt32(TxtCodigoOS.Text);

                Servicos s = new Servicos();

                s.codigoservico    = Convert.ToInt32(TxtCodigoOS.Text);
                s.TipoServico      = Convert.ToString(TxtTipoServico.Text);
                s.DescricaoServico = Convert.ToString(TxtdescricaoServico.Text);
                s.Statuservico     = Convert.ToString(txtStatusServico.Text);

                ServicosDAL d = new ServicosDAL();

                d.AtualizarServico(s);

                lblMensagem2.Text = "Ordem de Serviço Atualizada com Sucesso!";

                // limpar os campos apos serem preenchidos e acionado o botão

                TxtCodigoOS.Text         = string.Empty;
                TxtTipoServico.Text      = string.Empty;
                TxtdescricaoServico.Text = string.Empty;
                txtStatusServico.Text    = string.Empty;
            }
            catch (Exception ex)
            {
                lblMensagem2.Text = ex.Message;
            }
        }
        protected void BtnPesquisarOS(object sender, EventArgs e)
        {
            try
            {
                int codigo = Convert.ToInt32(TxtCodigoOS.Text);


                ServicosDAL d = new ServicosDAL();

                Servicos s = d.PesquisarServicoporCodigo(codigo);


                if (s != null)
                {
                    pnldadosTipoServico.Visible = true; // painel de dados
                    TxtTipoServico.Text         = s.TipoServico;
                    TxtdescricaoServico.Text    = s.DescricaoServico;
                    txtStatusServico.Text       = s.Statuservico;
                }
                else
                {
                    lblMensagem2.Text = "Ordem de Serviço não encontrada!";
                    TxtCodigoOS.Text  = string.Empty;
                }
            }
            catch (Exception ex)
            {
                lblMensagem2.Text = ex.Message;
            }
        }
예제 #3
0
        protected void btnCadastrar(object sender, EventArgs e)
        {
            try
            {
                Servicos s = new Servicos();

                s.ID_Usuario = int.Parse(cbxUsuarios.SelectedValue);
                s.Descricao  = Descricao.Text;

                switch (StatusTarefa.SelectedValue)
                {
                case "AN":
                    s.Status = "Em Andamento";
                    break;

                case "CO":
                    s.Status = "Concluída";
                    break;

                case "CC":
                    s.Status = "Cancelada";
                    break;
                }

                ServicosDAL d = new ServicosDAL();

                d.Gravar(s);
                lblMensagem.Text = "Tarefa cadastrada com sucesso!";
            }
            catch (Exception ex)
            {
                lblMensagem.Text = ex.Message;
            }
        }
예제 #4
0
        protected void btnAtualizarTarefa(object sender, EventArgs e)
        {
            try
            {
                Servicos s = new Servicos();
                s.ID_Item    = Convert.ToInt32(Session["idItem"]);
                s.ID_Usuario = int.Parse(cbxUsuarios.SelectedValue);
                s.Descricao  = Descricao.Text;

                switch (StatusTarefa.SelectedValue)
                {
                case "AN":
                    s.Status = "Em Andamento";
                    break;

                case "CO":
                    s.Status = "Concluída";
                    break;

                case "CC":
                    s.Status = "Cancelada";
                    break;
                }

                ServicosDAL d = new ServicosDAL();
                d.Atualizar(s);
                lblMensagem.Text = "Tarefa alterada com sucesso!";
            }
            catch (Exception ex)
            {
                lblMensagem.Text = ex.Message;
            }
        }
예제 #5
0
        // Metodo que cadastra as OS Ordem de Serviço
        protected void BtnCadastrarServico_Click(object sender, EventArgs e)
        {
            try
            {
                Servicos s = new Servicos();
                s.TipoServico      = TxtTipoServico.Text;
                s.DescricaoServico = txtDescricaoServico.Text;
                s.Statuservico     = TxtStatusServico.Text;

                ServicosDAL d = new ServicosDAL();

                d.GravarTipoServico(s); // Grava/ Cadastra o tipo de serviço


                lblMensagem2.Text = "Ordem de Serviço Cadastrada com Sucesso!";


                // comando para limpar os campos após preenchidos e cadastrados
                TxtTipoServico.Text      = string.Empty;
                txtDescricaoServico.Text = string.Empty;
                TxtStatusServico.Text    = string.Empty;
            }

            catch (Exception ex)
            {
                lblMensagem2.Text = ex.Message;
            }
        }
예제 #6
0
        public void ListarGrid()
        {
            ServicosDAL s = new ServicosDAL();

            //POPULAR O GRID
            gridServicos.DataSource = s.Listar();
            //EXIBIR O CONTEUDO DA GRID
            gridServicos.DataBind();
        }
예제 #7
0
        public void ListarTarefas(int ID_Item)
        {
            ServicosDAL sDal = new ServicosDAL();
            Servicos    ser  = sDal.PesquisarPorCodigo(ID_Item);

            if (ser != null)
            {
                Descricao.Text             = ser.Descricao;
                cbxUsuarios.SelectedIndex  = (ser.ID_Usuario - 1);
                StatusTarefa.SelectedValue = ser.Status;
            }
            else
            {
                lblMensagem.Text = "Tarefa não encontrada";
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                // page feita para mostrar grid ....
                ServicosDAL d = new ServicosDAL();

                GridServicos.DataSource = d.ListarServico(); // popula o grid com dados

                GridServicos.DataBind();                     // mostra o conteudo do grid
            }
            catch (Exception ex)
            {
                lblMensagem2.Text = ex.Message;
            }
        }
예제 #9
0
        protected void btnExcluirServico(object sender, EventArgs e)
        {
            try
            {
                int         ID_Item = Convert.ToInt32((sender as LinkButton).CommandArgument);
                Servicos    s       = new Servicos();
                ServicosDAL sd      = new ServicosDAL();


                sd.Excluir(ID_Item);
                lblMensagem.Text = "Tarefa excluída com sucesso!";
                ListarGrid();
            }
            catch (Exception ex)
            {
                lblMensagem.Text = ex.Message;
            }
        }
        protected void btnExcluirServico_Click(object sender, EventArgs e)
        {
            try
            {
                int codigoservico = Convert.ToInt32(TxtCodigoOS);

                Servicos s = new Servicos();

                ServicosDAL d = new ServicosDAL();

                d.ExcluirServico(codigoservico);

                lblMensagem2.Text = "Ordem de Serviço Excluida com Sucesso";

                TxtCodigoOS.Text         = string.Empty;
                TxtdescricaoServico.Text = string.Empty;
                txtStatusServico.Text    = string.Empty;
            }
            catch (Exception ex)
            {
                lblMensagem2.Text = ex.Message;
            }
        }