public ActionResult Facilities_Update([DataSourceRequest] DataSourceRequest request, Models.FacilityViewModel facility)
        {
            if (ModelState.IsValid)
            {
                var entity = new Facility
                {
                    FacilityId       = facility.FacilityId,
                    GroupId          = facility.GroupId,
                    StateId          = facility.StateId,
                    CountyId         = facility.CountyId,
                    FacilityCode     = facility.FacilityCode,
                    FacilityName     = facility.FacilityName,
                    City             = facility.City,
                    Postal           = facility.Postal,
                    FacilityIsActive = facility.FacilityIsActive,
                };

                _db.Facilities.Attach(entity);
                _db.Entry(entity).State = EntityState.Modified;
                _db.SaveChanges();
            }

            return(Json(new[] { facility }.ToDataSourceResult(request, ModelState)));
        }
示例#2
0
 public ActionResult Users_Destroy([DataSourceRequest] DataSourceRequest request, Models.FacilityViewModel facility)
 {
     throw new NotImplementedException();
 }