public Invoice(int refuser, int mes, int año, int pagada) { this.gestor = new GestorInvoices(); this.idinvoice = gestor.getLastId() + 1; this.refuser = refuser; this.mes = mes; this.año = año; this.pagada = pagada; }
public void recoverInvoice(int iduser, int mes, int año) { DataRow dr = gestor.infoInvoice(iduser, mes, año); if (dr != null) { this.idinvoice = int.Parse(dr["idinvoice"].ToString()); this.Refuser = int.Parse(dr["refuser"].ToString()); this.Mes = int.Parse(dr["mes"].ToString()); this.Año = int.Parse(dr["año"].ToString()); this.Pagada = int.Parse(dr["pagada"].ToString()); } else { this.idinvoice = gestor.getLastId() + 1; this.Refuser = iduser; this.Mes = mes; this.Año = año; this.Pagada = 0; this.insertarme(); } }