Hi Team
I need some help, i have this following logic and it saved to my local database, need help immediately when a user sends a submit button the data sends an email notification. Detailing data being saved and user can view. This is my current code
// Controller
// saving values to the database records.
public ActionResult SaveIncidentTemplates(Incident_DropDown incident_templates)
{
if (ModelState.IsValid)
{
using (TimeLineApplicationDBContext db = new TimeLineApplicationDBContext())
{
Incident_Template template = new Incident_Template
{
Title = incident_templates.Title,
Date_Occured = incident_templates.Date.Date.ToString(),
Time = incident_templates.Date.TimeOfDay, //what? it was a comment
Description = incident_templates.Description
};
try
{
db.Incident_Template.Add(template);
db.SaveChanges();
}
catch(Exception ex)
{
}
}
}
return View();
}
// Model
public class Incident_DropDown
{
public string Title { get; set; }
public string Description { get; set; }
public string Date_Occured { get; set; }
public TimeSpan Time { get; set; }
public string Assignment_Group { get; set; }
public DateTime Date { get; set; }
public string Reported_CI { get; set; }
}
// View
Sachin SinghPosted Nov 15, 2021, 9:06 AM
Guest UserPosted Nov 15, 2021, 9:03 AM
Sachin SinghPosted Nov 15, 2021, 6:51 AM
Guest UserPosted Nov 15, 2021, 6:41 AM
Sachin SinghPosted Nov 15, 2021, 6:23 AM
";