Beispiel #1
0
        public ActionResult Costs_Create([DataSourceRequest] DataSourceRequest request, CostViewModel custVM)
        {
            if (custVM != null && ModelState.IsValid)
            {
                MCost cust = new MCost();
                cust.SetAssignedIdTo(Guid.NewGuid().ToString());

                ConvertToCost(custVM, cust);

                cust.CreatedDate = DateTime.Now;
                cust.CreatedBy   = User.Identity.Name;
                cust.DataStatus  = "New";

                _costTasks.Insert(cust);
            }

            return(Json(new[] { custVM }.ToDataSourceResult(request, ModelState)));
        }