private void btnCreate_Click(object sender, EventArgs e) { try { this.Hide(); ClearForm(); LoginCreateUser form1 = new LoginCreateUser(); form1.Text = "LandscaperZ - Create User"; form1.ShowDialog(); this.Show(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error Logging in. Make sure your credentials are correct.", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
//Requests a job: Writes job to databse linked to customer who wrote it. Also sends new users to create account private void btnRequest_Click(object sender, EventArgs e) { if (tbxJobAddress.Text.Equals("") || tbxJobType.Text.Equals("")) { MessageBox.Show("Please give us some more info about the job"); } else { try { if (cust.Equals("Guest")) { MessageBox.Show("Make an account before requesting job"); LoginCreateUser form1 = new LoginCreateUser(); form1.ShowDialog(); this.Hide(); } else { string jobType = tbxJobType.Text; string jobAddress = tbxJobAddress.Text; string begDate = dtpBegDate.Value.ToString("yyyy-MM-dd"); string endDate = dtpEndDate.Value.ToString("yyyy-MM-dd"); if (endDate.Equals("")) { endDate = "NULL"; } CustomerProgOps.Open(); CustomerProgOps.startCreateCustomerJob(custID, jobType, jobAddress, begDate, endDate); lblTest.Text = "Success! Your job has been added. Make a payment on your job or contact your contractor"; CustomerProgOps.Open(); CustomerProgOps.LoadJobView(dgvJobInfo, custID); CustomerProgOps.CloseAllCust(); ClearForm(); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error Creating Job. Try Again", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }