示例#1
0
        public HttpResponseMessage PostUserProfileSelection(ProfileSelection _objProfileSelection)
        {
            LoginDAL _objLoginDAL = new LoginDAL();
            Response objResponse  = new Response();

            try
            {
                var jsonResult = new StringBuilder();
                jsonResult       = _objLoginDAL.ProfileSelection(_objProfileSelection);
                objResponse.Data = jsonResult.ToString();
                if (!string.IsNullOrEmpty(jsonResult.ToString()) && jsonResult.ToString() != "-1")
                {
                    objResponse.Success = true;
                }
                else
                {
                    objResponse.Success = false;
                }
                return(Request.CreateResponse(HttpStatusCode.OK, objResponse));
            }
            catch (Exception ex)
            {
                #region set exception response
                string logMsg = Environment.NewLine + DateTime.Now + Environment.NewLine + "Method Name: UserProfileSelection | Contoller Name: Login Controller" + Environment.NewLine;
                logMsg += ":" + DateTime.Now + "|" + ex.ToString() + "-" + Environment.NewLine;
                ErrorHandler.ErrorLog(logMsg);
                #endregion
                objResponse.ErrorList.Add(new Error {
                    errorCode = "EX", errorMsg = ex.Message
                });
                objResponse.Success = false;
                return(Request.CreateResponse(HttpStatusCode.BadRequest, objResponse));
            }
        }
示例#2
0
 public StringBuilder ProfileSelection(ProfileSelection _objProfileSelection)
 {
     try
     {
         SqlParameter[] P          = new SqlParameter[] { new SqlParameter("@UserInfoID", _objProfileSelection.UserInfoID), };
         var            jsonResult = new StringBuilder();
         jsonResult = DataLib.JsonStringExecuteReader(DataLib.Connection.GetConnectionString, SPKeys.SetLoginSuccessLog, P);
         return(jsonResult);
     }
     catch { throw; }
 }
        void LoadProfileAndMerge(ProfileSelection profileSelection)
        {
            if (!Repository.Instance.TfsBridgeProvider.IsCompleteBranchListLoaded())
                return;

            Repository.Instance.TfsBridgeProvider.ActiveTeamProject =
                Repository.Instance.TfsBridgeProvider.VersionControlServer.GetAllTeamProjects(false)
            .Where(project => project.ArtifactUri.ToString() == profileSelection.ProfileSettings.TeamProject).FirstOrDefault();

            Repository.Instance.ProfileProvider.LoadProfile(Repository.Instance.TfsBridgeProvider.ActiveTeamProject.ArtifactUri, profileSelection.ProfileSettings.Name);
            ShowChangesetView();
        }
 private void SwitchToSettings(ProfileSelection profileSelection)
 {
     Repository.Instance.ProfileProvider.LoadProfile(new Uri(profileSelection.ProfileSettings.TeamProject), profileSelection.ProfileSettings.Name);
 }