I want to create a default color when I add a new event.
Now the color is set to NULL.
[HttpPost]
public JsonResult SaveEvent(Event e)
{
var status = false;
if (e.EventID > 0)
{
//Update the event
var v = db.Events.Where(a => a.EventID == e.EventID).FirstOrDefault();
if (v != null)
{
v.EventTitle = e.EventTitle;
v.EventDescription = e.EventDescription;
v.ThemeColor = e.ThemeColor;
}
}
else
{
db.Events.Add(e);
}
db.SaveChanges();
status = true;
return new JsonResult { Data = new { status = status } };
}
How make ThemeColor red when I add the event ?
public partial class Event
{
public int EventID { get; set; }
public string EventTitle { get; set; }
public string EventDescription { get; set; }
public Nullable<System.DateTime> StartDate { get; set; }
public Nullable<System.DateTime> EndDate { get; set; }
public string ThemeColor { get; set; }
}