public ActionResult Delete(int id)
        {
            int result = 0;

            if (UserRolePermissionForPage.Delete == true)
            {
                result = _iCommonService.GetValidateReference("RawMaterial", id.ToString());
                if (result > 0)
                {
                    return(RedirectToAction(nameof(Index), new { noDelete = result }));
                }
                else
                {
                    var deletedid = _iRawMaterialService.DeleteRawMaterial(id);
                    return(RedirectToAction(nameof(Index)));
                }
            }
            else
            {
                return(RedirectToAction("NotFound", "Error"));
            }
        }
Example #2
0
        public async Task <IActionResult> Delete(int id)
        {
            await _service.DeleteRawMaterial(id);

            return(RedirectToAction(nameof(Index)));
        }