public ActionResult TypeofMiningEdit(int PermitKey, int Id)
 {
     MiningEquipmentDO ME = TypeAndMethodOfMiningBLL.GetMiningEquipment(Id);
     MiningEquipmentVM model = new MiningEquipmentVM(ME);
     return PartialView("TypeofMiningAddEdit", model);
 }
        public ActionResult TypeofMiningEdit(int PermitKey, MiningEquipmentVM model)
        {
            if (!ModelState.IsValid)
                return PartialView("TypeofMiningAddEdit", model);

            try
            {
                MiningEquipmentDO data = model.WriteDataToTables();
                TypeAndMethodOfMiningBLL.SaveMiningEquipment(data);
                AjaxResult result = new AjaxResult(AjaxResult.AjaxStatus.OK, "Mining Equipment was saved");
                return Json(result);
            }
            catch (Exception ex)
            {
                AjaxResult result = new AjaxResult(AjaxResult.AjaxStatus.ERROR, ex.Message);
                return Json(result);
            }
        }
 public ActionResult TypeofMiningAdd(int PermitKey)
 {
     MiningEquipmentVM model = new MiningEquipmentVM();
     model.PermitKey = PermitKey;
     return PartialView("TypeofMiningAddEdit", model);
 }