Esempio n. 1
0
        public ActionResult RoleEdit(string EntryKey, string Func)
        {
            AppraisalApproverModel appraisalApproverModel = new AppraisalApproverModel();

            if (String.IsNullOrEmpty(EntryKey) || String.IsNullOrEmpty(Func))
            {
                TempData["ErrorMessage"] = "Error : Please access the page properly.";
            }
            else
            {
                if (Func.Equals("Edit"))
                {
                    appraisalApproverModel = LINQCalls.getRoleSetupEntry(EntryKey);
                }
                else
                {
                    string retVal = new AppDatabase().deleteRoleSetup(EntryKey, "AppraisalDbConnectionString");
                    if (!String.IsNullOrEmpty(retVal) && !retVal.Split('|')[0].Equals("0"))
                    {
                        TempData["ErrorMessage"] = "Error : " + retVal.Split('|')[1];
                    }
                    else
                    {
                        return(RedirectToAction("ViewHRUsers"));
                    }
                }
            }
            TempData["appraisalApproverModel"] = appraisalApproverModel;
            return(RedirectToAction("HRRoleSetup"));
        }