Subversion Repository Public Repository

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
32
33
using ActionTireCo.Crm.Model.Database;
using ActionTireCo.Crm.Model.View;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace ActionTireCo.Crm.Controllers
{
    public class CallController : Controller
    {
        [HttpPost]
        public ActionResult Add(Call call)
        {
            try
            {
                ActionTireCoCrmContext context = new ActionTireCoCrmContext();
                call.CallTypeId = 1;
                call.UserId = ((User)Session["User"]).Id;
                call.DateCreated = DateTime.Now;
                call.Active = true;
                context.Call.Add(call);
                context.SaveChanges();
                return RedirectToAction("Edit", "Customer", new { @customerId = call.CustomerId });
            }
            catch
            {
                return RedirectToAction("Edit", "Customer", new { @customerId = call.CustomerId, @errorMessage = "Unable to add note." });
            }
        }
    }
}

Commits for ChrisCompleteCodeTrunk/ActionTireCo/ActionTireCo.Crm/Controllers/CallController.cs

Diff revisions: vs.
Revision Author Commited Message
1 BBDSCHRIS picture BBDSCHRIS Wed 22 Aug, 2018 20:08:03 +0000