示例#1
0
        public JsonResult AddOrUpdateUserGroup(SystemUserGroup systemUserGroupObj)
        {
            try
            {
                _UserDetailsBusinessLogic = new UserDetailsBusinessLogic();

                bool isSuccess = false;

                if (_UserDetailsBusinessLogic.IsUserGroupAvailable(systemUserGroupObj.UserGroupName) == true)
                {
                    isSuccess = _UserDetailsBusinessLogic.UpdateUserGroup(systemUserGroupObj);
                }
                else
                {
                    isSuccess = _UserDetailsBusinessLogic.SaveUserGroup(systemUserGroupObj);
                }

                return(Json(isSuccess));
            }
            catch (Exception ex)
            {
                currentFile = this.ControllerContext.RouteData.Values["controller"].ToString(); // System.Diagnostics.StackTrace(true).GetFrame(0).GetFileName();
                StackTrace st = new StackTrace();
                StackFrame sf = st.GetFrame(0);
                methodName = sf.GetMethod().Name;
                ErrorLogHelper.UpdatingErrorLog(currentFile + "-" + methodName, "UName", ex);
                return(Json(false));
            }
        }