/// <summary> /// Creates a site referencing the provided client. /// </summary> /// <param name="pClient"></param> public SiteView(Client pClient) { try { mSite = new Site(db); foreman = new SiteContact(SiteContact.ContactTypes.Foreman, mSite.GetSiteID()); SuperVisor1 = new SiteContact(SiteContact.ContactTypes.Supervisor1, mSite.GetSiteID()); SuperVisor2 = new SiteContact(SiteContact.ContactTypes.Supervisor2, mSite.GetSiteID()); SupplyAuth = new SiteContact(SiteContact.ContactTypes.SupplyAuth, mSite.GetSiteID()); mSite.SetClientID(pClient.GetClientID()); mClient = pClient; } catch (Exception ex) { MessageBox.Show("Site Object - " + msgCodes.GetString("M2101") + ex.Message, "Error - 2102", MessageBoxButton.OK, MessageBoxImage.Error); } InitializeComponent(); isModified = false; this.Name = "SiteNewSite"; newSite = true; }
public LotView(Client client) { //This represents if a Client is directly creating a Lot Obj InitializeComponent(); try { mLot = new Lot(db); } catch (Exception ex) { MessageBox.Show("Lot Object - " + msgCodes.GetString("M2101") + ex.Message, "Error - 2102", MessageBoxButton.OK, MessageBoxImage.Error); } unlockForm(); this.Name = "NewLotView"; mLot.SetAssociationID(client.GetClientID()); mLot.SetRoughInValue(client.GetRoughInValue()); mLot.SetServiceValue(client.GetServiceValue()); mLot.SetFinalValue(client.GetFinalValue()); totalPortions[0] = client.GetRoughInValue(); totalPortions[1] = client.GetServiceValue(); totalPortions[2] = client.GetFinalValue(); }
private void UILoadDataSet(DataSet clientsData) { this.Clients.Children.Clear(); if (clientsData.NumberOfRows() != 0) { bool doneBuilders = false; while (clientsData.Read()) { Client client = new Client(clientsData.GetRecordDataSet()); TextBlock block = new TextBlock(); block.Text = client.GetName(); block.Name = "Client" + client.GetClientID(); clientsTable.Add(block.Name, client); Color forground = new Color(); forground.ScA = 1; forground.ScR = 1; forground.ScG = 1; forground.ScB = 1; block.Foreground = new SolidColorBrush(forground); block.FontSize = 14; block.MouseEnter += TextBlock_MouseEnter; block.MouseLeave += TextBlock_MouseLeave; block.MouseDown += TextBlock_DoubleClick; if (!doneBuilders & client.GetClientType() == 1) { Thickness padding = new Thickness(); padding.Top = 15; block.Padding = padding; doneBuilders = true; } this.Clients.Children.Add(block); } } else { MessageBox.Show("There are currently no clients in the System. Please create a client.", "No Clients Exist!", MessageBoxButton.OK, MessageBoxImage.Error); MainWindow.RemoveTab(this.Name); } }