public int executeSalesMaster() { int affectedLines = 0; try { sale.InvoiceID = SalesInvoiceID.Text; sale.CustomerName = CustomerName.SelectedItem.ToString(); sale.SellingCenter = SellingCenter.SelectedValue.ToString(); sale.SalesDate = SalesDate.SelectedDate.Value; sale.TotalSalesPrice = Convert.ToInt32(TotalSalesPrice.Text); sale.TotalItems = Convert.ToInt32(TotalSalesItems.Text); sale.Transport = TransportRequest.IsChecked.Value; affectedLines = handleDatabase.executeSalesMaster(sale); } catch (SqlException sqlException) { Console.WriteLine(sqlException); } return(affectedLines); }