Public bool savebtn (string companyName, string contactName, string phone, string email, DateTime saleDate, string number, string brief, string goods, Decimal quotation, string seller, string handler)
{
///// DAL. Sale. Insert (seller, handler, brief, goods); // transaction processing is still the error of yesterday, and direct insertion is correct!
// QueryCommandCollection coll = new QueryCommandCollection ();
// QueryCommand insert = new QueryCommand ("insert sales (companyName, contactName, phone, email, saleDate, number, quotation, brief, goods, seller, handler) values (@ companyName, @ contactName, @ phone, @ email, @ saleDate, @ number, @ quotation, @ brief, @ goods, @ seller, @ handler )");
// Insert. Parameters. Add ("@ companyName", companyName );
// Insert. Parameters. Add ("@ contactName", contactName );
// Insert. Parameters. Add ("@ phone", phone );
// Insert. Parameters. Add ("@ email", email );
// Insert. Parameters. Add ("@ saleDate", saleDate );
// Insert. Parameters. Add ("@ number", number );
// Insert. Parameters. Add ("@ quotation", quotation );
// Insert. Parameters. Add ("@ brief", brief );
// Insert. Parameters. Add ("@ goods", goods );
// Insert. Parameters. Add ("@ seller", seller );
// Insert. Parameters. Add ("@ handler", handler );
// Coll. Add (insert );
// DataService. ExecuteTransaction (coll );
// Return true;
DAL. Sale insert = new Product. DAL. Sale ();
Insert. CompanyName = companyName;
Insert. ContactName = contactName;
Insert. Phone = phone;
Insert. Email = email;
Insert. SaleDate = saleDate;
Insert. Number = number;
Insert. Quotation = quotation;
Insert. Brief = brief;
Insert. Goods = goods;
Insert. Seller = seller;
Insert. Handler = handler;
Try
{
Insert. Save ();
Return true;
}
Catch
{
Return false;
}
}