public FrmHangingFees(ArtistPresence presence, Artist artist, decimal fees) { InitializeComponent(); Presence = presence; StripeFirstTry = true; CmbPayee.Items.Add(artist.LegalName); if (!string.IsNullOrEmpty(Presence.AgentName)) { CmbPayee.Items.Add(Presence.AgentName); } CmbPayee.SelectedIndex = 0; FeesDue = fees; LblFees.Text = fees.ToString("C"); if (fees != 0) { return; } TabMethods.SelectedTab = TabWaive; TabMethods.Enabled = false; BtnSubmit.Enabled = false; }
public FrmArtistInventory(Artist artist, ArtistPresence presence) { InitializeComponent(); Artist = artist; Text = Artist.DisplayName + " -- Art Inventory"; Presence = presence; var data = Encoding.ASCII.GetBytes("action=GetInventory&AttendID=" + Presence.ArtistAttendingID); var request = WebRequest.Create(Program.URL + "/functions/artQuery.php"); request.ContentLength = data.Length; request.ContentType = "application/x-www-form-urlencoded"; request.Method = "POST"; using (var stream = request.GetRequestStream()) stream.Write(data, 0, data.Length); if (artist.IsEAP || artist.IsCharity) { BtnHangingFees.Enabled = false; } var response = (HttpWebResponse)request.GetResponse(); var results = new StreamReader(response.GetResponseStream()).ReadToEnd(); var inventory = JsonConvert.DeserializeObject <Dictionary <string, dynamic> >(results); if (inventory["showPieces"] != null) { ShowItems = JsonConvert.DeserializeObject <List <ArtShowItem> >(inventory["showPieces"].ToString()); foreach (var piece in ShowItems) { var item = new ListViewItem() { Text = piece.ShowNumber.ToString() }; item.SubItems.Add(piece.Title); item.SubItems.Add(piece.Media); var num = piece.PrintNumber ?? ""; if (piece.PrintMaxNumber != null) { num += " of " + piece.PrintMaxNumber.ToString(); } item.SubItems.Add(num); var bid = piece.MinimumBid != null?Convert.ToSingle(piece.MinimumBid).ToString("C") : "Not For Sale"; item.SubItems.Add(bid); item.SubItems.Add(piece.LocationCode); item.SubItems.Add(piece.Category); item.SubItems.Add(piece.CheckedIn ? "Yes" : "No"); item.Tag = piece; if (piece.FeesPaid || Artist.IsEAP || Artist.IsCharity) { item.BackColor = Color.LightGreen; } lstArtShow.Items.Add(item); } } if (inventory["printShopPieces"] != null) { ShopItems = JsonConvert.DeserializeObject <List <PrintShopItem> >(inventory["printShopPieces"].ToString()); foreach (var piece in ShopItems) { var item = new ListViewItem() { Text = piece.ShowNumber.ToString() }; item.SubItems.Add(piece.Title); item.SubItems.Add(piece.Media); item.SubItems.Add(piece.QuantitySent.ToString()); item.SubItems.Add(Convert.ToSingle(piece.Price).ToString("C")); item.SubItems.Add(piece.LocationCode); item.SubItems.Add(piece.Category); item.SubItems.Add(piece.CheckedIn ? "Yes" : "No"); item.Tag = piece; lstPrintShop.Items.Add(item); } } }
public FrmArtistDetails(Person person) { InitializeComponent(); var data = Encoding.ASCII.GetBytes("action=GetArtist&PeopleID=" + person.PeopleID + "&year=" + Program.Year.ToString()); var request = WebRequest.Create(Program.URL + "/functions/artQuery.php"); request.ContentLength = data.Length; request.ContentType = "application/x-www-form-urlencoded"; request.Method = "POST"; using (var stream = request.GetRequestStream()) stream.Write(data, 0, data.Length); var response = (HttpWebResponse)request.GetResponse(); var results = new StreamReader(response.GetResponseStream()).ReadToEnd(); var artistDetails = JsonConvert.DeserializeObject <Dictionary <string, dynamic> >(results); if (artistDetails["details"] != null) { Artist = JsonConvert.DeserializeObject <Artist>(artistDetails["details"].ToString()); TxtDisplayName.Text = Artist.DisplayName; TxtLegalName.Text = Artist.LegalName; ChkIsPro.Checked = Artist.IsPro; ChkIsEAP.Checked = Artist.IsEAP; TxtWebsite.Text = Artist.Website; TxtArtType.Text = Artist.ArtType; TxtArtistNotes.Text = Artist.Notes; ChkCharity.Checked = Artist.IsCharity; } else { Artist = new Artist { PeopleID = (int)person.PeopleID } }; if (artistDetails["presence"] != null) { Presence = JsonConvert.DeserializeObject <ArtistPresence>(artistDetails["presence"].ToString()); if (Presence.ArtistNumber != null) { Artist.ArtistNumber = (int)Presence.ArtistNumber; } TxtArtistNum.Text = Presence.ArtistNumber.ToString(); ChkIsAttending.Checked = Presence.IsAttending; ChkHasBadge.Checked = Presence.HasBadge; ChkPrintShop.Checked = Presence.HasPrintShop; TxtAgentName.Text = Presence.AgentName; TxtAgentContact.Text = Presence.AgentContact; TxtShippingPref.Text = Presence.ShippingPref; TxtShippingAddress.Text = Presence.ShippingAddress; ChkElectricity.Checked = Presence.NeedsElectricity; NumTables.Value = Presence.NumTables; NumGrid.Value = Presence.NumGrid; TxtExhibitNotes.Text = Presence.Notes; CmbStatus.SelectedItem = Presence.Status; TxtStatusReason.Text = Presence.StatusReason; TxtLocationCode.Text = Presence.LocationCode; TxtShippingCost.Text = Presence.ShippingCost.ToString(); TxtShippingPrepaid.Text = Presence.ShippingPrepaid.ToString(); TxtShippingDetails.Text = Presence.ShippingDetails; BtnInventory.Enabled = true; } else { Presence = new ArtistPresence(); CmbStatus.SelectedItem = "Pending"; BtnInventory.Enabled = false; } }
public FrmArtistCheckout(ArtistPresence presence) { InitializeComponent(); Presence = presence; CmbMarkMode.SelectedIndex = 0; var data = Encoding.ASCII.GetBytes("action=GetArtistCheckout&id=" + Presence.ArtistAttendingID + "&year=" + Program.Year.ToString()); var request = WebRequest.Create(Program.URL + "/functions/artQuery.php"); request.ContentLength = data.Length; request.ContentType = "application/x-www-form-urlencoded"; request.Method = "POST"; using (var stream = request.GetRequestStream()) stream.Write(data, 0, data.Length); var response = (HttpWebResponse)request.GetResponse(); var results = new StreamReader(response.GetResponseStream()).ReadToEnd(); Items = JsonConvert.DeserializeObject <List <CheckoutItems> >(results); decimal showTotal = 0; decimal shopTotal = 0; decimal feesDue = 0; decimal shippingCost = 0; foreach (var piece in Items.FindAll(i => !i.IsPrintShop)) { var item = new ListViewItem() { Text = piece.ShowNumber.ToString() }; item.SubItems.Add(piece.LocationCode); item.SubItems.Add(piece.Title); item.SubItems.Add(piece.Media); if (piece.FinalSalePrice != null) { item.SubItems.Add(((decimal)piece.FinalSalePrice).ToString("C")); showTotal += (decimal)piece.FinalSalePrice; } else { item.SubItems.Add("Not Sold"); } item.SubItems.Add(piece.Claimed ? "Yes" : "No"); item.Tag = piece; LstShowItems.Items.Add(item); if (piece.FeesPaid || piece.IsEAP) { continue; } if (piece.MinimumBid != null && piece.MinimumBid < 100) { feesDue += (decimal)0.5; } else { feesDue += 1; } } foreach (var piece in Items.FindAll(i => i.IsPrintShop)) { var item = new ListViewItem() { Text = piece.ShowNumber.ToString() }; item.SubItems.Add(piece.LocationCode); item.SubItems.Add(piece.Title); item.SubItems.Add(piece.Media); item.SubItems.Add((piece.QuantitySent - piece.QuantitySold).ToString()); item.SubItems.Add(((decimal)(piece.QuantitySold * piece.QuickSalePrice)).ToString("C")); item.SubItems.Add(piece.Claimed ? "Yes" : "No"); item.Tag = piece; LstShopItems.Items.Add(item); shopTotal += (decimal)piece.QuantitySold * (decimal)piece.QuickSalePrice; } if (Presence.ShippingCost != null && Presence.ShippingPrepaid != null) { shippingCost = (decimal)Presence.ShippingCost - (decimal)Presence.ShippingPrepaid; LblShippingCost.Text = shippingCost.ToString("C"); LblShippingCost.ForeColor = shippingCost >= 0 ? Color.Red : Color.Green; LblShippingCostText.Text = shippingCost >= 0 ? "Shipping Cost" : "Shipping Refund"; } else { LblShippingCostText.Text = ""; LblShippingCost.Text = ""; } LblShowTotal.Text = showTotal.ToString("C"); LblShopTotal.Text = shopTotal.ToString("C"); var conShare = (showTotal + shopTotal) * (decimal)0.1; LblConShare.Text = conShare.ToString("C"); LblHangingFees.Text = feesDue.ToString("C"); LblTotalOwed.Text = (showTotal + shopTotal - conShare - feesDue - shippingCost).ToString("C"); }