Ejemplo n.º 1
0
 public ActionResult CropDelete(CropDeleteViewModel dvm)
 {
     if (ModelState.IsValid)
     {
         _ud.DeleteFieldCrop(dvm.fldName, dvm.id);
         return(Json(new { success = true, reload = true }));
     }
     return(PartialView("CropDelete", dvm));
 }
Ejemplo n.º 2
0
        public ActionResult CropDelete(string fldName, int id)
        {
            var dvm = new CropDeleteViewModel
            {
                id      = id,
                fldName = fldName
            };

            FieldCrop crp = _ud.GetFieldCrop(fldName, id);

            if (!string.IsNullOrEmpty(crp.cropOther))
            {
                dvm.cropName = crp.cropOther;
            }
            else
            {
                dvm.cropName = _sd.GetCrop(Convert.ToInt32(crp.cropId)).CropName;
            }

            dvm.act = "Delete";

            return(PartialView("CropDelete", dvm));
        }