private void btnSave_Click(object sender, EventArgs e) { try { if (txtSiteName.Text == "") { MessageBox.Show("You Must Enter Site Name"); return; } else if (txtSiteAddress.Text == "") { MessageBox.Show("You Must Enter Site Address"); return; } site.Add(new Site() { Site_Code = int.Parse(txtSiteCode.Text), Site_Name = txtSiteName.Text, Address = txtSiteAddress.Text, City_Code = int.Parse(cmbCity.SelectedValue.ToString()), Site_Type = cmbType.Text, Notes = txtNotes.Text }); btnSave.Enabled = false; btnAddNew.Enabled = btnModify.Enabled = true; MessageBox.Show("New Site Successfully Added"); FRM_Site_Load(null, null); btnLast_Click(null, null); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void AddSiteData(Packet packet) { var sitemanager = new SiteManager(); var dt = packet.Data.ToString().Split('|'); var bk = (BookmakerType)Enum.Parse(typeof(BookmakerType), dt[0]); var site = dt[1]; sitemanager.Add(bk, site); }