public CustomerFacility(Guid customerfacilityid, Address address, Territory territory, Customer customer) { this.customerfacilityid= customerfacilityid; this.address= address; this.territory= territory; this.customer= customer; }
public void BindData(Guid customerID) { customer = CustomerManager.GetCustomerByID(customerID); if (customer != null) { this.Text = customer.Name + " - Szczegóły"; this.txtName.Text = customer.Name; this.txtCode.Text = customer.Code; this.txtNIP.Text = customer.NIP; this.txtREGON.Text = customer.REGON; this.txtKRS.Text = customer.KRS; this.txtDesc.Text = customer.FullDescription; this.txtEmail.Text = customer.Email; this.txtPhone.Text = customer.Phone; } }
public static IList<Invoice> GetInvoices(Customer customer) { IList<CustomerFacility> facilities = CustomerFacilityDB.GetCustomerFacilities(customer.CustomerID, Guid.Empty); string sqlQuery = "SELECT * FROM Invoice inv Join [Order] ord on inv.OrderID=ord.OrderID WHERE ord.CustomerFacilityID IN "; StringBuilder INBuilder = new StringBuilder(); INBuilder.Append("( "); for (int i = 0; i < facilities.Count; i++) { INBuilder.Append("'" + facilities[i].CustomerFacilityID + "',"); } INBuilder.Remove(INBuilder.Length - 1, 1); INBuilder.Append(") "); sqlQuery += INBuilder.ToString(); return GetInvoiceListFromQuery(sqlQuery); }
private static Customer GetCustomerFromReader(IDataReader dataReader) { Customer customer = new Customer(); customer.CustomerID = DBHelper.GetGuid(dataReader, "CustomerID"); customer.ContactID = DBHelper.GetGuid(dataReader, "ContactID"); customer.FullDescription = DBHelper.GetString(dataReader, "FullDescription"); customer.CustomerSince = DBHelper.GetNullableDateTime(dataReader, "CustomerSince"); customer.CustomerTo = DBHelper.GetNullableDateTime(dataReader, "CustomerTo"); customer.Code = DBHelper.GetString(dataReader, "Code"); customer.Name = DBHelper.GetString(dataReader, "Name"); customer.NIP = DBHelper.GetString(dataReader, "NIP"); customer.KRS = DBHelper.GetString(dataReader, "KRS"); customer.REGON = DBHelper.GetString(dataReader, "REGON"); customer.Email = DBHelper.GetString(dataReader, "Email"); customer.Phone = DBHelper.GetString(dataReader, "Phone"); return customer; }
public static IList<Order> GetOrders(Customer customer) { if (customer == null) return GetOrders(); return OrderDB.GetOrders(customer); }
public static IList<Invoice> GetInvoices(Customer customer) { if (customer == null) return GetInvoices(); return InvoiceDB.GetInvoices(customer); }