private void ButtonSubscribe3_Click(object sender, EventArgs e) { Subscribe get = new Subscribe(); get.Subscribe_Load(3, PublisherName); MainControlClass.showControl(get, Content); }
private void ButtonSearch_Click(object sender, EventArgs e) { SqlConnection con = new SqlConnection("Data Source=DESKTOP-D2ICRPB;Initial Catalog=eMagazine;Integrated Security=True"); con.Open(); SqlCommand cmd = con.CreateCommand(); cmd.CommandType = CommandType.Text; cmd.CommandText = "Select publisher from MagazineInfo where [publisher]='" + textBoxSearch.Text + "'"; cmd.Connection = con; SqlDataReader rd = cmd.ExecuteReader(); while (rd.Read()) { if (rd[0].ToString().Trim() == textBoxSearch.Text) { q = 1; break; } } if (q == 1) { MagazineFound ts = new MagazineFound(); ts.MagazineFound_Load(textBoxSearch.Text); MainControlClass.showControl(ts, Content); } else { } con.Close(); }
private void BunifuFlatButton3_Click(object sender, EventArgs e) { sidePanel.Height = bunifuFlatButton3.Height; sidePanel.Top = bunifuFlatButton3.Top; SelectMagazineRead get = new SelectMagazineRead(); MainControlClass.showControl(get, Content); }
private void BunifuFlatButton2_Click(object sender, EventArgs e) { sidePanel.Height = bunifuFlatButton2.Height; sidePanel.Top = bunifuFlatButton2.Top; Browse gs = new Browse(); MainControlClass.showControl(gs, Content); }
private void BunifuFlatButton1_Click(object sender, EventArgs e) { sidePanel.Height = bunifuFlatButton1.Height; sidePanel.Top = bunifuFlatButton1.Top; Home get = new Home(); MainControlClass.showControl(get, Content); }
public SubscriberHome() { InitializeComponent(); sidePanel.Height = bunifuFlatButton1.Height; sidePanel.Top = bunifuFlatButton1.Top; Home get = new Home(); MainControlClass.showControl(get, Content); }
private void ButtonConfirm_Click(object sender, EventArgs e) { SubscriberHome get = new SubscriberHome(); MainControlClass get1 = new MainControlClass(); Home get3 = new Home(); con.Open(); SqlCommand cmd = new SqlCommand("Select magazineID from MagazineInfo where [publisher]='" + publisher + "' AND Issue#='" + issueNo + "' ", con); SqlDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { magID = dr.GetValue(0).ToString(); break; } con.Close(); List <string> linesData = File.ReadAllLines(get1.tempCustomerIDLoc).ToList(); foreach (var line in linesData) { string[] entries = line.Split(','); get1.CustomerID = entries[0]; break; } if (comboBoxNoOfMonths.SelectedIndex == 0) { con.Open(); SqlCommand cmdr0 = new SqlCommand("Insert Into Subscription values('" + get1.CustomerID + "','" + Int32.Parse(magID) + "','" + DateTime.Now.ToString("M-d-yyyy") + "','" + DateTime.Now.AddDays(30).ToString("M-d-yyyy") + "')", con); cmdr0.ExecuteNonQuery(); con.Close(); MessageBox.Show("Subscription Success!"); MainControlClass.showControl(get3, Content); } else if (comboBoxNoOfMonths.SelectedIndex == 1) { con.Open(); SqlCommand cmdr1 = new SqlCommand("Insert Into Subscription values('" + get1.CustomerID + "','" + Int32.Parse(magID) + "','" + DateTime.Now.ToString("M-d-yyyy") + "','" + DateTime.Now.AddDays(60).ToString("M-d-yyyy") + "')", con); cmdr1.ExecuteNonQuery(); con.Close(); MessageBox.Show("Subscription Success!"); MainControlClass.showControl(get3, Content); } else if (comboBoxNoOfMonths.SelectedIndex == 2) { con.Open(); SqlCommand cmdr2 = new SqlCommand("Insert Into Subscription values('" + get1.CustomerID + "','" + Int32.Parse(magID) + "','" + DateTime.Now.ToString("M-d-yyyy") + "','" + DateTime.Now.AddDays(90).ToString("M-d-yyyy") + "')", con); cmdr2.ExecuteNonQuery(); con.Close(); MessageBox.Show("Subscription Success!"); MainControlClass.showControl(get3, Content); } else if (comboBoxNoOfMonths.SelectedIndex == 3) { con.Open(); SqlCommand cmdr3 = new SqlCommand("Insert Into Subscription values('" + get1.CustomerID + "','" + Int32.Parse(magID) + "','" + DateTime.Now.ToString("M-d-yyyy") + "','" + DateTime.Now.AddDays(120).ToString("M-d-yyyy") + "')", con); cmdr3.ExecuteNonQuery(); con.Close(); MessageBox.Show("Subscription Success!"); MainControlClass.showControl(get3, Content); } else if (comboBoxNoOfMonths.SelectedIndex == 4) { con.Open(); SqlCommand cmdr4 = new SqlCommand("Insert Into Subscription values('" + get1.CustomerID + "','" + Int32.Parse(magID) + "','" + DateTime.Now.ToString("M-d-yyyy") + "','" + DateTime.Now.AddDays(150).ToString("M-d-yyyy") + "')", con); cmdr4.ExecuteNonQuery(); con.Close(); MessageBox.Show("Subscription Success!"); MainControlClass.showControl(get3, Content); } else if (comboBoxNoOfMonths.SelectedIndex == 5) { con.Open(); SqlCommand cmdr5 = new SqlCommand("Insert Into Subscription values('" + get1.CustomerID + "','" + Int32.Parse(magID) + "','" + DateTime.Now.ToString("M-d-yyyy") + "','" + DateTime.Now.AddDays(180).ToString("M-d-yyyy") + "')", con); cmdr5.ExecuteNonQuery(); con.Close(); MessageBox.Show("Subscription Success!"); MainControlClass.showControl(get3, Content); } else { MessageBox.Show("Select how many months to subscribe"); } }