コード例 #1
0
            private static PXGraph CreateGraph(string screenID)
            {
                PXSiteMapNode node = PXSiteMap.Provider.FindSiteMapNodeByScreenID(screenID);

                if (node == null)
                {
                    return(null);
                }
                string graphName = node.GraphType;
                Type   gt        = System.Web.Compilation.PXBuildManager.GetType(graphName, false) ?? Type.GetType(graphName);

                if (gt == null)
                {
                    return(null);
                }

                gt = System.Web.Compilation.PXBuildManager.GetType(PX.Api.CustomizedTypeManager.GetCustomizedTypeFullName(gt), false) ?? gt;
                using (new PXPreserveScope())
                {
                    try
                    {
                        return((PXGraph)PXGraph.CreateInstance(gt));
                    }
                    catch (System.Reflection.TargetInvocationException ex)
                    {
                        throw PXException.ExtractInner(ex);
                    }
                }
            }
コード例 #2
0
        protected virtual PXGraph CreateGraph(string graphName, string screenID)
        {
            Type gt = System.Web.Compilation.PXBuildManager.GetType(graphName, false);

            if (gt == null)
            {
                gt = Type.GetType(graphName);
            }
            if (gt != null)
            {
                gt = System.Web.Compilation.PXBuildManager.GetType(PX.Api.CustomizedTypeManager.GetCustomizedTypeFullName(gt), false) ?? gt;
                using (new PXPreserveScope())
                {
                    try
                    {
                        return(gt == typeof(PXGenericInqGrph) ? PXGenericInqGrph.CreateInstance(screenID) : (PXGraph)PXGraph.CreateInstance(gt));
                    }
                    catch (System.Reflection.TargetInvocationException ex)
                    {
                        throw PXException.ExtractInner(ex);
                    }
                }
            }
            return(null);
        }
コード例 #3
0
	protected void btnLogin_Click(object sender, EventArgs e)
	{
		try
		{
			string loginText = txtUser.Text;
			if (loginText != null && loginText.Contains(":"))
			{
				this.Master.Message = PXMessages.LocalizeNoPrefix(PX.AscxControlsMessages.LoginScreen.IncorrectLoginSymbols);
				return;
			}
			if (String.IsNullOrEmpty(loginText))
			{
				this.Master.Message = PXMessages.LocalizeNoPrefix(PX.AscxControlsMessages.LoginScreen.InvalidLogin);
				return;
			}

			if (String.IsNullOrEmpty(txtNewPassword.Text) && String.IsNullOrEmpty(txtConfirmPassword.Text))
			{
				string[] companies = null;
				if (PXDatabase.SecureCompanyID && (Membership.Provider is PXBaseMembershipProvider)
					&& String.IsNullOrEmpty(txtVeryDummyPass.Value)
					&& (companies = PXAccess.GetCompanies(loginText, txtPass.Text)).Length > 1)
				{
					SecureLogin(companies);
				}
				else
				{
					NormalLogin(companies);
				}
			}
			else //if user should change it password than we will login different way
			{
				ChangingPassword();
			}
		}
		catch (PXException ex)
		{
			this.Master.Message = ex.MessageNoPrefix;
		}
		catch (System.Reflection.TargetInvocationException ex)
		{
			this.Master.Message = PXException.ExtractInner(ex).Message;
		}
		catch (Exception ex)
		{
			this.Master.Message = ex.Message;
		}
	}