public static bool InsertExternalInvoiceSell(ExternalInvoiceSellModel externalInvoiceSellModel)
 {
     try
     {
         using (IDbConnection cnn = new MySqlConnection(LoadConnectionString()))
         {
             cnn.Execute("INSERT INTO ExternalInvoiceSell (idDetailExternalInvoiceSell, Product_idProduct1) VALUES(@idDetailExternalInvoiceSell, @Product_idProduct1)", externalInvoiceSellModel);
         }
         return(true);
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Ejemplo n.º 2
0
 public static bool InsertExternalInvoice(string idInvoice, string idProduct)
 {
     try
     {
         ExternalInvoiceSellModel externalInvoiceSellModel = new ExternalInvoiceSellModel()
         {
             idDetailExternalInvoiceSell = int.Parse(idInvoice),
             Product_idProduct           = int.Parse(idProduct)
         };
         return(DBExternalInvoiceSell.InsertExternalInvoiceSell(externalInvoiceSellModel));
     }
     catch (Exception ex)
     {
         throw;
     }
 }
        public static ExternalInvoiceSellModel SelectExternalInvoiceProductsById(ExternalInvoiceSellModel externalInvoiceSellModel)
        {
            try
            {
                using (IDbConnection cnn = new MySqlConnection(LoadConnectionString()))
                {
                    var output = cnn.Query <ExternalInvoiceSellModel>("SELECT * FROM ExternalInvoiceSell WHERE idDetailExternalInvoiceSell like @idDetailExternalInvoiceSell", externalInvoiceSellModel);

                    return(output.Single());
                }
            }
            catch (Exception ex)
            {
                return(null);
            }
        }