ChrisCompleteCodeTrunk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
using ActionTireCo.Crm.Model.Database;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace ActionTireCo.Crm.Controllers
{
public class NoteController : Controller
{
[HttpPost]
public ActionResult Add(Note note)
{
try
{
ActionTireCoCrmContext context = new ActionTireCoCrmContext();
note.UserId = ((User)Session["User"]).Id;
note.NoteTypeId = 1;
note.DateCreated = DateTime.Now;
note.Active = true;
context.Note.Add(note);
context.SaveChanges();
return RedirectToAction("Edit", "Customer", new { @customerId = note.CustomerId });
}
catch {
return RedirectToAction("Edit", "Customer", new { @customerId = note.CustomerId, @errorMessage = "Unable to add note." });
}
}
}
}
|
Revision |
Author |
Commited |
Message |
1
|
BBDSCHRIS
|
Wed 22 Aug, 2018 20:08:03 +0000 |
|