public static List <OurCustomer> List() { List <OurCustomer> OurCustomerList = new List <OurCustomer>(); SqlConnection connection = OnlineSales2Data.GetConnection(); string selectStatement = "SELECT " + " [UserId] " + "FROM " + " [OurCustomer] " + ""; SqlCommand selectCommand = new SqlCommand(selectStatement, connection); try { connection.Open(); SqlDataReader reader = selectCommand.ExecuteReader(); OurCustomer OurCustomer = new OurCustomer(); while (reader.Read()) { OurCustomer = new OurCustomer(); OurCustomer.UserId = System.Convert.ToInt32(reader["UserId"]); OurCustomerList.Add(OurCustomer); } reader.Close(); } catch (SqlException) { return(OurCustomerList); } finally { connection.Close(); } return(OurCustomerList); }
public void test() { var ourCustomer = new OurCustomer("Sheen", "Dayal"); var adapter = new CustomerAdapter(); var customer = adapter.ConvertToCustomer(ourCustomer); var adaptorInterface = new CustomerAdapter2(); customer = adaptorInterface.Convert(ourCustomer); }
public ActionResult Edit([Bind(Include = " UserId" + ",QbCustomerId" + ",QuickbooksAccessToken" + ",QuickbooksSecretToken" + ",QbSalesAccount" + ",QbSalesTax" + ",QbSalesDiscounts" + ",QbFreightIncome" + ",QbCash" + ",QbCostOfGoods" + ",QbUndepositiedFunds" + ",QbSalesId" + ",QbSalesTaxId" + ",QbDiscountsId" + ",QbFreightId" + ",QbCashId" + ",QbCostofGoodsId" + ",QbUndepositedFundsId" )] OurCustomer OurCustomer) { OurCustomer oOurCustomer = new OurCustomer(); oOurCustomer.UserId = System.Convert.ToInt32(OurCustomer.UserId); oOurCustomer = OurCustomerData.Select_Record(OurCustomer); if (ModelState.IsValid) { bool bSucess = false; bSucess = OurCustomerData.Update(oOurCustomer, OurCustomer); if (bSucess == true) { return(RedirectToAction("Index")); } else { ModelState.AddModelError("", "Can Not Update"); } } return(View(OurCustomer)); }
public OurCustomer AddOurCustomer(System.Guid CustomerID, string FirstName, string LastName, string MiddleName, string Address, string Apartment, string City, string State, string Zip, string HomePhone, string BusinessPhone, string FullName) { OurCustomer rowOurCustomer = ((OurCustomer)(this.NewRow())); rowOurCustomer.ItemArray = new object[] { CustomerID, FirstName, LastName, MiddleName, Address, Apartment, City, State, Zip, HomePhone, BusinessPhone, FullName }; this.Rows.Add(rowOurCustomer); return(rowOurCustomer); }
public ActionResult DeleteConfirmed( Int32?UserId ) { OurCustomer OurCustomer = new OurCustomer(); OurCustomer.UserId = System.Convert.ToInt32(UserId); OurCustomer = OurCustomerData.Select_Record(OurCustomer); bool bSucess = false; bSucess = OurCustomerData.Delete(OurCustomer); if (bSucess == true) { return(RedirectToAction("Index")); } else { ModelState.AddModelError("", "Can Not Delete"); } return(null); }
// GET: /OurCustomer/Delete/<id> public ActionResult Delete( Int32?UserId ) { if ( UserId == null ) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } OurCustomer OurCustomer = new OurCustomer(); OurCustomer.UserId = System.Convert.ToInt32(UserId); OurCustomer = OurCustomerData.Select_Record(OurCustomer); if (OurCustomer == null) { return(HttpNotFound()); } return(View(OurCustomer)); }
public ActionResult Create([Bind(Include = "QbCustomerId" + "," + "QuickbooksAccessToken" + "," + "QuickbooksSecretToken" + "," + "QbSalesAccount" + "," + "QbSalesTax" + "," + "QbSalesDiscounts" + "," + "QbFreightIncome" + "," + "QbCash" + "," + "QbCostOfGoods" + "," + "QbUndepositiedFunds" + "," + "QbSalesId" + "," + "QbSalesTaxId" + "," + "QbDiscountsId" + "," + "QbFreightId" + "," + "QbCashId" + "," + "QbCostofGoodsId" + "," + "QbUndepositedFundsId" )] OurCustomer OurCustomer) { if (ModelState.IsValid) { bool bSucess = false; bSucess = OurCustomerData.Add(OurCustomer); if (bSucess == true) { return(RedirectToAction("Index")); } else { ModelState.AddModelError("", "Can Not Insert"); } } return(View(OurCustomer)); }
public TheirInvoice AddTheirInvoice(System.Guid InvoiceID, System.DateTime InvoiceDate, string Terms, string FOB, string PO, OurCustomer parentOurCustomerByCustomerInvoice) { TheirInvoice rowTheirInvoice = ((TheirInvoice)(this.NewRow())); rowTheirInvoice.ItemArray = new object[] { InvoiceID, null, InvoiceDate, Terms, FOB, PO, parentOurCustomerByCustomerInvoice[0] }; this.Rows.Add(rowTheirInvoice); return(rowTheirInvoice); }
public OurCustomerChangeEvent(OurCustomer row, DataRowAction action) { this.eventRow = row; this.eventAction = action; }
public void RemoveOurCustomer(OurCustomer row) { this.Rows.Remove(row); }
public void AddOurCustomer(OurCustomer row) { this.Rows.Add(row); }
public Customer ConvertToCustomer(OurCustomer customer) { return(new Customer($"{customer.FirstName} {customer.LastName}")); }