예제 #1
0
        public ResponseResult getUserInfo(int UserId)
        {
            try
            {
                User StudentObject = DataService.getUserInfo(UserId);
                //Section UserSection = DataService.getUserSection(StudentObject.UserId);

                return(ResponseResult.GetSuccessObject(new
                {
                    StudentInfo = StudentObject
                }));

                //return (new
                //{
                //    data = new
                //    {
                //        StudentInfo = StudentObject
                //    },
                //    success = true,
                //    error = ""
                //});
            }
            catch (Exception ex)
            {
                CustomUtility.HandleException(ex);
                return(ResponseResult.GetErrorObject());
            }
        }
예제 #2
0
        public IActionResult Index()
        {
            var userInfo        = string.Format("api/GetUserById");
            var userInforResult = CustomUtility.GetSingleRecord <Users>(userInfo);

            return(View(userInforResult));
        }
예제 #3
0
        public ResponseResult GetActivePermissions()
        {
            try
            {
                var List = DataService.GetAllPermissions().Where(p => p.IsActive == true).ToList();

                return(ResponseResult.GetSuccessObject(new
                {
                    PermissionList = List
                }));

                //return (new
                //{
                //    data = new
                //    {
                //        PermissionList = List
                //    },
                //    success = true,
                //    error = ""
                //});
            }
            catch (Exception ex)
            {
                CustomUtility.HandleException(ex);
                return(ResponseResult.GetErrorObject());
            }
        }
예제 #4
0
 public ResponseResult getUsers()
 {
     try
     {
         var List = DataService.GetAllUsers();
         return(ResponseResult.GetSuccessObject(new
         {
             UserList = List
         }));
         //return (new
         //{
         //    data = new
         //    {
         //        UserList = List
         //    },
         //    success = true,
         //    error = ""
         //});
     }
     catch (Exception ex)
     {
         CustomUtility.HandleException(ex);
         return(ResponseResult.GetErrorObject());
     }
 }
예제 #5
0
 public ResponseResult SearchUsers(UserSearchParam pSearchParam)
 {
     try
     {
         var result = DataService.SearchUsers(pSearchParam);
         return(ResponseResult.GetSuccessObject(new
         {
             Count = result.ResultCount,
             UserList = result.Result
         }));
         //return (new
         //{
         //    data = new
         //    {
         //        Count = result.ResultCount,
         //        UserList = result.Result
         //    },
         //    success = true,
         //    error = ""
         //});
     }
     catch (Exception ex)
     {
         CustomUtility.HandleException(ex);
         return(ResponseResult.GetErrorObject());
     }
 }
예제 #6
0
        public ResponseResult SaveUserRoleMapping(int pUserID, List <int> pRoles)
        {
            try
            {
                var List = DataService.SaveUserRoleMapping(pUserID, pRoles);
                return(ResponseResult.GetSuccessObject(new
                {
                    Roles = List
                }, "Mappings are saved"));

                //return (new
                //{
                //    data = new
                //    {
                //        Roles = List
                //    },
                //    success = true,
                //    error = "Mappings are saved"
                //});
            }
            catch (Exception ex)
            {
                CustomUtility.HandleException(ex);
                return(ResponseResult.GetErrorObject());
            }
        }
예제 #7
0
 public ResponseResult SaveUsers(User u)
 {
     try
     {
         String msg;
         u.Password = PasswordSaltedHashingUtility.HashPassword("123");
         var result = DataService.SaveUsers(u, DateTime.UtcNow, SessionManager.CurrentUser.UserId);
         if (result > 0)
         {
             if (u.UserId > 0)
             {
                 msg = "User Updated Successfully";
             }
             else
             {
                 msg = "User Added Successfully";
             }
             return(ResponseResult.GetSuccessObject(new
             {
                 UserId = result,
             }, msg));
         }
         else
         {
             return(ResponseResult.GetErrorObject());
         }
     }
     catch (Exception ex)
     {
         CustomUtility.HandleException(ex);
         return(ResponseResult.GetErrorObject());
     }
 }
예제 #8
0
        public ResponseResult EnableDisableRole(Roles pRoleObj)
        {
            String msg = " ";

            try
            {
                bool rowdeleted = DataService.EnableDisableRole(pRoleObj.Id, pRoleObj.IsActive, DateTime.UtcNow, SessionManager.CurrentUser.UserId);

                if (rowdeleted == true)
                {
                    var param = (pRoleObj.IsActive == false ? "disabled" : "enabled");
                    msg = String.Format("Role is {0} successfully", param);
                }
                else
                {
                    msg = " ";
                }
                return(ResponseResult.GetSuccessObject(new
                {
                    RoleId = pRoleObj.Id
                }, msg));

                //return (new
                //{

                //    success = true,
                //    error = msg
                //});
            }
            catch (Exception ex)
            {
                CustomUtility.HandleException(ex);
                return(ResponseResult.GetErrorObject());
            }
        }
예제 #9
0
 public ResponseResult GetRolesByUserID(int pUserID)
 {
     try
     {
         var List = DataService.GetRolesByUserID(pUserID);
         return(ResponseResult.GetSuccessObject(new
         {
             Roles = List
         }));
         //return (new
         //{
         //    data = new
         //    {
         //        Roles = List
         //    },
         //    success = true,
         //    error = ""
         //});
     }
     catch (Exception ex)
     {
         CustomUtility.HandleException(ex);
         return(ResponseResult.GetErrorObject());
     }
 }
예제 #10
0
        public ResponseResult IdeaExist(Project proj)
        {

            String msg;
            try
            {
                var result = DataService.CheckIdeaExist(proj.UserId);
                if (result > 0)
                {
                    msg = "you have already initiated a idea!";

                    return ResponseResult.GetSuccessObject(new
                       {
                           ProjectId = result,
                       },
                       msg);
                }
                else
                {
                    return ResponseResult.GetErrorObject();
                }

            }
            catch (Exception ex)
            {
                CustomUtility.HandleException(ex);
                return ResponseResult.GetErrorObject();
            } 
        }
        public ResponseResult SearchLoginHistory(LoginHistorySearchParam pSearchParam)
        {
            try
            {
                if (pSearchParam.SDate <= DateTime.MinValue)
                {
                    pSearchParam.SDate = new DateTime(1900, 1, 1);
                }

                if (pSearchParam.EDate <= DateTime.MinValue)
                {
                    pSearchParam.EDate = DateTime.MaxValue;
                }

                var result = DataService.SearchLoginHistory(pSearchParam);

                return(ResponseResult.GetSuccessObject(new
                {
                    Count = result.ResultCount,
                    LoginHistoryList = result.Result
                }));
            }
            catch (Exception ex)
            {
                CustomUtility.HandleException(ex);
                return(ResponseResult.GetErrorObject());
            }
        }
예제 #12
0
        //public Object SignOut(Boolean pManualEclockLogout)
        //{
        //    try
        //    {
        //        SessionManager.CurrentUser = null;
        //        SessionManager.AbandonSession();
        //        HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
        //        HttpContext.Current.Response.Cache.SetExpires(DateTime.UtcNow.AddSeconds(-1));
        //        HttpContext.Current.Response.Cache.SetNoStore();

        //        if (HttpContext.Current.Request.Cookies["breadcrumbs"] != null)
        //        {
        //            HttpCookie myCookie = new HttpCookie("breadcrumbs");
        //            myCookie.Expires = DateTime.UtcNow.AddDays(-1d);
        //            HttpContext.Current.Response.Cookies.Add(myCookie);
        //        }

        //        return ResponseResult.GetSuccessObject();

        //        //var result = new
        //        //{
        //        //    success = true,
        //        //    error = ""
        //        //};

        //        //return (result);

        //    }
        //    catch (Exception ex)
        //    {
        //        CustomUtility.HandleException(ex);
        //        return ResponseResult.GetErrorObject("Email not correct");
        //    }
        //}

        public ResponseResult ResetPassword(PasswordEntity pass)
        {
            if (PUCIT.AIMRL.SFP.UI.Common.SessionManager.LogsInAsOtherUser == true)
            {
                return(ResponseResult.GetErrorObject("You Are Not Allowed"));
            }
            try
            {
                var password = pass.NewPassword;
                if (GlobalDataManager.IgnoreHashing == false)
                {
                    password = PasswordSaltedHashingUtility.HashPassword(pass.NewPassword);
                }

                var flag = DataService.UpdatePassword(pass.Token, "", password, 0, DateTime.UtcNow, false);

                if (flag)
                {
                    return(ResponseResult.GetSuccessObject(null, "Password is reset"));
                }
                else
                {
                    return(ResponseResult.GetErrorObject("Reset is failed"));
                }
            }
            catch (Exception ex)
            {
                CustomUtility.HandleException(ex);
                return(ResponseResult.GetErrorObject());
            }
        }
예제 #13
0
        public ResponseResult updateUserProfile(EditUser u)
        {
            String msg;

            try
            {
                int isUpdated = DataService.updateUserProfile(u);
                if (isUpdated == 1)
                {
                    msg = "User Updated Successfully";
                    return(ResponseResult.GetSuccessObject(new
                    {
                        IsUpdated = isUpdated
                    }, msg));
                }
                else
                {
                    msg = "User didn't updated successfully";
                    return(ResponseResult.GetErrorObject(msg));
                }
            }
            catch (Exception ex)
            {
                CustomUtility.HandleException(ex);
                return(ResponseResult.GetErrorObject("User didn't updated successfully"));
            }
        }
    static void Init()
    {
        // Get existing open window or if none, make a new one:
        CustomUtility window = (CustomUtility)EditorWindow.GetWindow(typeof(CustomUtility));

        window.Show();
    }
예제 #15
0
        public ActionResult EditUser(int Id)
        {
            var userInfo       = string.Format("api/GetUserById?Id=" + Id);
            var userInfoResult = CustomUtility.GetSingleRecord <Users>(userInfo);
            var roleInfo       = string.Format("api/GetRoleById");
            var roleInfoResult = CustomUtility.GetSingleRecord <Roles>(roleInfo);

            ViewBag.RoleList = new SelectList(roleInfoResult, "RoleId", "RoleName").Items;
            return(PartialView("UserEdit", userInfoResult[0]));
        }
예제 #16
0
        public ActionResult Addrecord()

        {
            var roleInfo       = string.Format("api/GetRoleById");
            var roleInfoResult = CustomUtility.GetSingleRecord <Roles>(roleInfo);

            ViewBag.Message  = "Registration";
            ViewBag.RoleList = new SelectList(roleInfoResult, "RoleId", "RoleName").Items;
            return(PartialView("UserRegistration"));
        }
예제 #17
0
파일: RoleMaster.cs 프로젝트: ramrajg/NPSL
        public ActionResult EditRole(int Id)
        {
            var menuInfo = string.Format("api/GetMenuModelForRoleMaster?roleId=" + Id);
            List <MenuModelForRoleMaster> menuInforResult = CustomUtility.GetSingleRecord <MenuModelForRoleMaster>(menuInfo);

            HttpContext.Session.SetObjectAsJson("RoleMenuMaster", menuInforResult);
            var RoleResult = CustomUtility.GetSingleRecord <Roles>(string.Format("api/GetRoleById?roleId=" + Id));

            return(PartialView("RoleEdit", RoleResult[0]));
        }
예제 #18
0
        public PartialViewResult RefreshSearchResult(int groupId, int selectedTemplateId, DateTime FromDate, DateTime ToDate)
        {
            var From_Date                 = FromDate.ToString("MMM dd yyyy");
            var To_Date                   = ToDate.ToString("MMM dd yyyy");
            var ReconsileReportResult     = CustomUtility.GetSingleRecord <NonReconsileData>(string.Format("api/GetNonReconsileData?groupTemplateId=" + groupId + "&selectedTemplateId=" + selectedTemplateId + "&fromDate=" + From_Date + "&toDate=" + To_Date + ""));
            ViewModelNonReconsile mymodel = new ViewModelNonReconsile();

            mymodel.NonReconsileData = ReconsileReportResult;
            return(PartialView("_ManualReconsile", mymodel));
        }
예제 #19
0
    void Start()
    {
        // initializing ground game object
        GameObject groundGameObject = Instantiate(GroundObjectPrefab,
                                                  new Vector3(groundObjectSize.x / 2, groundObjectHeight, groundObjectSize.z / 2),
                                                  Quaternion.identity, this.transform);

        CustomUtility.ChangeLocalScale(groundGameObject, groundObjectSize);
        groundGameObject.layer = MasterManager.Instance.GameSettings.GroundLayer;
        //
    }
예제 #20
0
        // create audio object
        private void CreateAudioObject()
        {
            var AO = CustomUtility.CreateDontDestroyObject <AudioObject>();

            AO.del_OnFinishedPlay = cbAudioFinished;
            AO.del_OnAudioPlay    = cbAudioPlay;
            AO.transform.parent   = transform;
            AO.gameObject.SetActive(false);
            cachedAuidoList.Add(AO);
            audioPool.Push(AO);
        }
예제 #21
0
파일: RoleMaster.cs 프로젝트: ramrajg/NPSL
        public JsonResult EditrecordAPICall(List <SubMenuRoleId> selectedMenuId)
        {
            bool isSuccessStatusCode = false;
            var  templateGroupResult = CustomUtility.PostDataOfType("api/UpdateRole", selectedMenuId, out isSuccessStatusCode);

            if (!isSuccessStatusCode)
            {
                //  throw new CustomException(responseString);
            }
            return(Json("Success"));
        }
예제 #22
0
        public ActionResult EditTemplateGroup(TemplateGroup templateGroupDetail)
        {
            bool isSuccessStatusCode = false;

            var templateGroupResult = CustomUtility.PostDataOfType("api/UpdateTemplateGroup", templateGroupDetail, out isSuccessStatusCode);

            if (!isSuccessStatusCode)
            {
                //  throw new CustomException(responseString);
            }
            return(RedirectToAction("Index", "TemplateGroup"));
        }
예제 #23
0
        public JsonResult EditTemplateApiCall(ReconsileTemplate templateDetail)
        {
            bool isSuccessStatusCode = false;
            var  templateInfoResult  = CustomUtility.PostDataOfType("api/UpdateTemplate", templateDetail, out isSuccessStatusCode);

            if (!isSuccessStatusCode)
            {
                Response.StatusCode = (int)HttpStatusCode.InternalServerError;
                return(Json(templateInfoResult.ToString()));
            }
            return(Json("Success"));
        }
예제 #24
0
        public IActionResult Index()
        {
            var formattedDate         = DateTime.Today.ToString("dd MMM yyyy");
            var ReconsileReportResult = CustomUtility.GetSingleRecord <NonReconsileData>(string.Format("api/GetNonReconsileData?groupTemplateId=0&fromDate=" + formattedDate + "&toDate=" + formattedDate + ""));
            var TemplateGroupResult   = CustomUtility.GetSingleRecord <TemplateGroup>(string.Format("api/GetTemplateGroupValue?OnlyActive=1"));
            // ViewBag.TemplateGroupList = new SelectList(TemplateGroupResult, "templateGroupId", "templateGroupName").Items;
            ViewModelNonReconsile mymodel = new ViewModelNonReconsile();

            mymodel.NonReconsileData = ReconsileReportResult;
            mymodel.TemplateGroup    = TemplateGroupResult;
            return(View(mymodel));
        }
예제 #25
0
        public ActionResult EditUser(Users userDetail)
        {
            bool isSuccessStatusCode = false;

            var roleInfoResult = CustomUtility.PostDataOfType("api/UpdateUser", userDetail, out isSuccessStatusCode);

            if (!isSuccessStatusCode)
            {
                //  throw new CustomException(responseString);
            }
            return(RedirectToAction("Index", "Users"));
        }
예제 #26
0
        public ActionResult EditFileExtension(FileExtension fileExtensionDetail)
        {
            bool isSuccessStatusCode = false;

            var fileExtensionResult = CustomUtility.PostDataOfType("api/UpdateFileExtension", fileExtensionDetail, out isSuccessStatusCode);

            if (!isSuccessStatusCode)
            {
                //  throw new CustomException(responseString);
            }
            return(RedirectToAction("Index", "FileExtension"));
        }
예제 #27
0
        public ActionResult EditTemplate(int Id)
        {
            var TemplateResult      = CustomUtility.GetSingleRecord <ReconsileTemplate>(string.Format("api/GetTemplateById?Id=" + Id));
            var ExtensionInfoResult = CustomUtility.GetSingleRecord <FileExtension>(string.Format("api/GetFileExtension"));
            var DelimeterValue      = CustomUtility.GetSingleRecord <Delimiter>(string.Format("api/GetDelimeterValue"));
            var TemplateGroupValue  = CustomUtility.GetSingleRecord <TemplateGroup>(string.Format("api/GetTemplateGroupValue"));

            ViewBag.ExtensionList      = new SelectList(ExtensionInfoResult, "FileExtensionId", "FileextensionName").Items;
            ViewBag.DelimeterValueList = new SelectList(DelimeterValue, "DelimiterId", "DelimiterValue").Items;
            ViewBag.TemplateGroupValue = new SelectList(TemplateGroupValue, "TemplateGroupId", "TemplateGroupName").Items;
            return(PartialView("TemplateEdit", TemplateResult[0]));
        }
예제 #28
0
파일: RoleMaster.cs 프로젝트: ramrajg/NPSL
        public IActionResult Index()
        {
            var menuInfo = string.Format("api/GetMenuModelForRoleMaster?roleId=0");
            List <MenuModelForRoleMaster> menuInforResult = CustomUtility.GetSingleRecord <MenuModelForRoleMaster>(menuInfo);

            HttpContext.Session.SetObjectAsJson("RoleMenuMaster", menuInforResult);
            var RolesResult             = CustomUtility.GetSingleRecord <Roles>(string.Format("api/GetRoleById"));
            ViewModelRoleMaster mymodel = new ViewModelRoleMaster();

            mymodel.Roles = RolesResult;
            //mymodel.MenuModel = TemplateGroupResult;
            return(View(mymodel));
        }
예제 #29
0
 public ResponseResult IdeaExist(Project proj)
 {
     try
     {
         Util.CustomUtility.LogData("Going to check weather user have already added project idea or not" + proj.UserId);
         return(Repository.IdeaExist(proj));
     }
     catch (Exception ex)
     {
         CustomUtility.HandleException(ex);
         return(ResponseResult.GetErrorObject());
     }
 }
예제 #30
0
 public ResponseResult updateUserProfilePic(string fileName)
 {
     try
     {
         return(DataService.updateUserProfilePic(fileName));
     }
     catch (Exception ex)
     {
         CustomUtility.HandleException(ex);
         return(ResponseResult.GetErrorObject());
         //return ResponseResult.GetErrorObject("Some error has occured in While showing User Projects Wall.");
     }
 }