Exemplo n.º 1
0
Arquivo: TPV.cs Projeto: fcrespo/WSTPV
        public DataSet Resultado_Ajuste_Inventario(string Numero, string Tienda, string Seccion, bool Resultado, string ErrorMsg)
        {
            if ((DBUser == null) || (DBUser.UserCode == ""))
                return Utilidades.GenerarError("", "Resultado_Ajuste_Inventario()", "ERROR: No se ha validado, debe abrir login");
            try
            {

                NavisionDBTable dt = new NavisionDBTable(this.Connection, this.DBUser);
                NavisionDBAdapter da = new NavisionDBAdapter();
                da = new NavisionDBAdapter();

                dt.Reset();
                dt.TableName = "Ajustes Inventario TPV";
                dt.AddColumn("Estado");
                dt.AddColumn("Fecha modificación");
                dt.AddColumn("Hora modificación");
                dt.AddColumn("Error Message");
                dt.Modify("Fecha modificación", DateTime.Now.ToString("dd/MM/yyyy"));
                dt.Modify("Hora modificación", DateTime.Now.ToString("HH:mm:ss"));
                dt.Modify("Error Message", ErrorMsg);

                if (Resultado == true)
                {
                    dt.Modify("Estado", "Procesado");
                    dt.Modify("Error Message", "");
                }
                else
                {
                    dt.Modify("Estado", "Error");
                    dt.Modify("Error Message", ErrorMsg);
                }

                dt.AddFilter("Numero", Numero);
                da.AddTable(dt);

                try
                {
                    this.Connection.BWT();
                    da.Update();
                    this.Connection.EWT();
                }
                catch (Exception excep)
                {
                    this.Connection.AWT();
                    throw new Exception("Resultado_Ajuste_Inventario(): " + excep.Message);
                }

                return Utilidades.GenerarResultado("Correcto");
            }
            catch (Exception ex)
            {
                return Utilidades.GenerarError(this.DBUser.UserCode, "Resultado_Ajuste_Inventario()", ex.Message);
            }
        }
Exemplo n.º 2
0
Arquivo: TPV.cs Projeto: fcrespo/WSTPV
        public DataSet Actualizar_lineas_Reposicion(string Documento, string Linea, string CantidadRecibida)
        {
            if ((DBUser == null) || (DBUser.UserCode == ""))
                return MiddleWareTPVCentral.Utilidades.GenerarError("", "Actualizar_lineas_Reposicion()", "ERROR: No se ha validado, debe abrir login");
            try
            {
                Int32 K;
                K = Convert.ToInt32(CantidadRecibida);
                NavisionDBTable Dt = new NavisionDBTable(this.Connection, this.DBUser);
                NavisionDBAdapter da = new NavisionDBAdapter();
                DataSet ds = new DataSet();

                Dt.TableName = "Lín. reposicion";
                Dt.AddColumn("Nº documento");
                Dt.AddColumn("Nº línea");

                Dt.AddColumn("Cantidad recibida");

                Dt.Modify("Cantidad recibida", K);

                Dt.AddFilter("Nº documento", Documento);
                Dt.AddFilter("Nº línea", Linea);

                da.AddTable(Dt);
                try
                {
                    Dt.ConnectionDB.BWT();
                    da.Update();
                    Dt.ConnectionDB.EWT();
                }
                catch
                {
                    Dt.ConnectionDB.AWT();
                }

                da.Fill(ref ds, false);

                Utilidades.CompletarDataSet(ref ds, false, false);
                //Primer parametro false = string vacia o true = espacio en blanco
                //Segundo parametro fechas true = no mete nada y false 01010001

                return ds;
            }
            catch (Exception ex)
            {
                return MiddleWareTPVCentral.Utilidades.GenerarError(this.DBUser.UserCode, "Actualizar_lineas_Reposicion(): ", ex.Message);
            }
        }
Exemplo n.º 3
0
Arquivo: TPV.cs Projeto: fcrespo/WSTPV
        public DataSet PruebaDate()
        {
            if ((DBUser == null) || (DBUser.UserCode == ""))
                return Utilidades.GenerarError("", "Obtener_Reaprovision_tienda()", "ERROR: No se ha validado, debe abrir login");
            try
            {
                NavisionDBTable dt = new NavisionDBTable(this.Connection, this.DBUser);
                NavisionDBAdapter da = new NavisionDBAdapter();
                DataSet ds = new DataSet();

                // Ponemos números para la Migración a versión 4.0 SP2
                //dt.TableNo = 50001;  //Mensajes TPV
                dt.TableName = "Item";
                dt.AddColumn(62);     //Descripcion

                DateTime pp = new DateTime();
                pp = Convert.ToDateTime("01/08/2007");
                dt.Modify(62, pp);
                dt.AddFilter("No.", "J34");

                da.AddTable(dt);
                try
                {
                    this.Connection.BWT();
                    da.Update();
                    this.Connection.EWT();
                }
                catch (Exception excep)
                {
                    this.Connection.AWT();
                    throw new Exception("Obtener_Reaprovision_tienda(): " + excep.Message);
                }
                da.Fill(ref ds, true);

                Utilidades.CompletarDataSet(ref ds, false, false);

                return ds;
            }
            catch (Exception ex)
            {
                return Utilidades.GenerarError(this.DBUser.UserCode, "PruebaDate()", ex.Message);
            }
        }
Exemplo n.º 4
0
Arquivo: TPV.cs Projeto: fcrespo/WSTPV
        public DataSet Obtener_Diario_Producto(string Tienda, string Seccion)
        {
            if ((DBUser == null) || (DBUser.UserCode == ""))
                return Utilidades.GenerarError("", "Obtener_Diario_Producto()", "ERROR: No se ha validado, debe abrir login");
            try
            {
                NavisionDBTable dt = new NavisionDBTable(this.Connection, this.DBUser);
                NavisionDBAdapter da = new NavisionDBAdapter();
                DataSet ds = new DataSet();

                dt.TableName = "Ajustes Inventario TPV";
                dt.AddColumn("Numero");
                dt.AddColumn("Nº Documento");     //Nº documento
                dt.AddColumn("Estado");
                dt.AddColumn("Seccion");    //Seccion
                dt.AddColumn("Nº línea");    //Nº linea
                dt.AddColumn("Entry Type");    //Tipo movimiento
                dt.AddColumn("Nº producto");    //Nº producto
                dt.AddColumn("Cantidad");    //Cantidad
                dt.AddColumn("Libro");    //Libro
                dt.AddColumn("Cód. tienda");    //Cod. tienda
                dt.AddColumn("Fecha registro");    //Fecha registro
                dt.AddColumn("Cod. variante"); //Cód. variante

                dt.KeyInNavisionFormat = "Cód. tienda,Seccion,Estado";

                dt.AddFilter("Cód. tienda", Tienda);
                dt.AddFilter("Seccion", Seccion);
                dt.AddFilter("Estado", "Enviar a tienda");  //Enviar a tienda

                da.AddTable(dt);
                da.Fill(ref ds, true);
                Utilidades.CompletarDataSet(ref ds, false, false);

                //VUELVO A REALIZAR LA CONSULTA Y LOS MODIFICO
                da = new NavisionDBAdapter();
                dt.Reset();
                dt.TableName = "Ajustes Inventario TPV";
                dt.AddColumn("Estado");
                dt.AddColumn("Fecha modificación");
                dt.AddColumn("Hora modificación");

                dt.Modify("Fecha modificación", DateTime.Now.ToString("dd/MM/yyyy"));
                dt.Modify("Hora modificación", DateTime.Now.ToString("HH:mm:ss"));
                dt.Modify("Estado", "Enviado");

                dt.KeyInNavisionFormat = "Cód. tienda,Seccion";

                dt.AddFilter("Cód. tienda", Tienda);
                dt.AddFilter("Seccion", Seccion);
                dt.AddFilter("Estado", "Enviar a tienda");

                da.AddTable(dt);

                try
                {
                    this.Connection.BWT();
                    da.Update();
                    this.Connection.EWT();
                }
                catch (Exception excep)
                {
                    this.Connection.AWT();
                    throw new Exception("Obtener_Diario_Producto(): " + excep.Message);
                }

                return ds;
            }
            catch (Exception ex)
            {
                return Utilidades.GenerarError(this.DBUser.UserCode, "Obtener_Diario_Producto()", ex.Message);
            }
        }
Exemplo n.º 5
0
Arquivo: TPV.cs Projeto: fcrespo/WSTPV
 public DataSet MarkShipmentNotReceived(string _codTienda, string fechaInicio, string fechaFin)
 {
     NavisionDBTable table = new NavisionDBTable(this.Connection, this.DBUser);
     NavisionDBAdapter adapter = new NavisionDBAdapter();
     DataSet ds = new DataSet();
     DataSet set = new DataSet();
     table.TableNo = 5744; //Cab. transferencia envío
     table.AddFilter("Transfer-to Code", _codTienda);
     table.AddFilter("Received In TPV", "false");
     if ((fechaInicio != "") || (fechaFin != ""))
     {
         table.AddFilter("Posting Date", fechaInicio + ".." + fechaFin);
     }
     table.Modify(50071, true);
     adapter.AddTable(table);
     try
     {
         table.ConnectionDB.BWT();
         adapter.Update();
         table.ConnectionDB.EWT();
         return Utilidades.GenerarResultado("Se han marcado los envios no recibidos.");
     }
     catch (Exception ex)
     {
         table.ConnectionDB.AWT();
         return Utilidades.GenerarError(_codTienda + "[" + fechaInicio + ".." + fechaFin + "]" ,"MarkShipmentNotReceived()", ex.Message);
     }
 }
Exemplo n.º 6
0
Arquivo: TPV.cs Projeto: fcrespo/WSTPV
 private void MarkShipmentReceived(string documentNo)
 {
     NavisionDBTable table = new NavisionDBTable(this.Connection, this.DBUser);
     NavisionDBAdapter adapter = new NavisionDBAdapter();
     DataSet ds = new DataSet();
     table.TableNo = 5744; //Cab. transferencia envío
     table.AddFilter("Transfer Order No.", documentNo);
     table.Modify(50070, true);
     table.Modify(50071, false);
     adapter.AddTable(table);
     try
     {
         table.ConnectionDB.BWT();
         adapter.Update();
         table.ConnectionDB.EWT();
     }
     catch (Exception)
     {
         table.ConnectionDB.AWT();
     }
 }
Exemplo n.º 7
0
 private void CopiarDBTable(NavisionDBTable t_origen, ref NavisionDBTable t_destino)
 {
     int num;
     t_destino.TableName = t_origen.TableName;
     t_destino.TableNo = t_origen.TableNo;
     t_destino.Key = t_origen.Key;
     t_destino.Reverse = t_origen.Reverse;
     if (t_origen.Filters != null)
     {
         object[,] filters = t_origen.Filters;
         for (num = 0; num < (filters.Length / 2); num++)
         {
             t_destino.AddFilter(Convert.ToInt32(filters[num, 0]), Convert.ToString(filters[num, 1]));
         }
     }
     if (t_origen.Columns != null)
     {
         int[] columns = t_origen.Columns;
         for (num = 0; num < columns.Length; num++)
         {
             t_destino.AddColumn(columns[num]);
         }
     }
     if (t_origen.ColumnsName != null)
     {
         string[] columnsName = t_origen.ColumnsName;
         for (num = 0; num < columnsName.Length; num++)
         {
             t_destino.AddColumn(columnsName[num]);
         }
     }
     t_destino.NoColumn = t_origen.NoColumn;
     if (t_origen.Inserts != null)
     {
         object[,] inserts = t_origen.Inserts;
         for (num = 0; num < (inserts.Length / 2); num++)
         {
             t_destino.Insert(Convert.ToInt32(inserts[num, 0]), inserts[num, 1]);
         }
     }
     if (t_origen.Updates != null)
     {
         object[,] updates = t_origen.Updates;
         for (num = 0; num < (updates.Length / 2); num++)
         {
             t_destino.Modify(Convert.ToInt32(updates[num, 0]), updates[num, 1]);
         }
     }
 }