Exemplo n.º 1
0
        public ActionResult Delete(int Id)
        {
            string strReturn = string.Empty;

            try
            {
                etblRankManagement prop = new etblRankManagement();
                prop = BL_tblRankManagement.GetRankManagementByID(Id);
                if (prop.cStatus == "A")
                {
                    prop.cStatus = "I";
                }
                else if (prop.cStatus == "I")
                {
                    prop.cStatus = "A";
                }

                int val = BL_tblRankManagement.DeleteRecord(prop);
                if (val == 1)
                {
                    if (prop.cStatus == "I")
                    {
                        TempData["msg"] = "Disabled successfully";
                    }
                    else
                    {
                        TempData["msg"] = "Enabled successfully";
                    }
                }
                else
                {
                    TempData["ERROR"] = "Kindly try after some time";
                }
            }
            catch (Exception)
            {
            }
            return(RedirectToAction("Index"));
        }