Exemplo n.º 1
0
        public ActionResult ManageScheduledClasses_Create([DataSourceRequest] DataSourceRequest request, CRM_classPersonMapping _mapping, long oid)
        {
            if (ModelState.IsValid)
            {
                if (_PersonBAL.ManageScheduleCourse_DuplicationCheckBAL(_mapping) > 0)
                {
                    ModelState.AddModelError(lr.PersonPhoneNumber, lr.PersonPhoneDuplication);
                }
                else
                {
                    _mapping.PersonID  = oid;
                    _mapping.CreatedBy = CurrentUser.NameIdentifierInt64;
                    _mapping.CreatedOn = DateTime.Now;
                    _mapping.ID        = _PersonBAL.ManageScheduledClasses_CreateBAL(_mapping);
                }
            }
            var resultData = new[] { _mapping };

            return(Json(resultData.ToDataSourceResult(request, ModelState)));
        }