Beispiel #1
0
        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"));
        }
Beispiel #2
0
        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)
            {
            }
        }
Beispiel #3
0
        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)
            {
            }
        }
Beispiel #4
0
        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"));
        }