public Boolean CloseInvoiceSupplier(InvoiceSupplier invS) { if (verifyInvoiceSupplier(invS.numberInvoice) == 0) { String query = "Update FACTURA_PROVEEDOR set METODO_PAGO = @payMethod, ID_METODO_PAGO = @idPayMethod, FECHA_PAGO = @paymentDate where NUMERO_FACTURA = @numberInvoice"; SqlCommand comm = new SqlCommand(query, conn); comm.Connection = conn; comm.Parameters.AddWithValue("@numberInvoice", invS.numberInvoice); comm.Parameters.AddWithValue("@paymentDate", invS.paymentDate); comm.Parameters.AddWithValue("@idPayMethod", invS.idPayMethod); comm.Parameters.AddWithValue("@payMethod", invS.payMethod); if (conn.State != System.Data.ConnectionState.Open) { conn.Open(); } comm.ExecuteNonQuery(); if (conn.State != System.Data.ConnectionState.Closed) { conn.Close(); } return(true); } else { return(false); } }
public bool ModifyInvoiceSupplierPostpone(InvoiceSupplier invoice) { if (verifyInvoiceSupplier(invoice.numberInvoice) == 1) { String query = "Update FACTURA_PROVEEDOR set FECHA = @reminderDate where NUMERO_FACTURA = @numberInvoice"; SqlCommand comm = new SqlCommand(query, conn); comm.Connection = conn; comm.Parameters.AddWithValue("@numberInvoice", invoice.numberInvoice); comm.Parameters.AddWithValue("@reminderDate", invoice.paymentDate); if (conn.State != System.Data.ConnectionState.Open) { conn.Open(); } comm.ExecuteNonQuery(); if (conn.State != System.Data.ConnectionState.Closed) { conn.Close(); } return(true); } else { return(false); } }
public Boolean InsertInvoiceSupplier(InvoiceSupplier invS) { if (verifyInvoiceSupplier(invS.numberInvoice) == 0) { String query = "INSERT INTO FACTURA_PROVEEDOR (NUMERO_FACTURA,ID_PROVEEDOR,FECHA_PAGO,ID_METODO_PAGO, METODO_PAGO," + "MONTO,ESTADO) VALUES(@numberInvoice, @idSupplier,@paymentDate,@idPayMethod,@payMethod,@money,@condition)"; SqlCommand comm = new SqlCommand(query, conn); comm.Connection = conn; comm.Parameters.AddWithValue("@numberInvoice", invS.numberInvoice); comm.Parameters.AddWithValue("@idSupplier", invS.idSupplier); comm.Parameters.AddWithValue("@paymentDate", invS.paymentDate); comm.Parameters.AddWithValue("@idPayMethod", invS.idPayMethod); comm.Parameters.AddWithValue("@payMethod", invS.payMethod); comm.Parameters.AddWithValue("@money", invS.money); comm.Parameters.AddWithValue("@condition", invS.condition); if (conn.State != System.Data.ConnectionState.Open) { conn.Open(); } comm.ExecuteNonQuery(); if (conn.State != System.Data.ConnectionState.Closed) { conn.Close(); } return(true); } else { return(false); } }
public InvoiceSupplier LoadInvoiceSupplierById(String idInvoice) { String query = "SELECT * FROM FACTURA_PROVEEDOR WHERE NUMERO_FACTURA = @idInvoice"; InvoiceSupplier temp = new InvoiceSupplier(); SqlCommand comm = new SqlCommand(query, conn); SqlDataReader reader; comm.Parameters.AddWithValue("@idInvoice", idInvoice); if (conn.State != ConnectionState.Open) { conn.Open(); } reader = comm.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { temp = new InvoiceSupplier((String)reader["NUMERO_FACTURA"], (string)reader["ID_PROVEEDOR"], (DateTime)reader["FECHA_PAGO"], (int)reader["ID_METODO_PAGO"], (string)reader["METODO_PAGO"], double.Parse(reader["MONTO"].ToString()), (Byte)reader["ESTADO"], (DateTime)reader["FECHA"]); //string numberInvoice, string idSupplier, DateTime paymentDate, int idPayMethod, string payMethod,double money, Byte condition, DateTime reminderDate } } else { temp = null; } if (conn.State != ConnectionState.Closed) { conn.Close(); } return(temp); }
public Boolean CloseInvoiceSupplier(InvoiceSupplier invS) { }
public Boolean ModifyInvoiceSupplier(InvoiceSupplier invS) { }
public Boolean InsertInvoiceSupplier(InvoiceSupplier invS) { }
public bool ModifyInvoiceSupplierPostpone(InvoiceSupplier invoice) { DAOInvoiceSupplier daoIS = new DAOInvoiceSupplier(); return(daoIS.ModifyInvoiceSupplierPostpone(invoice)); }
public Boolean CloseInvoiceSupplier(InvoiceSupplier invS) { DAOInvoiceSupplier daoIS = new DAOInvoiceSupplier(); return(daoIS.CloseInvoiceSupplier(invS)); }
public Boolean ModifyInvoiceSupplier(InvoiceSupplier invS) { DAOInvoiceSupplier daoIS = new DAOInvoiceSupplier(); return(daoIS.ModifyInvoiceSupplier(invS)); }
public Boolean InsertInvoiceSupplier(InvoiceSupplier invS) { DAOInvoiceSupplier daoIS = new DAOInvoiceSupplier(); return(daoIS.InsertInvoiceSupplier(invS)); }