示例#1
0
		protected void cbValidateNewUserName_Callback(object sender, ComponentArt.Web.UI.CallBackEventArgs e)
		{
			// The user just typed in a user name in the Add New User wizard. Let's check to see if it already
			// exists and let the user know the result.
			string requestedUsername = e.Parameter;

			if (String.IsNullOrEmpty(requestedUsername))
			{
				lblUserNameValidationResult.Text = String.Empty;
			}
			else
			{
				UserEntity user = UserController.GetUser(requestedUsername, false);

				bool userNameIsInUse = (user != null);

				if (userNameIsInUse)
				{
					lblUserNameValidationResult.Text = Resources.GalleryServerPro.Admin_Manage_Users_Username_Already_In_Use_Msg;
					lblUserNameValidationResult.CssClass = "gsp_msgwarning";
				}
				else
				{
					lblUserNameValidationResult.Text = Resources.GalleryServerPro.Admin_Manage_Users_Username_Already_Is_Valid_Msg;
					lblUserNameValidationResult.CssClass = "gsp_msgfriendly";
				}
			}

			lblUserNameValidationResult.RenderControl(e.Output);
		}
示例#2
0
		protected void gdUsers_DeleteCommand(object sender, ComponentArt.Web.UI.GridItemEventArgs e)
		{
			this.CheckUserSecurity(SecurityActions.AdministerSite);

			// Remove the user from all roles, and then delete the user. If an exception is thrown, such as during
			// ValidateDeleteUser(), the client side function gdUsers_CallbackError will catch it and display
			// the message to the user.
			UserController.DeleteGalleryServerProUser(e.Item["UserName"].ToString(), true);
		}
 protected void SearchResultsGrid_RowLoaded(object sender, ComponentArt.Silverlight.UI.Data.DataGridRowEventArgs e)
 {
     if (this.ClaimSearchResultGrid.SelectedRow == null || (this.ClaimSearchResultGrid.LoadedRows != null && this.ClaimSearchResultGrid.LoadedRows.Count == 1))
     {
         this.ClaimSearchResultGrid.ScrollTo(0);
         this.ClaimSearchResultGrid.SelectRow(0);
         this.ClaimSearchResultGrid.Focus();
     }
 }
示例#4
0
		private void Menu1_ItemSelected(object sender, ComponentArt.Web.UI.MenuItemEventArgs e)
		{
			if (e.Item.ID == "mnuLogout")
			{
				LogOffUser();

				ReloadPage();
			}
		}
示例#5
0
        /// <summary>
        /// ��Ű���� Snap ������ �����´�.
        /// </summary>
        /// <param name="snap"></param>
        /// <param name="context"></param>
        public void LoadSnap(ComponentArt.Web.UI.Snap snap, HttpContext context)
        {
            string controlName = snap.ID;

            HttpCookie cookie = context.Request.Cookies[controlName + "_option"];
            if (cookie == null) return;

            snap.IsCollapsed = bool.Parse(cookie.Values[controlName + "_coolapsed"]);
            snap.CurrentDockingContainer = cookie.Values[controlName + "_dockingContainer"].ToString();
            snap.CurrentDockingIndex = int.Parse(cookie.Values[controlName + "_dockingIndex"]);
        }
        private void ClaimAmountHistoryXIAPGrid_RowLoaded(object sender, ComponentArt.Silverlight.UI.Data.DataGridRowEventArgs e)
        {
            string currencyCode = null;
            XIAPSearchResultGrid claimAmountHistoryXIAPGrid = this.LayoutRoot.Content as XIAPSearchResultGrid;
            claimAmountHistoryXIAPGrid.CurrentPageIndex = 0;
            ClaimAmountHistoryModel model = this.DataContext as ClaimAmountHistoryModel;
            if (model != null)
            {
                if (model.ClaimAmountSearchRows != null && model.ClaimAmountSearchRows.Count() > 0)
                {
                    currencyCode = model.ClaimAmountSearchRows.FirstOrDefault().CurrencyCode;
                }

                if (model.SelectedDisplayLevel == StaticValues.ClaimAmountHistoryDisplayLevel.Transactions.ToString())
                {
                    this.SetColumnsVisibility(model, claimAmountHistoryXIAPGrid);
                    (claimAmountHistoryXIAPGrid.Columns["PaymentReceiptAmount"].Header as TextBlock).Text = String.IsNullOrEmpty(currencyCode) == true ? StringResources.AmountHistory_PaymentReceiptAmount :
                    string.Format("{0} ({1})", StringResources.AmountHistory_PaymentReceiptAmount, currencyCode);
                    (claimAmountHistoryXIAPGrid.Columns["ReserveAmount"].Header as TextBlock).Text = String.IsNullOrEmpty(currencyCode) == true ? StringResources.AmountHistory_ReserveMovement :
                    string.Format("{0} ({1})", StringResources.AmountHistory_ReserveMovement, currencyCode);
                }

                if (model.SelectedDisplayLevel == StaticValues.ClaimAmountHistoryDisplayLevel.ClaimDetails.ToString())
                {
                    this.SetColumnsVisibility(model, claimAmountHistoryXIAPGrid);
                    if ((model.ClaimAmountSearchData.CurrencyType == (int)StaticValues.ClaimCurrencyType.ClmCcy || model.ClaimAmountSearchData.CurrencyType == (int)StaticValues.ClaimCurrencyType.BaseCcy) && model.ProductClaimDefinitionItem.IncurredAmountDerivationMethod != (short)StaticValues.IncurredAmountDerivationMethod.PaymentsReservesincludingEstimated)
                    {
                        claimAmountHistoryXIAPGrid.Columns["IncurredAmount"].Visibility = Visibility.Visible;
                    }
                    else
                    {
                        claimAmountHistoryXIAPGrid.Columns["IncurredAmount"].Visibility = Visibility.Collapsed;
                    }

                    (claimAmountHistoryXIAPGrid.Columns["PaymentReceiptAmount"].Header as TextBlock).Text = String.IsNullOrEmpty(currencyCode) == true ? StringResources.AmountHistory_PaymentReceiptAmount :
                    string.Format("{0} ({1})", StringResources.AmountHistory_PaymentReceiptAmount, currencyCode);
                    (claimAmountHistoryXIAPGrid.Columns["ReserveAmount"].Header as TextBlock).Text = String.IsNullOrEmpty(currencyCode) == true ? StringResources.AmountHistory_ReserveMovement :
                    string.Format("{0} ({1})", StringResources.AmountHistory_ReserveMovement, currencyCode);
                    (claimAmountHistoryXIAPGrid.Columns["IncurredAmount"].Header as TextBlock).Text = String.IsNullOrEmpty(currencyCode) == true ? StringResources.AmountHistory_ClaimDetailIncurredPosition :
                    string.Format("{0} ({1})", StringResources.AmountHistory_ClaimDetailIncurredPosition, currencyCode);
                }

                if (model.SelectedDisplayLevel == StaticValues.ClaimAmountHistoryDisplayLevel.Amounts.ToString())
                {
                    (claimAmountHistoryXIAPGrid.Columns["TransactionAmount"].Header as TextBlock).Text = String.IsNullOrEmpty(currencyCode) == true ? StringResources.AmountHistory_Amount :
                    string.Format("{0} ({1})", StringResources.AmountHistory_Amount, currencyCode);
                    (claimAmountHistoryXIAPGrid.Columns["MovementAmount"].Header as TextBlock).Text = String.IsNullOrEmpty(currencyCode) == true ? StringResources.AmountHistory_Movement :
                    string.Format("{0} ({1})", StringResources.AmountHistory_Movement, currencyCode);
                }
            }

            this.LayoutRoot.UpdateLayout();
        }
示例#7
0
		protected void cbAddUser_Callback(object sender, ComponentArt.Web.UI.CallBackEventArgs e)
		{
			try
			{
				switch (e.Parameter)
				{
					case "createUser":
						{
							AddUser();
							e.Output.Write("<script type=\"text/javascript\">callbackStatus = 'success';</script>");
							break;
						}
				}
			}
			catch (MembershipCreateUserException ex)
			{
				// Just in case we created the user and the exception occured at a later step, like adding the roles, delete the user,
				// but only if the user exists AND the error wasn't 'DuplicateUserName'.
				if ((ex.StatusCode != MembershipCreateStatus.DuplicateUserName) && (UserController.GetUser(txtNewUserUserName.Text, false) != null))
				{
					UserController.DeleteUser(txtNewUserEmail.Text);
				}

				GalleryServerPro.Web.Controls.usermessage msgBox = (GalleryServerPro.Web.Controls.usermessage)LoadControl(Util.GetUrl("/controls/usermessage.ascx"));
				msgBox.IconStyle = GalleryServerPro.Web.MessageStyle.Error;
				msgBox.MessageTitle = Resources.GalleryServerPro.Admin_Manage_Users_Cannot_Create_User_Msg;
				msgBox.MessageDetail = UserController.GetAddUserErrorMessage(ex.StatusCode);
				pnlAddUserMessage.Controls.Add(msgBox);

				FindControlRecursive(dgAddUser, "pnlAddUserMessage").RenderControl(e.Output);
			}
			catch (Exception ex)
			{
				// Just in case we created the user and the exception occured at a later step, like ading the roles, delete the user.
				if (UserController.GetUser(txtNewUserUserName.Text, false) != null)
				{
					UserController.DeleteUser(txtNewUserUserName.Text);
				}

				GalleryServerPro.Web.Controls.usermessage msgBox = (GalleryServerPro.Web.Controls.usermessage)LoadControl(Util.GetUrl("/controls/usermessage.ascx"));
				msgBox.IconStyle = GalleryServerPro.Web.MessageStyle.Error;
				msgBox.MessageTitle = Resources.GalleryServerPro.Admin_Manage_Users_Cannot_Create_User_Msg;
				msgBox.MessageDetail = ex.Message;
				pnlAddUserMessage.Controls.Add(msgBox);

				FindControlRecursive(dgAddUser, "pnlAddUserMessage").RenderControl(e.Output);
			}

		}
示例#8
0
		protected void gdUsers_DeleteCommand(object sender, ComponentArt.Web.UI.GridItemEventArgs e)
		{
			// Remove the user from all roles, and then delete the user. If an exception is thrown, such as during
			// ValidateDeleteUser(), the client side function gdUsers_CallbackError will catch it and display
			// the message to the user.
			string userName = e.Item["UserName"].ToString();
			ValidateDeleteUser(userName);

			string[] userRoles = Roles.GetRolesForUser(userName);
			if (userRoles.Length > 0)
			{
				Roles.RemoveUserFromRoles(userName, userRoles);
			}

			Membership.DeleteUser(userName, true);

			HelperFunctions.PurgeCache();
		}
    //===============================================================
    // Function: OnGoalsListItemContentCreated
    //===============================================================
    public void OnGoalsListItemContentCreated(object sender, ComponentArt.Web.UI.GridItemContentCreatedEventArgs oArgs)
    {
        if (oArgs.Column.DataCellServerTemplateId == "PrivateTemplate")
        {
            string privateEvent = oArgs.Item["PrivateEvent"].ToString();

            if (privateEvent.ToLower() == "true")
            {
                oArgs.Content.Controls.Add(new LiteralControl("Private"));
            }
            else
            {
                oArgs.Content.Controls.Add(new LiteralControl(""));
            }
        }
        if (oArgs.Column.DataCellServerTemplateId == "ShowOnDefaultPageTemplate")
        {
            string showOnDefaultPage = oArgs.Item["ShowOnDefaultPage"].ToString();

            if (showOnDefaultPage.ToLower() == "true")
            {
                oArgs.Content.Controls.Add(new LiteralControl("Yes"));
            }
            else
            {
                oArgs.Content.Controls.Add(new LiteralControl(""));
            }
        }
        if (oArgs.Column.DataCellServerTemplateId == "EventPicThumbnailTemplate")
        {
            string eventPicThumbnail = oArgs.Item["EventPicThumbnail"].ToString();

            if (eventPicThumbnail == "")
            {
                oArgs.Content.Controls.Add(new LiteralControl(""));
            }
            else
            {
                oArgs.Content.Controls.Add(new LiteralControl("Yes"));
            }
        }
    }
示例#10
0
 private void PopulateSubTree( string ParentPath, ComponentArt.Web.UI.TreeViewNode node )
 {
     Database database = DatabaseFactory.CreateDatabase( /* Database Connection String */ );
     DataSet ds = new DataSet();
     bool directory = false;
     using( DbCommand command = database.GetStoredProcCommand( "AvGetFilesByParentPath" ) ) {
         database.AddInParameter( command, "@ParentPath", DbType.String, ParentPath );
         ds = database.ExecuteDataSet( command );
     }
     foreach( DataRow childRow in ds.Tables[0].Rows ) {
         directory = childRow["FileType"].Equals("Directory");
         ComponentArt.Web.UI.TreeViewNode childNode = CreateNode( childRow["Entry"].ToString(), childRow["FileType"].Equals( "Directory" ) ? "folder.gif" : "file.gif", childRow["Moved"].Equals( (bool)true ) ? "margin_x.gif" : "", false );
         childNode.DraggingEnabled = childRow["Moved"].Equals( (bool)true ) ? true : false;
         childNode.DroppingEnabled = directory;
         node.Nodes.Add( childNode );
         if (directory) {
             PopulateSubTree(Path.Combine(childRow["ParentPath"].ToString(), childRow["Entry"].ToString()), childNode);
         }
     }
 }
示例#11
0
 protected void TreeView1_NodeSelected( object sender, ComponentArt.Web.UI.TreeViewNodeEventArgs e )
 {
     Success.Visible = false;
     EditMenu.Visible = true;
     TreeID.Text = e.Node.Text;
     TreeID.ToolTip = BuildTreePath();
     string endPath = TreeID.ToolTip;
     string FullPath = GetRootPath() + endPath;
     DataSet ds = new DataSet();
     Database database = DatabaseFactory.CreateDatabase(/* Database Connection String */ );
     using( DbCommand command = database.GetStoredProcCommand("AvUpdateMetaData") ) {
         database.AddInParameter( command, "@FullPath", DbType.String, FullPath );
         using( XmlReader reader = ( (SqlDatabase)database ).ExecuteXmlReader( command ) ) {
             XmlDocument document = new XmlDocument();
       document.Load(reader);
         }
     }
     int temp = 0;
     if ( ds.Tables.Count != 0)
         temp = ( ds.Tables[0].Rows.Count );
     List<int> BindingList = new List<int>();
     for( int k = 0; k < temp; k++ ) {
         BindingList.Add( k );
     }
     DataRepeater.DataSource = BindingList;
     DataRepeater.DataBind();
     int i = 0;
     if( ds.Tables.Count != 0 ) {
         foreach( RepeaterItem TempItem in DataRepeater.Items ) {
             if( ds.Tables["field"].Rows[i]["type"] != null ) {
                 ( (Label)TempItem.FindControl( "DataTag" ) ).Text = ds.Tables[0].Rows[i]["type"].ToString();
             }
             if( ds.Tables["field"].Columns.Count > 1 )
                 ( (TextBox)TempItem.FindControl( "DataContent" ) ).Text = ds.Tables[0].Rows[i]["value"].ToString();
             i++;
         }
     }
 }
示例#12
0
        protected void TreeView1_NodeMoved( object sender, ComponentArt.Web.UI.TreeViewNodeEventArgs e )
        {
            ComponentArt.Web.UI.TreeViewNode targetNode = e.Node.ParentNode;
            ComponentArt.Web.UI.TreeViewNode sourceNode = e.Node;
            ComponentArt.Web.UI.TreeViewNode iterator = targetNode;
            ComponentArt.Web.UI.TreeViewNode SourcePath = TreeView1.Nodes[TreeView1.Nodes.Count - 1];
            string TargetFullPath = "";
            string SourceFullPath = SourcePath.Text;
            TreeView1.Nodes.Remove( SourcePath );
            string RootEntry = GetRootEntry();

            TargetFullPath = '\\' + iterator.Text + TargetFullPath;
            iterator = iterator.ParentNode;
            TargetFullPath = TargetFullPath + '\\' + sourceNode.Text;
            SourceFullPath = SourceFullPath + '\\' + sourceNode.Text;
            iterator = sourceNode;
            bool MoveOk = false;
            while( iterator != null ) {
                iterator = iterator.PreviousSibling;
                if( iterator == null )
                    break;
                if( sourceNode.Text == iterator.Text ) {
                    MoveOk = true;
                }
            }
            if( MoveOk == false ) {
                Response.Redirect( Request.Url.AbsolutePath );
            }
            string OldFullPath = GetRootPath() + PathWithoutRoot( SourceFullPath );
            string NewFullPath = GetRootPath() + TargetFullPath;
            try {
                Database database = DatabaseFactory.CreateDatabase(/* Database Connection String */ );
                using( DbCommand command = database.GetStoredProcCommand( "AvUpdateFileByOldFullPath" ) ) {
                    database.AddInParameter( command, "@OldFullPath", DbType.String, OldFullPath );
                    database.AddInParameter( command, "@FullPath", DbType.String, NewFullPath );
                    database.ExecuteNonQuery( command );
                }
            }
            catch {
            }
            Response.Redirect( Request.Url.AbsolutePath );
        }
示例#13
0
 //===============================================================
 // Function: onRowSelect
 //===============================================================
 protected void onRowSelect(object sender, ComponentArt.Web.UI.GridItemEventArgs e)
 {
     Response.Redirect("editAdministrator.aspx?AID=" + e.Item["AdministratorID"]);
 }
示例#14
0
 /// <summary>
 /// Handles the DeleteCommand event of the GridVoudhcerCodes control.
 /// </summary>
 /// <param name="sender">
 /// The source of the event.
 /// </param>
 /// <param name="e">
 /// The <see cref="ComponentArt.Web.UI.GridItemEventArgs"/> instance containing the event data.
 /// </param>
 private void GridVoucherCodes_DeleteCommand(object sender, ComponentArt.Web.UI.GridItemEventArgs e)
 {
     string deletedVoucherCode = e.Item["VoucherCode"].ToString();
     List<VoucherCodeCarrier> voucherCodes = (List<VoucherCodeCarrier>) ViewState[VIEW_STATE_VOUCHER_CODES];
     for(int index = 0; index < voucherCodes.Count; index++)
     {
         VoucherCodeCarrier voucherCode = voucherCodes[index];
         if(voucherCode.VoucherCode == deletedVoucherCode)
         {
             if (voucherCode.CarrierState.IsMarkedForCreating)
             {
                 voucherCodes.RemoveAt(index);
                 index--;
             }
             else
             {
                 voucherCode.CarrierState.IsMarkedForDeleting = true;
             }
         }
     }
 }
示例#15
0
		private void dgBrowseGrid_PageIndexChanged(object sender, ComponentArt.Web.UI.GridPageIndexChangedEventArgs e)
		{
			dgBrowseGrid.CurrentPageIndex = e.NewIndex;
		}
示例#16
0
		protected void gdRoles_DeleteCommand(object sender, ComponentArt.Web.UI.GridItemEventArgs e)
		{
			// Delete the gallery server role. This includes the Gallery Server role and the corresponding ASP.NET role.
			// If an exception is thrown, such as during ValidateDeleteUser(), the client side function 
			// gdUsers_CallbackError will catch it and display the message to the user.
			string roleName = e.Item["RoleName"].ToString();

			ValidateDeleteRole(roleName);

			try
			{
				DeleteGalleryServerRole(roleName);
			}
			finally
			{
				try
				{
					DeleteAspnetRole(roleName);
				}
				finally
				{
					HelperFunctions.PurgeCache();
				}
			}
		}
示例#17
0
        //private bool m_isHierarchicalEventCreated;
        //private Dictionary<int, WindowTabInfo> m_levelTabInfos = new Dictionary<int, WindowTabInfo>();
        //private MockDisplayManager m_dmMock = new MockDisplayManager();
        void Grid1_NeedChildDataSource(object sender, ComponentArt.Web.UI.GridNeedChildDataSourceEventArgs e)
        {
            //WindowTabInfo tabInfo = m_levelTabInfos[e.Item.Level];

            //ISearchManager sm = Feng.Windows.Forms.ArchiveFormFactory.GenerateSearchManager(tabInfo, m_dmMock);

            //m_dmMock.SetCurrentItem(e.Item);

            ////string exp = Helper.ReplaceParameterizedEntity(m_searchExpression, e.Item);
            ////object ret = m_innerSearchManager.FindData(new List<ISearchExpression> { SearchExpression.Parse(exp) }, null);

            //e.DataSource = ret;

            //Services.SoaDataService service = new Hd.Web.Services.SoaDataService();
            //ComponentArt.SOA.UI.SoaDataGridSelectResponse response = service.Select(new ComponentArt.SOA.UI.SoaDataGridSelectRequest());
            //e.DataSource = response.Data;

            //List<List<object>> ret = new List<List<object>>();
            //ret.Add(new List<object> { "a" });
            //ret.Add(new List<object> { "b" });
            //e.DataSource = ret;

            //if (args.Item.Level == 0)
            //{
            //    args.DataSource =
            //        (from product in db.Products
            //         where product.CategoryID == (int)args.Item["CategoryId"]
            //         select new
            //         {
            //             ProductId = product.ProductID,
            //             ProductName = product.ProductName,
            //             SupplierId = product.SupplierID,
            //             QuantityPerUnit = product.QuantityPerUnit,
            //             UnitPrice = product.UnitPrice,
            //             UnitsInStock = product.UnitsInStock
            //         }).ToList();
            //}
        }
示例#18
0
 //===============================================================
 // Function: onRowSelect
 //===============================================================
 protected void onRowSelect(object sender, ComponentArt.Web.UI.GridItemEventArgs e)
 {
     Response.Redirect("editUser.aspx?UID=" + e.Item["UserID"]);
 }
示例#19
0
		protected void cbEditUser_Callback(object sender, ComponentArt.Web.UI.CallBackEventArgs e)
		{
			// There should be two strings in the Parameters property. The first indicates the requested operation
			// (edit, save, etc). The second is the name of the role.
			string userName = String.Empty;
			try
			{
				if (e.Parameters.Length != 2)
					throw new ArgumentException(String.Format(CultureInfo.CurrentCulture, "The cbEditUser_Callback is expecting two items in the parameter list, but received {0} items. The first item should be a string equal to 'add', 'edit', or 'save', and the second item should be a string containing the user name (should be empty if the first parameter = 'add').", e.Parameters.Length));

				userName = e.Parameters[1];
				switch (e.Parameter)
				{
					case "edit":
						{
							PopulateControlsWithUserData(userName, true);

							//// Render the controls with the updated information.
							FindControlRecursive(dgEditUser, "pnlEditUserDialogContent").RenderControl(e.Output);

							break;
						}
					case "save":
						{
							SaveUser(userName);

							// Write a little javascript to set a page variable that will be used during the OnCallbackComplete
							// event to close the dialog when the call is successful.
							e.Output.Write("<script type=\"text/javascript\">callbackStatus = 'success';</script>");

							break;
						}
					case "updatePassword":
						{
							UpdatePassword(userName);

							PopulateControlsWithUserData(userName, false);

							// Render the controls with the updated information.
							FindControlRecursive(dgEditUser, "pnlEditUserDialogContent").RenderControl(e.Output);

							break;
						}
					case "unlockUser":
						{
							UnlockUser(userName);

							PopulateControlsWithUserData(userName, false);

							// Render the controls with the updated information.
							FindControlRecursive(dgEditUser, "pnlEditUserDialogContent").RenderControl(e.Output);

							break;
						}
				}
			}
			catch (Exception ex)
			{
				GalleryServerPro.Web.Controls.usermessage msgBox = (GalleryServerPro.Web.Controls.usermessage)LoadControl(Util.GetUrl("/controls/usermessage.ascx"));
				msgBox.IconStyle = GalleryServerPro.Web.MessageStyle.Error;
				msgBox.MessageTitle = Resources.GalleryServerPro.Admin_Manage_Users_Cannot_Save_User_Hdr;
				msgBox.MessageDetail = ex.Message;
				phEditUserMessage.Controls.Add(msgBox);

				lblUserName.Text = userName; // Not persisted by viewstate, so we have to set again
				FindControlRecursive(dgEditUser, "pnlEditUserDialogContent").RenderControl(e.Output);
			}
		}
示例#20
0
		protected void cbValidateNewUserName_Callback(object sender, ComponentArt.Web.UI.CallBackEventArgs e)
		{
			// The user just typed in a user name in the Add New User wizard. Let's check to see if it already
			// exists and let the user know the result.
			string requestedUsername = e.Parameter;

			if (String.IsNullOrEmpty(requestedUsername))
			{
				lblUserNameValidationResult.Text = String.Empty;
			}
			else
			{
				if (UseEmailForAccountName && (!HelperFunctions.IsValidEmail(requestedUsername)))
				{
					// App is configured to use an e-mail address as the account name, but the name is not a valid
					// e-mail.
					lblUserNameValidationResult.Text = Resources.GalleryServerPro.CreateAccount_Verification_Username_Not_Valid_Email_Text;
					lblUserNameValidationResult.CssClass = "gsp_msgwarning";
				}
				else if (Util.RemoveHtmlTags(requestedUsername).Length != requestedUsername.Length)
				{
					// The user name has HTML tags, which are not allowed.
					lblUserNameValidationResult.Text = Resources.GalleryServerPro.Site_Invalid_Text;
					lblUserNameValidationResult.CssClass = "gsp_msgwarning";
				}
				else
				{
					// We passed the first test above. Now verify that the requested user name is not already taken.
					UserEntity user = UserController.GetUser(requestedUsername, false);

					bool userNameIsInUse = (user != null);

					if (userNameIsInUse)
					{
						lblUserNameValidationResult.Text = Resources.GalleryServerPro.Admin_Manage_Users_Username_Already_In_Use_Msg;
						lblUserNameValidationResult.CssClass = "gsp_msgwarning";
					}
					else
					{
						lblUserNameValidationResult.Text = Resources.GalleryServerPro.Admin_Manage_Users_Username_Already_Is_Valid_Msg;
						lblUserNameValidationResult.CssClass = "gsp_msgfriendly";
					}
				}
			}

			lblUserNameValidationResult.RenderControl(e.Output);
		}
		/// <summary>
		/// Handles the DeleteCommand event of the gdRoles control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="ComponentArt.Web.UI.GridItemEventArgs"/> instance containing the event data.</param>
		protected void gdRoles_DeleteCommand(object sender, ComponentArt.Web.UI.GridItemEventArgs e)
		{
			// Delete the gallery server role. This includes the Gallery Server role and the corresponding ASP.NET role.
			// If an exception is thrown, such as during ValidateDeleteUser(), the client side function 
			// gdRoles_CallbackError will catch it and display the message to the user.
			try
			{
				string roleName = Utils.HtmlDecode(e.Item["RoleName"].ToString());

				RoleController.DeleteGalleryServerProRole(roleName);

				BindRolesGrid();
			}
			catch (Exception ex)
			{
				LogError(ex);
				throw;
			}
		}
示例#22
0
		protected void cbEditRole_Callback(object sender, ComponentArt.Web.UI.CallBackEventArgs e)
		{
			// There should be two strings in the Parameters property. The first indicates the requested operation
			// (edit, save, etc). The second is the name of the role.
			try
			{
				if (e.Parameters.Length != 2)
					throw new ArgumentException(String.Format(CultureInfo.CurrentCulture, "The cbEditRole_Callback is expecting two items in the parameter list, but received {0} items. The first item should be a string equal to 'add', 'edit', or 'save', and the second item should be a string containing the role name (should be empty if the first parameter = 'add').", e.Parameters.Length));

				string roleName = e.Parameters[1];
				switch (e.Parameter)
				{
					case "add":
					case "edit":
						{
							SetControlVisibility(roleName);

							PopulateControlsWithRoleData(roleName);

							// Render the controls with the updated information.
							FindControlRecursive(dgEditRole, "pnlDialogContent").RenderControl(e.Output);

							break;
						}
					case "save":
						{
							ValidateSaveRole(roleName);

							SaveRole(roleName);

							// Empty the cache so the next request will pull them from the data store.
							HelperFunctions.PurgeCache();

							// Write a little javascript to set a page variable that will be used during the OnCallbackComplete
							// event to close the dialog when the call is successful.
							e.Output.Write("<script type=\"text/javascript\">callbackStatus = 'success';</script>");

							break;
						}
					case "adminSelected":
						{
							// The user selected the Administer site permission. Since this permission applies to all albums, we need 
							// to select all the checkboxes for all albums. I couldn't get this to work on the client by calling checkAll(),
							// so I resorted to invoking this callback.
							BindAlbumTreeview(true);

							// Render the controls with the updated information.
							FindControlRecursive(dgEditRole, "pnlDialogContent").RenderControl(e.Output);

							break;
						}
				}
			}
			catch (Exception ex)
			{
				GalleryServerPro.Web.uc.usermessage msgBox = (GalleryServerPro.Web.uc.usermessage)LoadControl("~/uc/usermessage.ascx");
				msgBox.IconStyle = GalleryServerPro.Web.MessageStyle.Error;
				msgBox.MessageTitle = Resources.GalleryServerPro.Admin_Manage_Roles_Cannot_Save_Role_Msg;
				msgBox.MessageDetail = ex.Message;
				phMessage.Controls.Add(msgBox);

				FindControlRecursive(dgEditRole, "pnlDialogContent").RenderControl(e.Output);
			}
		}
示例#23
0
        /// <summary>
        /// Snap�� ��Ű�� �����Ѵ�.
        /// </summary>
        /// <param name="snap"></param>
        /// <param name="context"></param>
        public void SaveSnap(ComponentArt.Web.UI.Snap snap, HttpContext context)
        {
            string controlName = snap.ID;
            HttpCookie cookie = new HttpCookie(controlName + "_option");

            cookie.Values.Add(controlName + "_coolapsed", snap.IsCollapsed.ToString());
            cookie.Values.Add(controlName + "_dockingContainer", snap.CurrentDockingContainer.ToString());
            cookie.Values.Add(controlName + "_dockingIndex", snap.CurrentDockingIndex.ToString());

            DateTime nowDateTime = DateTime.Now;
            cookie.Expires = nowDateTime.AddDays(30);

            context.Response.AppendCookie(cookie);
        }
示例#24
0
		public void dgBrowseGrid_SortCommand(object sender, ComponentArt.Web.UI.GridSortCommandEventArgs args)
		{
			dgBrowseGrid.Sort = args.SortExpression;
		}
示例#25
0
        private void GenerateMenu(ComponentArt.Web.UI.Menu menu)
        {
            ComponentArt.Web.UI.MenuItem subItem;

            subItem = new ComponentArt.Web.UI.MenuItem();
            subItem.LookId = "TopItemLook";
            subItem.NavigateUrl = "../Documents/DocumentEdit.aspx?ProjectID=" + ProjectID;
            subItem.Text = LocRM.GetString("tDocumentAdd");
            subItem.Look.LeftIconUrl = ResolveUrl("~/Layouts/Images/icons/document_create.gif");
            subItem.Look.LeftIconHeight = Unit.Pixel(16);
            subItem.Look.LeftIconWidth = Unit.Pixel(16);
            menu.Items.Add(subItem);

            ComponentArt.Web.UI.MenuItem topMenuItem = new ComponentArt.Web.UI.MenuItem();
            topMenuItem.Text = LocRM2.GetString("Export");
            topMenuItem.Look.LeftIconUrl = ResolveUrl("~/Layouts/Images/downbtn1.gif");
            topMenuItem.Look.LeftIconHeight = Unit.Pixel(5);
            topMenuItem.Look.LeftIconWidth = Unit.Pixel(16);
            topMenuItem.LookId = "TopItemLook";

            subItem = new ComponentArt.Web.UI.MenuItem();
            subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/xlsexport.gif";
            subItem.Look.LeftIconWidth = Unit.Pixel(16);
            subItem.Look.LeftIconHeight = Unit.Pixel(16);
            subItem.NavigateUrl = "../Documents/default.aspx?Export=1&ProjectID=" + ProjectID;
            subItem.Text = LocRM.GetString("Export");
            topMenuItem.Items.Add(subItem);

            subItem = new ComponentArt.Web.UI.MenuItem();
            subItem.Look.LeftIconUrl = "~/Layouts/Images/icons/xmlexport.gif";
            subItem.Look.LeftIconWidth = Unit.Pixel(16);
            subItem.Look.LeftIconHeight = Unit.Pixel(16);
            subItem.NavigateUrl = "../Documents/default.aspx?Export=2&ProjectID=" + ProjectID;
            subItem.Text = LocRM.GetString("XMLExport");
            topMenuItem.Items.Add(subItem);

            menu.Items.Add(topMenuItem);
        }
示例#26
0
 //===============================================================
 // Function: onRowSelect
 //===============================================================
 protected void onRowSelect(object sender, ComponentArt.Web.UI.GridItemEventArgs e)
 {
     Response.Redirect("editTimezone.aspx?TID=" + e.Item["TimezoneID"]);
 }
        private void RenderMenu(ComponentArt.Web.UI.Menu actionsMenu)
        {
            ComponentArt.Web.UI.MenuItem topMenuItem;

            actionsMenu.Items.Clear();

            #region Legend Item
            topMenuItem = new ComponentArt.Web.UI.MenuItem();
            topMenuItem.Text = GetGlobalResourceObject("IbnFramework.Calendar", "tLegend").ToString();
            //			topMenuItem.Look.LeftIconUrl = ResolveClientUrl("~/Layouts/Images/downbtn1.gif");
            //			topMenuItem.Look.LeftIconHeight = Unit.Pixel(5);
            //			topMenuItem.Look.LeftIconWidth = Unit.Pixel(16);
            topMenuItem.LookId = "TopItemLook";
            topMenuItem.ClientSideCommand = "ShowLegend()";
            actionsMenu.Items.Add(topMenuItem);
            #endregion

            #region View Menu Items
            topMenuItem = new ComponentArt.Web.UI.MenuItem();
            topMenuItem.Text = LocRM.GetString("tView");
            topMenuItem.Look.LeftIconUrl = ResolveClientUrl("~/Layouts/Images/downbtn1.gif");
            topMenuItem.Look.LeftIconHeight = Unit.Pixel(5);
            topMenuItem.Look.LeftIconWidth = Unit.Pixel(16);
            topMenuItem.LookId = "TopItemLook";

            ComponentArt.Web.UI.MenuItem subItem;
            string graphPeriod = _pc["MV_Weeks"];

            subItem = new ComponentArt.Web.UI.MenuItem();
            if (graphPeriod == "1")	// 1 week
            {
                subItem.Look.LeftIconUrl = "~/Layouts/Images/accept.gif";
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
            }
            subItem.ClientSideCommand = "javascript:" + Page.ClientScript.GetPostBackEventReference(ViewButton, "1");
            subItem.Text = LocRM.GetString("Week1");
            topMenuItem.Items.Add(subItem);

            subItem = new ComponentArt.Web.UI.MenuItem();
            if (graphPeriod == "3")	// 3 week
            {
                subItem.Look.LeftIconUrl = "~/Layouts/Images/accept.gif";
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
            }
            subItem.ClientSideCommand = "javascript:" + Page.ClientScript.GetPostBackEventReference(ViewButton, "3");
            subItem.Text = LocRM.GetString("Week3");
            topMenuItem.Items.Add(subItem);

            actionsMenu.Items.Add(topMenuItem);
            #endregion
        }
示例#28
0
		/// <summary>
		/// Retrieve a list of albums that are in the heirarchical path between the specified album and a node in the treeview.
		/// The node that is discovered as the ancestor of the album is assigned to the existingParentNode parameter.
		/// </summary>
		/// <param name="treeview">The treeview with at least one node added to it. At least one node must be an ancestor of the 
		/// specified album.</param>
		/// <param name="album">An album. This method navigates the ancestors of this album until it finds a matching node in the treeview.</param>
		/// <param name="existingParentNode">The existing node in the treeview that is an ancestor of the specified album is assigned to
		/// this parameter.</param>
		/// <returns>Returns a list of albums where the first album (the one returned by calling Pop) is a child of the album 
		/// represented by the existingParentNode treeview node, and each subsequent album is a child of the previous album.
		/// The final album is the same album specified in the album parameter.</returns>
		private static Stack<IAlbum> GetAlbumsBetweenTopLevelNodeAndAlbum(ComponentArt.Web.UI.TreeView treeview, IAlbum album, out TreeViewNode existingParentNode)
		{
			if (treeview.Nodes.Count == 0)
				throw new ArgumentException("The treeview must have at least one top-level node before calling the function GetAlbumsBetweenTopLevelNodeAndAlbum().");
			
			Stack<IAlbum> albumParents = new Stack<IAlbum>();
			albumParents.Push(album);

			IAlbum parentAlbum = (IAlbum) album.Parent;

			albumParents.Push(parentAlbum);

			// Navigate up from the specified album until we find an album that exists in the treeview. Remember,
			// the treeview has been built with the root node and the first level of albums, so eventually we
			// should find an album. If not, just return without showing the current album.
			while ((existingParentNode = treeview.FindNodeById(parentAlbum.Id.ToString(CultureInfo.InvariantCulture))) == null)
			{
				parentAlbum = parentAlbum.Parent as IAlbum;

				if (parentAlbum == null)
					break;

				albumParents.Push(parentAlbum);
			}

			// Since we found a node in the treeview we don't need to add the most recent item in the stack. Pop it off.
			albumParents.Pop();

			return albumParents;
		}
示例#29
0
        private void RenderMenu(ComponentArt.Web.UI.Menu actionsMenu)
        {
            ComponentArt.Web.UI.MenuItem topMenuItem;
            actionsMenu.Items.Clear();

            #region Print
            topMenuItem = new ComponentArt.Web.UI.MenuItem();
            topMenuItem.Text = LocRM.GetString("Export");
            topMenuItem.LookId = "TopItemLook";
            topMenuItem.ClientSideCommand = "javascript:" + Page.ClientScript.GetPostBackEventReference(lbExport, "");
            actionsMenu.Items.Add(topMenuItem);
            #endregion

            #region View Menu Items
            topMenuItem = new ComponentArt.Web.UI.MenuItem();
            topMenuItem.Text = LocRM.GetString("tView");
            topMenuItem.Look.LeftIconUrl = Page.ResolveUrl("~/Layouts/Images/downbtn1.gif");
            topMenuItem.Look.LeftIconHeight = Unit.Pixel(5);
            topMenuItem.Look.LeftIconWidth = Unit.Pixel(16);
            topMenuItem.LookId = "TopItemLook";

            ComponentArt.Web.UI.MenuItem subItem;
            string sCurrentView = _pc["RV_ViewStyle"];

            subItem = new ComponentArt.Web.UI.MenuItem();
            if (sCurrentView == FieldSetName.tWorkResourcesDefault.ToString())
            {
                subItem.Look.LeftIconUrl = "~/Layouts/Images/accept.gif";
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
            }
            subItem.ClientSideCommand = "javascript:" + Page.ClientScript.GetPostBackEventReference(lbChangeViewDef, "");
            subItem.Text = LocRM.GetString(FieldSetName.tWorkResourcesDefault.ToString());
            topMenuItem.Items.Add(subItem);

            subItem = new ComponentArt.Web.UI.MenuItem();
            if (sCurrentView == FieldSetName.tWorkResourcesDates.ToString())
            {
                subItem.Look.LeftIconUrl = "~/Layouts/Images/accept.gif";
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
            }
            subItem.ClientSideCommand = "javascript:" + Page.ClientScript.GetPostBackEventReference(lbChangeViewDates, "");
            subItem.Text = LocRM.GetString(FieldSetName.tWorkResourcesDates.ToString());
            topMenuItem.Items.Add(subItem);

            subItem = new ComponentArt.Web.UI.MenuItem();
            if (sCurrentView == FieldSetName.tWorkResourcesWorkTime.ToString())
            {
                subItem.Look.LeftIconUrl = "~/Layouts/Images/accept.gif";
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
            }
            subItem.ClientSideCommand = "javascript:" + Page.ClientScript.GetPostBackEventReference(lbChangeViewTimes, "");
            subItem.Text = LocRM.GetString(FieldSetName.tWorkResourcesWorkTime.ToString());
            topMenuItem.Items.Add(subItem);
            #endregion

            actionsMenu.Items.Add(topMenuItem);

            if (_projectId > 0)
                return;

            #region Grouping Menu Items
            topMenuItem = new ComponentArt.Web.UI.MenuItem();
            topMenuItem.Text = LocRM.GetString("tGroupBy");
            topMenuItem.Look.LeftIconUrl = Page.ResolveUrl("~/Layouts/Images/downbtn1.gif");
            topMenuItem.Look.LeftIconHeight = Unit.Pixel(5);
            topMenuItem.Look.LeftIconWidth = Unit.Pixel(16);
            topMenuItem.LookId = "TopItemLook";

            sCurrentView = _pc["RV_Grouping"];

            subItem = new ComponentArt.Web.UI.MenuItem();
            if (sCurrentView == "0")
            {
                subItem.Look.LeftIconUrl = "~/Layouts/Images/accept.gif";
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
            }
            subItem.ClientSideCommand = "javascript:" + Page.ClientScript.GetPostBackEventReference(btnApplyG, "0");
            subItem.Text = LocRM.GetString("tNoGrouping");
            topMenuItem.Items.Add(subItem);

            subItem = new ComponentArt.Web.UI.MenuItem();
            if (sCurrentView == "2")
            {
                subItem.Look.LeftIconUrl = "~/Layouts/Images/accept.gif";
                subItem.Look.LeftIconWidth = Unit.Pixel(16);
                subItem.Look.LeftIconHeight = Unit.Pixel(16);
            }
            subItem.ClientSideCommand = "javascript:" + Page.ClientScript.GetPostBackEventReference(btnApplyG, "2");
            subItem.Text = LocRM.GetString("tByManager");
            topMenuItem.Items.Add(subItem);

            if (Configuration.ProjectManagementEnabled)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                if (sCurrentView == "3")
                {
                    subItem.Look.LeftIconUrl = "~/Layouts/Images/accept.gif";
                    subItem.Look.LeftIconWidth = Unit.Pixel(16);
                    subItem.Look.LeftIconHeight = Unit.Pixel(16);
                }
                subItem.ClientSideCommand = "javascript:" + Page.ClientScript.GetPostBackEventReference(btnApplyG, "3");
                subItem.Text = LocRM.GetString("tByProject");
                topMenuItem.Items.Add(subItem);
            }

            // Clients
            if (PortalConfig.GeneralAllowClientField)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                if (sCurrentView == "4")
                {
                    subItem.Look.LeftIconUrl = "~/Layouts/Images/accept.gif";
                    subItem.Look.LeftIconWidth = Unit.Pixel(16);
                    subItem.Look.LeftIconHeight = Unit.Pixel(16);
                }
                subItem.ClientSideCommand = "javascript:" + Page.ClientScript.GetPostBackEventReference(btnApplyG, "4");
                subItem.Text = LocRM.GetString("tByClient");
                topMenuItem.Items.Add(subItem);
            }

            // Categories
            if (PortalConfig.GeneralAllowGeneralCategoriesField)
            {
                subItem = new ComponentArt.Web.UI.MenuItem();
                if (sCurrentView == "5")
                {
                    subItem.Look.LeftIconUrl = "~/Layouts/Images/accept.gif";
                    subItem.Look.LeftIconWidth = Unit.Pixel(16);
                    subItem.Look.LeftIconHeight = Unit.Pixel(16);
                }
                subItem.ClientSideCommand = "javascript:" + Page.ClientScript.GetPostBackEventReference(btnApplyG, "5");
                subItem.Text = LocRM.GetString("tByCategory");
                topMenuItem.Items.Add(subItem);
            }
            #endregion

            actionsMenu.Items.Add(topMenuItem);
        }