public ActionResult DestroyDispositionOptionAsync(int id)
        {
            DispositionOptionViewModel obj = mainRepository.GetDispositionOptionsById(id);

            mainRepository.DeleteDispositionOption(obj);
            return(Json(""));
        }
        public void InsertDispositionOption(DispositionOptionViewModel ovm)
        {
            DispositionOption newRecord = new DispositionOption {
                DOP_Id = ovm.Id, DOP_Name = ovm.Name.Trim()
            };

            context.DispositionOptions.Add(newRecord);
            context.SaveChanges();
        }
        public void UpdateDispositionOption(DispositionOptionViewModel ovm)
        {
            DispositionOption newRecord = new DispositionOption {
                DOP_Id = ovm.Id, DOP_Name = ovm.Name
            };

            context.DispositionOptions.Attach(newRecord);
            context.Entry(newRecord).State = EntityState.Modified;
            context.SaveChanges();
        }
        public void DeleteDispositionOption(DispositionOptionViewModel ovm)
        {
            DispositionOption newRecord = new DispositionOption {
                DOP_Id = ovm.Id, DOP_Name = ovm.Name
            };

            context.DispositionOptions.Attach(newRecord);
            context.DispositionOptions.Remove(newRecord);
            context.SaveChanges();
        }
 public ActionResult DestroyDispositionOption([DataSourceRequest] DataSourceRequest request, DispositionOptionViewModel obj)
 {
     mainRepository.DeleteDispositionOption(obj);
     return(Json(new[] { obj }.ToDataSourceResult(request, ModelState)));
 }
 public ActionResult CreateDispositionOption([DataSourceRequest] DataSourceRequest request, DispositionOptionViewModel obj)
 {
     if (ModelState.IsValid)
     {
         mainRepository.InsertDispositionOption(obj);
     }
     return(Json(new[] { obj }.ToDataSourceResult(request, ModelState)));
 }