Esempio n. 1
0
        public int GetCancels(DataPendiente datapendiente)
        {
            try
            {
                string respuesta = "";
                using (SqlConnection con = new SqlConnection(connectionString))
                {
                    SqlCommand cmd = new SqlCommand("Facturacion.spu_COMP_ActCambiosClientes", con);
                    cmd.CommandType = CommandType.StoredProcedure;

                    respuesta = datapendiente.Opcion;
                    respuesta = respuesta.Substring(1, 5);

                    cmd.Parameters.AddWithValue("@idCambio", SqlDbType.Int).Value     = respuesta;
                    cmd.Parameters.AddWithValue("@sEstatosNew", SqlDbType.Char).Value = "C".ToString();
                    cmd.Parameters.AddWithValue("@sUsuario", SqlDbType.Char).Value    = datapendiente.Usuario.ToString();

                    con.Open();
                    cmd.ExecuteNonQuery();
                    con.Close();
                }
                return(1);
            }
            catch (Exception)
            {
                throw;
            }
        }
Esempio n. 2
0
        public DataPendiente GetPendientes(DataFactura datafactura)
        {
            try
            {
                DataPendiente datos = new DataPendiente();
                //string sRespuesta = "";
                using (SqlConnection con = new SqlConnection(connectionString))
                {
                    SqlCommand cmd = new SqlCommand("Facturacion.spu_COMP_ConAplicacionesPendientesRFC", con);
                    cmd.CommandType = CommandType.StoredProcedure;

                    cmd.Parameters.AddWithValue("@sRFC", datafactura.Opcion.Trim());

                    con.Open();
                    SqlDataReader rdr = cmd.ExecuteReader();
                    while (rdr.Read())
                    {
                        datos.Opcion = rdr["sRespuesta"].ToString();
                        //if (datos.Opcion != "")
                        //{

                        //}
                        //else
                        //{
                        //    datos.Opcion = null;
                        //}
                    }
                    con.Close();
                }
                return(datos);
            }
            catch (Exception)
            {
                throw;
            }
        }
 public int Cancelar([FromBody] DataPendiente datapendiente)
 {
     return(objfacturas.GetCancels(datapendiente));
 }
 public int Confirmar([FromBody] DataPendiente datapendiente)
 {
     return(objfacturas.GetConfirms(datapendiente));
 }