示例#1
0
        /// <summary>
        /// Führt eine weiterleitung zur Seite mit den entsprechenden Argumenten aus. Die Weiterleitung wird benötigt, damit
        /// die Daten nicht ein zweites mal übermittelt werden können.
        /// </summary>
        /// <param name="newState"></param>
        private void NavigateTo(FormState newState)
        {
            // Ziel Url zusammenstellen.
            string stateKey = UniqueID + "State";

            UrlBuilder urlBuilder = new UrlBuilder(Request);

            if (newState != FormState.Form)
            {
                urlBuilder.QueryString[stateKey] = newState.ToString();
            }
            else
            {
                urlBuilder.QueryString.Remove(stateKey); // Beim Formular wird keine Argument angegeben.
            }
            urlBuilder.RedirectTo();
        }
示例#2
0
        private void SetFormFooter()
        {
            lblMode.Text = "Mode: " + FormState.ToString().Substring(2);

            if (FormState == FormStates.fsNew)
            {
                return;
            }

            if (MasterColumns.Find(col => col.Name == "DateCreated") != null)
            {
                lblCreatedBy.Text =
                    String.Format("Created By:     {0} on {1}",
                                  VLookupProvider.DataSetLookup(VLookupProvider.dstSystemUsers, "Id", MasterColumns.Find(col => col.Name == "CreatedById").Value, "FormalName"),
                                  Convert.ToDateTime(MasterColumns.Find(col => col.Name == "DateCreated").Value).ToString("MM'/'dd'/'yyyy 'at' hh:mm:ss tt")
                                  );
            }

            if (MasterColumns.Find(col => col.Name == "DateModified") != null)
            {
                lblModifiedBy.Text =
                    String.Format("Modified By:   {0} on {1}",
                                  VLookupProvider.DataSetLookup(VLookupProvider.dstSystemUsers, "Id", MasterColumns.Find(col => col.Name == "ModifiedById").Value, "FormalName"),
                                  Convert.ToDateTime(MasterColumns.Find(col => col.Name == "DateModified").Value).ToString("MM'/'dd'/'yyyy 'at' hh:mm:ss tt")
                                  );

                if (MasterColumns.Find(col => col.Name == "DateCreated").Value.ToString() == MasterColumns.Find(col => col.Name == "DateModified").Value.ToString())
                {
                    lblCreatedBy.Visible  = true;
                    lblModifiedBy.Visible = false;
                    lblCreatedBy.Padding  = new Padding(5, 5, 5, 5);
                }
                else
                {
                    lblCreatedBy.Visible  = true;
                    lblModifiedBy.Visible = true;
                    lblCreatedBy.Padding  = new Padding(5, 0, 0, 0);
                    lblModifiedBy.Padding = new Padding(5, 0, 0, 0);
                }
            }
        }
    /// <summary>
    /// Führt eine weiterleitung zur Seite mit den entsprechenden Argumenten aus. Die Weiterleitung wird benötigt, damit
    /// die Daten nicht ein zweites mal übermittelt werden können.
    /// </summary>
    /// <param name="newState"></param>
    private void NavigateTo(FormState newState, Guid Id)
    {
      // Ziel Url zusammenstellen.
      string stateKey = UniqueID + "State";

      UrlBuilder urlBuilder = new UrlBuilder(Request);
      if (newState != FormState.Form)
        urlBuilder.QueryString[stateKey] = newState.ToString();
      else
        urlBuilder.QueryString.Remove(stateKey);  // Beim Formular wird keine Argument angegeben.
      urlBuilder.QueryString["Id"] = Id.ToString();
      urlBuilder.RedirectTo();
    }