Ejemplo n.º 1
0
        public ActionResult Jobs_Create([DataSourceRequest] DataSourceRequest request, JobViewModel custVM)
        {
            if (custVM != null && ModelState.IsValid)
            {
                MJob cust = new MJob();
                cust.SetAssignedIdTo(Guid.NewGuid().ToString());

                ConvertToJob(custVM, cust);

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

                _jobTasks.Insert(cust);
            }

            return(Json(new[] { custVM }.ToDataSourceResult(request, ModelState)));
        }
Ejemplo n.º 2
0
        public ActionResult MJobs_Create([DataSourceRequest] DataSourceRequest request, MJobViewModel vm)
        {
            if (vm != null && ModelState.IsValid)
            {
                MJob entity = new MJob();
                entity.SetAssignedIdTo(Guid.NewGuid().ToString());

                ConvertToMJob(vm, entity);

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

                _tasks.Insert(entity);
            }

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