private void metroButton2_Click_1(object sender, EventArgs e) { try { // DateTime temp = clientRelationsDateTime.Value; DateTime relYear = clientRelationsDateTime.Value; int staffId = employeeNo; int telephoneSkills = int.Parse(this.telephoneSkills.Text); int problemResolution = int.Parse(this.problemResolution.Text); int salesmanship = int.Parse(this.salesmanship.Text); int proActiveness = Int32.Parse(proactiveness.Text); int politeness = int.Parse(this.politeness.Text); ClientRelations CRObj = new ClientRelations(staffId, relYear, telephoneSkills, problemResolution, salesmanship, proActiveness, politeness); Database.updateClientRelations(CRObj); Notification.showNotification(); metroButton1.Enabled = true; metroButton2.Enabled = false; clientRelationsDateTime.Enabled = false; } catch (Exception ex) { MessageBox.Show("Something went wrong! + " + ex + "", "Update client", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public static void addClientRelations(ClientRelations clientRelationsObj) { try { DBConnection.updateDB("insert into client_relations(staff_id, rel_year, telephone_skills, problem_resolution, salesmanship, pro_activeness, politeness)values('" + clientRelationsObj.StaffId + "','" + clientRelationsObj.RelYear.ToString("yyyy/M/d") + "', '" + clientRelationsObj.TelephoneSkills + "', '" + clientRelationsObj.ProblemResolution + "','" + clientRelationsObj.Salesmanship + "','" + clientRelationsObj.ProActiveness + "','" + clientRelationsObj.Politeness + "')"); } catch (Exception) { MessageBox.Show("Something went wrong!", "Update client", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public static void updateClientRelations(ClientRelations clientRelationsObj) { try { DBConnection.updateDB("update client_relations set" + " telephone_skills = '" + clientRelationsObj.TelephoneSkills + "'," + " problem_resolution = '" + clientRelationsObj.ProblemResolution + "', salesmanship = '" + clientRelationsObj.Salesmanship + "'," + " pro_activeness = '" + clientRelationsObj.ProActiveness + "', politeness = '" + clientRelationsObj.Politeness + "' where rel_year = '" + clientRelationsObj.RelYear.ToString("yyyy/M/d") + "'"); } catch (Exception ex) { MessageBox.Show("Something went wrong! + '" + ex + "'", "Update client", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void metroButton2_Click_1(object sender, EventArgs e) { //int staffId = employeeNo; //int influence = Int32.Parse(influenceTxtbox.Text); //int presentation = Int32.Parse(presentationTxtbox.Text); //int relationships = Int32.Parse(relationshipTxtbox.Text); //int listening = Int32.Parse(listeningTxtbox.Text); //int negotiation = Int32.Parse(negotiationTxtbox.Text); //CommunicationSkills cS = new CommunicationSkills(staffId, getDate(), influence, presentation, relationships, listening, negotiation); //Database.updateCommunicationSkills(cS); ////Notification.showNotification(); //notifyIcon1.Icon = SystemIcons.Application; //notifyIcon1.BalloonTipText = "Record Updated!"; //notifyIcon1.ShowBalloonTip(1000); //CSAddBtn.Enabled = true; //CSUpdateBtn.Enabled = false; try { int staffId = employeeNo; int telephoneSkills = int.Parse(this.telephoneSkills.Text); int problemResolution = int.Parse(this.problemResolution.Text); int salesmanship = int.Parse(this.salesmanship.Text); int proActiveness = Int32.Parse(proactiveness.Text); int politeness = int.Parse(this.politeness.Text); ClientRelations CRObj = new ClientRelations(staffId, getDate(), telephoneSkills, problemResolution, salesmanship, proActiveness, politeness); Database.updateClientRelations(CRObj); notifyIcon1.Icon = SystemIcons.Application; notifyIcon1.BalloonTipText = "Record Updated!"; notifyIcon1.ShowBalloonTip(1000); CRAddBtn.Enabled = true; CRUpdateBtn.Enabled = false; } catch (Exception ex) { MessageBox.Show("Something went wrong! + " + ex + "", "Update client", MessageBoxButtons.OK, MessageBoxIcon.Error); } }