private void DeleteOldOustandingTickets(string codTienda) { DataSet set = new DataSet(); NavisionDBTable ticketPendienteTable = new NavisionDBTable(this.Connection, this.DBUser); NavisionDBAdapter ticketPendienteAdapter = new NavisionDBAdapter(); ticketPendienteTable.TableNo = 50074; //Ticket Pendiente ticketPendienteTable.AddFilter("Cód. tienda", codTienda); ticketPendienteAdapter.AddTable(ticketPendienteTable); ticketPendienteAdapter.Fill(ref set, true); ticketPendienteAdapter.DeleteItem = set; try { ticketPendienteTable.ConnectionDB.BWT(); ticketPendienteAdapter.Update(); ticketPendienteTable.ConnectionDB.EWT(); } catch (Exception) { ticketPendienteTable.ConnectionDB.AWT(); } }
private void InsertTicketPendiente(string tipoDocumento, string documentNo, string codTienda, string codTPV, string fechaDocumento, int errorEnvio) { NavisionDBTable errorTable = new NavisionDBTable(this.Connection, this.DBUser); NavisionDBAdapter errorAdapter = new NavisionDBAdapter(); DataSet TicketPendiente = new DataSet(); errorTable.TableNo = 50074; //Ticket Pendiente errorAdapter.AddTable(errorTable); TicketPendiente = errorTable.GenerateStructure(); DataRow TicketPendienteRow = TicketPendiente.Tables[0].NewRow(); TicketPendienteRow["Tipo documento"] = tipoDocumento; TicketPendienteRow["Nº documento"] = documentNo; TicketPendienteRow["Cód. tienda"] = codTienda; TicketPendienteRow["Cód. TPV"] = codTPV; TicketPendienteRow["Fecha documento"] = fechaDocumento; TicketPendienteRow["Error envío"] = errorEnvio; TicketPendiente.Tables[0].Rows.Add(TicketPendienteRow); errorAdapter.InsertItem = TicketPendiente; try { errorTable.ConnectionDB.BWT(); errorAdapter.Update(); errorTable.ConnectionDB.EWT(); } catch (Exception) { errorTable.ConnectionDB.AWT(); } }
public DataSet TPVQueueResponse(string Id, bool Result, string Fecha, string Hora, string Msg) { if ((DBUser == null) || (DBUser.UserCode == "")) return MiddleWareTPVCentral.Utilidades.GenerarError("", "TPVResponse()", "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 = "TPV Response"; da.AddTable(dt); ds = dt.GenerateStructure(); DataRow dr = ds.Tables[0].NewRow(); dr["Entry No."] = 0; dr["ID"] = Id; dr["Shop Code"] = DBUser.UserCode; if (!String.IsNullOrEmpty(Fecha)) { DateTime FechaDT = DateTime.Parse(Fecha); dr["Execution Date"] = FechaDT.ToString("dd/MM/yyyy"); } else { dr["Execution Date"] = DateTime.Now.ToString("dd/MM/yyyy"); } if (!String.IsNullOrEmpty(Hora)) { DateTime HoraDT = DateTime.Parse(Hora); dr["Execution Time"] = HoraDT.ToString("HH:mm:ss"); } else { dr["Execution Time"] = DateTime.Now.ToString("HH:mm:ss"); } int len = Msg.Length; if (len < 250) { dr["Message 1"] = Msg.Substring(0, len); } else { dr["Message 1"] = Msg.Substring(0, 250); } if (Msg.Length > 250) { len -= 250; if (len < 250) { dr["Message 2"] = Msg.Substring(250, len); } else { dr["Message 2"] = Msg.Substring(250, 250); } } if (Msg.Length > 500) { len -= 250; if (len < 250) { dr["Message 3"] = Msg.Substring(500, len); } else { dr["Message 3"] = Msg.Substring(500, 250); } } if (Msg.Length > 750) { len -= 250; if (len < 250) { dr["Message 4"] = Msg.Substring(750, len); } else { dr["Message 4"] = Msg.Substring(750, 250); } } if (Result) { dr["Status"] = "Success"; } else { dr["Status"] = "Error"; } ds.Tables[0].Rows.Add(dr); da.InsertItem = ds; try { this.Connection.BWT(); da.Update(); this.Connection.EWT(); } catch (Exception ex) { this.Connection.AWT(); return MiddleWareTPVCentral.Utilidades.GenerarError(this.DBUser.UserCode, "TPVResponse(): ", ex.Message); } return Utilidades.GenerarResultado("Ok"); } catch (Exception ex) { return MiddleWareTPVCentral.Utilidades.GenerarError(this.DBUser.UserCode, "TPVResponse(): ", ex.Message); } }
public bool BorrarCabecera(string Numero, string tipo) { try { NavisionDBTable Dt = new NavisionDBTable(this.Connection, this.DBUser); NavisionDBAdapter Da = new NavisionDBAdapter(); DataSet ds = new DataSet(); Dt.TableNo = 36; //Dt.TableName = "Sales Header"; Dt.AddFilter(1, tipo); //Dt.AddFilter("Document Type", tipo); Dt.AddFilter(3, Numero); //Dt.AddFilter("No.", Numero); Da.AddTable(Dt); Da.Fill(ref ds, true); 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 Da.DeleteItem = ds; try { this.Connection.BWT(); Da.Update(); this.Connection.EWT(); } catch (Exception excep) { this.Connection.AWT(); throw new Exception("BorrarCabecera(2): " + excep.Message); } } catch (Exception ex) { throw new Exception("BorrarCabecera: " + ex.Message); } return true; }
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); } }
public DataSet TPVQueueRequest(string Fecha) { if ((DBUser == null) || (DBUser.UserCode == "")) return MiddleWareTPVCentral.Utilidades.GenerarError("", "TPVQueueRequest()", "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 = "TPV Request"; dt.AddColumn("ID"); dt.AddColumn("Expiration Date/Time"); dt.AddColumn("Earliest Start Date/Time"); dt.AddColumn("Object Type to Run"); dt.AddColumn("Object ID to Run"); dt.AddColumn("Maximum No. of Attempts to Run"); dt.AddColumn("Status"); dt.AddColumn("Priority"); dt.AddColumn("Parameter String"); dt.AddColumn("Recurring Job"); dt.AddColumn("No. of Minutes between Runs"); dt.AddColumn("Run on Mondays"); dt.AddColumn("Run on Tuesdays"); dt.AddColumn("Run on Wednesdays"); dt.AddColumn("Run on Thursdays"); dt.AddColumn("Run on Fridays"); dt.AddColumn("Run on Saturdays"); dt.AddColumn("Run on Sundays"); dt.AddColumn("Starting Time"); dt.AddColumn("Ending Time"); dt.AddColumn("Synch Results"); dt.KeyInNavisionFormat = "Shop Code,Creation Date,Active"; dt.AddFilter("Shop Code", DBUser.UserCode + "|''"); if (!String.IsNullOrEmpty(Fecha)) { dt.AddFilter("Creation Date", DateTime.Parse(Fecha).ToString("dd/MM/yyyy") + ".."); } dt.AddFilter("Active", "true"); da.AddTable(dt); da.Fill(ref ds, false); Utilidades.CompletarDataSet(ref ds, false, false); //string guid = ds.Tables[0].Rows[0].ItemArray.GetValue(0).ToString(); da = new NavisionDBAdapter(); dt.Reset(); DataSet dsLog = new DataSet(); dt.TableName = "TPV Response"; da.AddTable(dt); dsLog = dt.GenerateStructure(); DataRow dr; int lItems = ds.Tables[0].Rows.Count; for (int i = 0; i < lItems; i++) { dr = dsLog.Tables[0].NewRow(); dr["Entry No."] = 0; dr["ID"] = "{" + ds.Tables[0].Rows[i].ItemArray.GetValue(0).ToString() + "}"; dr["Shop Code"] = DBUser.UserCode; dr["Status"] = "Downloaded"; dr["Execution Date"] = DateTime.Now.ToString("dd/MM/yyyy"); dr["Execution Time"] = DateTime.Now.ToString("HH:mm:ss"); dsLog.Tables[0].Rows.Add(dr); } da.InsertItem = dsLog; try { this.Connection.BWT(); da.Update(); this.Connection.EWT(); } catch (Exception excep) { this.Connection.AWT(); throw new Exception("TPVQueueRequest(): " + excep.Message); } return ds; } catch (Exception ex) { return MiddleWareTPVCentral.Utilidades.GenerarError(this.DBUser.UserCode, "TPVQueueRequest(): ", ex.Message); } }
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); } }
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); } }
public DataSet Obtener_Entregas_Tienda(string Tienda) { if ((DBUser == null) || (DBUser.UserCode == "")) return Utilidades.GenerarError("", "Obtener_Entregas_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.TableName = "Sales Header"; //CABECERA DE PEDIDO dt.AddColumn(1); //"document type" dt.AddColumn(2); //Cliente dt.AddColumn(3); //nº documento dt.AddColumn(20); //fecha registro dt.AddColumn(28); //almacen dt.AddColumn(12); //cod. direccion envío dt.AddColumn(13); //envio nombre dt.AddColumn(15); //envio direccion dt.AddColumn(17); //envio poblacion dt.AddColumn(18); //envio atencion dt.AddColumn(91); //envio CP dt.AddColumn(92); //envio provincia dt.AddColumn(50102); //importe entregado dt.AddColumn(5700); //Centro responsabilidad = tienda origen dt.KeyInNavisionFormat = "Document Type,Location Code,Entrega de otra tienda,Enviada a tienda destino,Reg. en tienda destino"; dt.AddFilter("Document Type", "Order"); dt.AddFilter("Location Code", Tienda); dt.AddFilter("Entrega de otra tienda", "true"); dt.AddFilter("Enviada a tienda destino", "false"); da.AddTable(dt); dt.Reset(); dt.TableNo = 37; // LINEAS DE PEDIDO dt.AddColumn(1); //"document type" dt.AddColumn(3); //"nº documento" dt.AddColumn(4); //nº linea dt.AddColumn(6); //nº = producto dt.AddColumn(11); //descripcion dt.AddColumn(15); //cantidad dt.AddColumn(22); //precio dt.AddColumn(27); //%dto. linea dt.AddFilter(1, "Order"); //Cross-Reference Type da.AddTable(dt); da.AddRelation("Sales Header", "No.", "Sales Line", "Document No.", NavisionDBAdapter.JoinType.Parent_Outer_Join, false); 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 //VUELVO A REALIZAR LA CONSULTA PARA MODIFICAR EL CAMPO //ENVIADA A TIENDA DESTINO = TRUE, PARA QUE NO VUELVA EN LA SIGUIENTE CONSULTA //DE ENTREGAS DE DISTINTAS TIENDAS dt.Reset(); da = new NavisionDBAdapter(); DataSet ds2 = new DataSet(); dt.TableName = "Sales Header"; //dt.Modify("Enviada a tienda destino", "true"); dt.KeyInNavisionFormat = "Document Type,Location Code,Entrega de otra tienda,Enviada a tienda destino,Reg. en tienda destino"; dt.AddFilter("Document Type", "Order"); dt.AddFilter("Location Code", Tienda); dt.AddFilter("Entrega de otra tienda", "true"); dt.AddFilter("Enviada a tienda destino", "false"); da.AddTable(dt); da.Fill(ref ds2, true); for (int i = 0; i < ds2.Tables[0].Rows.Count; i++) { ds2.Tables[0].Rows[i]["Enviada a tienda destino"] = true; } ds2.Tables[0].AcceptChanges(); da.UpdateItem = ds2; try { dt.ConnectionDB.BWT(); da.Update(); dt.ConnectionDB.EWT(); } catch { dt.ConnectionDB.AWT(); } return ds; } catch (Exception ex) { return Utilidades.GenerarError(this.DBUser.UserCode, "Obtener_Entregas_tienda()", ex.Message); } }
//DPA-- //DPA++ public DataSet Obtener_Reaprovision_Tienda_Independiente(string Tienda, string NoDocumento, bool delete) { if ((this.DBUser == null) || (this.DBUser.UserCode == "")) { return Utilidades.GenerarError("", "Obtener_Reaprovision_Tienda_Independiente()", "ERROR: No se ha validado, debe abrir login"); } try { NavisionDBTable table = new NavisionDBTable(this.Connection, this.DBUser); NavisionDBAdapter adapter = new NavisionDBAdapter(); DataSet ds = new DataSet(); table.TableName = "Transfer TPV Line"; table.AddFilter("Transfer-to Code", Tienda); if (!string.IsNullOrEmpty(NoDocumento)) { table.AddFilter("Document No.", NoDocumento); } adapter.AddTable(table); adapter.Fill(ref ds, true); Utilidades.CompletarDataSet(ref ds, false, false); if (delete) { NavisionDBTable tableToDelete = new NavisionDBTable(this.Connection, this.DBUser); NavisionDBAdapter adapterToDelete = new NavisionDBAdapter(); DataSet dsToDelete = new DataSet(); tableToDelete.TableName = "Transfer TPV Line"; tableToDelete.AddFilter("Transfer-to Code", Tienda); if (!string.IsNullOrEmpty(NoDocumento)) { tableToDelete.AddFilter("Document No.", NoDocumento); } adapterToDelete.AddTable(tableToDelete); adapterToDelete.Fill(ref dsToDelete, true); adapterToDelete.DeleteItem = dsToDelete; try { tableToDelete.ConnectionDB.BWT(); adapterToDelete.Update(); tableToDelete.ConnectionDB.EWT(); } catch (Exception ex) { return Utilidades.GenerarError(this.DBUser.UserCode + "-" + NoDocumento, "Obtener_Reaprovision_Tienda_Independiente()", ex.Message); } } return ds; } catch (Exception ex2) { return Utilidades.GenerarError(this.DBUser.UserCode + "-" + NoDocumento, "Obtener_Reaprovision_Tienda_Independiente()", ex2.Message); } }
public DataSet Obtener_Entregas_Estado(string Tienda) { if ((DBUser == null) || (DBUser.UserCode == "")) return Utilidades.GenerarError("", "Obtener_Entregas_Estado()", "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.TableName = "Sales Header"; //CABECERA DE PEDIDO dt.AddColumn(3); //nº documento dt.AddColumn(50103); //Estado reserva dt.KeyInNavisionFormat = "Document Type,Cód. tienda,Entrega de otra tienda,Enviada a tienda destino,Reg. en tienda destino"; dt.AddFilter("Document Type", "Order"); dt.AddFilter("Cód. tienda", Tienda); dt.AddFilter("Entrega de otra tienda", "true"); dt.AddFilter("Enviada a tienda destino", "true"); dt.AddFilter("Reg. en tienda destino", "false"); dt.AddFilter("Estado Reserva", "Facturada|Anulada"); da.AddTable(dt); 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 //VUELVO A REALIZAR LA CONSULTA PARA MODIFICAR EL CAMPO //Reg. en tienda destino = TRUE, PARA QUE NO VUELVA EN LA SIGUIENTE CONSULTA //DE ENTREGAS DE DISTINTAS TIENDAS dt.Reset(); da = new NavisionDBAdapter(); DataSet ds2 = new DataSet(); dt.TableName = "Sales Header"; //dt.Modify("Reg. en tienda destino", "true"); dt.KeyInNavisionFormat = "Document Type,Cód. tienda,Entrega de otra tienda,Enviada a tienda destino,Reg. en tienda destino"; dt.AddFilter("Document Type", "Order"); dt.AddFilter("Cód. tienda", Tienda); dt.AddFilter("Entrega de otra tienda", "true"); dt.AddFilter("Enviada a tienda destino", "true"); dt.AddFilter("Reg. en tienda destino", "false"); dt.AddFilter("Estado Reserva", "Facturada|Anulada"); da.AddTable(dt); da.Fill(ref ds2, true); for (int i = 0; i < ds2.Tables[0].Rows.Count; i++) { ds2.Tables[0].Rows[i]["Reg. en tienda destino"] = true; } ds2.Tables[0].AcceptChanges(); da.UpdateItem = ds2; try { dt.ConnectionDB.BWT(); da.Update(); dt.ConnectionDB.EWT(); } catch { dt.ConnectionDB.AWT(); } return ds; } catch (Exception ex) { return Utilidades.GenerarError(this.DBUser.UserCode, "Obtener_Entregas_Estado()", ex.Message); } }
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); } }
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); } }
public bool BorrarLineasINC(string Numero) { try { NavisionDBTable table = new NavisionDBTable(this.Connection, this.DBUser); NavisionDBAdapter adapter = new NavisionDBAdapter(); DataSet ds = new DataSet(); table.TableNo = 50053; //Hist. Lin. Incidencia calidad table.AddFilter("No. Incidencia", Numero); adapter.AddTable(table); adapter.Fill(ref ds, true); Utilidades.CompletarDataSet(ref ds, false, false); adapter.DeleteItem = ds; try { this.Connection.BWT(); adapter.Update(); this.Connection.EWT(); } catch (Exception exception) { this.Connection.AWT(); throw new Exception("BorrarLineasINC(2): " + exception.Message); } } catch (Exception exception2) { throw new Exception("BorrarLineasINC: " + exception2.Message); } return true; }
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(); } }