public RenameProjectDialog(RenameData renameData, Project project)
        {
            InitializeComponent();

            RenameData     = renameData;
            CurrentProject = project;

            ParentToProjects = new Dictionary <object, List <string> >();

            // Set the current project name within the GUI.
            ProjectName.Text = project.Name;
            ProjectName.Focus();
            ProjectName.SelectAll();
        }
Пример #2
0
        public ProjectWindow(Project projectParameter, ProjectWindowsArgs e)
        {
            projectScreen   = projectParameter.Copy();
            windowsArgs     = e;
            e.Save          = false;
            e.ProjectScreen = projectScreen;

            DataContext = projectScreen;

            InitializeComponent();

            Title.Text          += $" {DateTimeWeekNumber.WeekNoCompactToDate(projectScreen.WeekNoCompact).Value.ToString("yyyy-MM-dd")}";
            ButtonSave.IsEnabled = !string.IsNullOrWhiteSpace(ProjectName.Text);
            ProjectName.Focus();
        }
 private void OKButton_Click(object sender, RoutedEventArgs e)
 {
     if (string.IsNullOrWhiteSpace(ProjectName.Text))
     {
         System.Windows.MessageBox.Show("Please specify a Project Name");
         ProjectName.Focus();
     }
     else if (string.IsNullOrWhiteSpace(FederationName.Text))
     {
         System.Windows.MessageBox.Show("Please specify a Federation Name");
         FederationName.Focus();
     }
     else if (string.IsNullOrWhiteSpace(Location.Text))
     {
         System.Windows.MessageBox.Show("Please specify a Folder Location");
         Location.Focus();
     }
     else if (!Directory.Exists(Location.Text))
     {
         System.Windows.MessageBox.Show("Invalid folder name, please specify a valid one");
         Location.Focus();
     }
     else if (string.IsNullOrWhiteSpace(CreatedPersonTextBox.Text))
     {
         System.Windows.MessageBox.Show("Please specify an Authors Name");
         CreatedPersonTextBox.Focus();
     }
     else if (string.IsNullOrWhiteSpace(CreatedOrgTextBox.Text))
     {
         System.Windows.MessageBox.Show("Please specify an Organisation Name");
         CreatedOrgTextBox.Focus();
     }
     else
     {
         DialogResult = true;
         this.Close();
     }
 }
Пример #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["Customer"] != null)
     {
         if (Request.Url.Query == "?Source=ProjectsPerCustomer")
         {
             string FullName = Session["Customer"].ToString();
             ProjectName.Value = FullName;
         }
         else
         {
             Customer c = new Customer();
             c = (Customer)Session["Customer"];
             ProjectName.Value = c.Fname + " " + c.Lname;
         }
     }
     if (Request.Url.Query == "?Source=NewCustomer")
     {
         Page.ClientScript.RegisterStartupScript(this.GetType(), "ModalCustomerCreated", "ActivateModal('ModalCustomerCreated');", true);
     }
     ProjectDateOpened.Value     = (DateTime.Today).ToString("MM/dd/yyyy");
     ProjectExpirationDate.Value = (DateTime.Now.AddYears(7)).ToString("MM/dd/yyyy");
     ProjectName.Focus();
 }
Пример #5
0
        private void SaveButton_Click(object sender, EventArgs e)
        {
            if (ObjectName.Text.Trim() == "")
            {
                MessageBoxMx.ShowError("You must supply a name");
                ObjectName.Focus();
                return;
            }

            if (ProjectName.Text.Trim() == "")
            {
                ProjectTarget.Text = "";
                if (Lex.Ne(ObjectName.Text.Trim(), "Current"))                 // blank project not allowed unless saving current
                {
                    MessageBoxMx.ShowError("You must supply a folder name");
                    ProjectName.Focus();
                    return;
                }
            }

            string txt = ProjectTarget.Text;

            if (txt.ToLower().IndexOf("project ") == 0 && txt.Length > 8)
            {
                txt = txt.Substring(8);
            }
            else if (txt.ToLower().IndexOf("folder ") == 0 && txt.Length > 7)
            {
                txt = txt.Substring(7).ToUpper();
            }
            else if (txt.ToLower().IndexOf("submenu ") == 0 && txt.Length > 8)
            {
                txt = txt.Substring(8).ToUpper();
            }
            MetaTreeNode mtn = MetaTree.GetNode(txt);

            if (mtn == null && UserObjectTree.FolderNodes.ContainsKey(txt))
            {
                mtn = UserObjectTree.FolderNodes[txt];
            }

            UserObject uo2 = new UserObject(Uo.Type);

            uo2.Owner       = SS.I.UserName;       // we will be the new owner
            uo2.Description = Uo.Description;      // copy any description
            uo2.Name        = ObjectName.Text;
            uo2.AccessLevel = Uo.AccessLevel;
            uo2.ACL         = Uo.ACL;

            //reassigning the folder id to the object type folder happens in the "Save"
            if (mtn != null)
            {
                uo2.ParentFolder     = mtn.Target.ToUpper();
                uo2.ParentFolderType = mtn.GetUserObjectFolderType();
            }

            UserObject uo3 = UserObjectDao.ReadHeader(uo2);             // see if already exists

            if (uo3 != null)
            {
                string objectTypeName = UserObject.GetTypeLabel(Uo.Type);

                DialogResult dr = MessageBoxMx.Show(
                    objectTypeName + " " + uo2.Name + " already exists. Do you want to replace it?",
                    UmlautMobius.String, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);

                if (dr == DialogResult.No)
                {
                    return;
                }
                else if (dr == DialogResult.Cancel)
                {
                    DialogResult = DialogResult.Cancel;
                    return;
                }
                else
                {
                    uo2.Id = uo3.Id;                  // keep the id when overwriting
                }
            }

            Uo           = uo2;   // info on object to save
            DialogResult = DialogResult.OK;
            return;
        }