public ActionResult ClosingIncident() { var incidents = new ModelIncidents(); incidents.NumberIncident = Request["NumberIncident"]; incidents.Caller = Request["Caller"]; incidents.Status = "Closed"; incidents.WorkNotes = Request["WorkNotes"]; incidents.ResolutionInformation = Request["ResolutionInformation"]; incidents.Description = Request["Description"]; incidents.Tecnico = Request["idNameTec"]; incidents.AlterIncidentByNumber(incidents); return(RedirectToAction("AllIncident")); }
public void Save(ModelIncidents incident) { try { using (SqlConnection connection = new SqlConnection(sqlConnection())) { string queryString = "INSERT INTO INCIDENT(NUMBERINCIDENT, CALLER, STATUS, WORKNOTES, RESOLUTIONINFORMATION, DESCRIPTION, TempoResolucao) VALUES('" + incident.NumberIncident + "','" + incident.Caller + "','" + incident.Status + "','" + incident.WorkNotes + "','" + incident.ResolutionInformation + "','" + incident.Description + "', '" + incident.TempoResolucao + "')"; SqlCommand command = new SqlCommand(queryString, connection); command.Connection.Open(); command.ExecuteNonQuery(); } } catch (Exception ex) { } }
public void AlterIncident(ModelIncidents incident) { try { using (SqlConnection connection = new SqlConnection(sqlConnection())) { string queryString = "UPDATE INCIDENT SET NUMBERINCIDENT = '" + incident.NumberIncident + "', CALLER = '" + incident.Caller + "', STATUS = '" + incident.Status + "', WORKNOTES = '" + incident.WorkNotes + "', RESOLUTIONINFORMATION = '" + incident.ResolutionInformation + "', DESCRIPTION = '" + incident.Description + "', Tecnico = '" + incident.Tecnico + "' WHERE NUMBERINCIDENT ='" + incident.NumberIncident + "'"; SqlCommand command = new SqlCommand(queryString, connection); command.Connection.Open(); command.ExecuteNonQuery(); } } catch (Exception ex) { } }
public ActionResult Save() { ModelIncidents incidents = new ModelIncidents(); incidents.NumberIncident = incidents.generationNumberIncident(); incidents.Caller = Request["Caller"]; incidents.Status = "Open"; incidents.WorkNotes = Request[""]; incidents.ResolutionInformation = ""; incidents.Description = Request["Description"]; incidents.dateLimiteRequest(); incidents.Save(); TempData["Employee"] = Request["Caller"]; return(RedirectToAction("AllIncident")); }