Ejemplo n.º 1
0
        public async Task <bool> RejectEditLines([FromBody] LinhasAlter linhas)
        {
            DAL bd = new DAL();

            try
            {
                string sql = $"update historic_line set status = 'CANCELADO', alter_date = NOW(), aprove_user = '******' where id = '{linhas.Alter_ID}'";
                bd.ExecutarComandoSQL(sql);
                bd.FecharConexao();
                return(true);
            }
            catch (Exception ex) { return(false); }
        }
Ejemplo n.º 2
0
        public bool EditLines([FromBody] LinhasAlter linhas)
        {
            DAL bd = new DAL();

            try
            {
                string sql = $"insert into historic_line values(uuid(), '{linhas.Number}', '{linhas.Ticket.ID}', '{linhas.ID}', '{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}', '{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}', '{linhas.Description}', 'PENDENTE', '{linhas.UserID}', null)";
                bd.ExecutarComandoSQL(sql);
                bd.FecharConexao();
                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
Ejemplo n.º 3
0
        public async Task <bool> AproveEditLines([FromBody] LinhasAlter linhas)
        {
            DAL bd = new DAL();

            try
            {
                string sql = $"update historic_line set status = 'APROVADO', alter_date = '{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}', aprove_user = '******' where id = '{linhas.Alter_ID}'";
                bd.ExecutarComandoSQL(sql);
                sql = $"update line set number = (select number from historic_line where id = '{linhas.Alter_ID}')," +
                      $" ticket_id = (select ticket_id from historic_line where id = '{linhas.Alter_ID}')," +
                      $" description = (select description from historic_line where id = '{linhas.Alter_ID}')," +
                      $" alter_date = NOW()" +
                      $" where id = (select line_id from historic_line where id = '{linhas.Alter_ID}')";
                bd.ExecutarComandoSQL(sql);
                bd.FecharConexao();
                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
Ejemplo n.º 4
0
 public async static Task <bool> RejectEditLines(LinhasAlter linhas)
 {
     return(await PostAsync <bool>("", "Linhas/RejectEditLines", linhas));
 }