コード例 #1
0
        private void btnOpenProject_Click_1(object sender, EventArgs e) //Opens(activates) selected project, and enables project setting button
        {
            if (listBoxWorkDoc.Items.Count < 1)
            {
                if (!String.IsNullOrEmpty(comboProjects.Text))
                {
                    string sqlString      = null;
                    string TempFolderPath = null;
                    glob.ProjectName   = comboProjects.SelectedValue.ToString();
                    labProjName.Text   = glob.ProjectName;
                    btnProjSet.Enabled = true;     //Enable button for project settings form open
                    listViewProjDoc.Items.Clear(); //Clear list, and load all file names from db (Query is hardcoded)
                    db.LoadVeiwListProjectDocuments(listViewProjDoc);

                    listBoxWorkDoc.Items.Clear();                                                                            //Load working docs
                    sqlString = string.Format(@"SELECT * FROM t_workingdoc WHERE workinguser LIKE '{0}';", glob.loggedUser); //Load listBox - working folder
                    db.LoadTextList(listBoxWorkDoc, "filename", sqlString);

                    TempFolderPath = db.GetRepozPath() + @"\\" + db.GetRepozName() + @"\\Temp"; //Delete repository temp folder
                    sy.ClearFolder(TempFolderPath);

                    listViewSupport.Items.Clear(); //Load suport requests
                    db.LoadVeiwListSupportRequests(listViewSupport);
                    //Load comboMsg with message subjects and sent-timestamp
                    comboMsgSubject.Text    = null;
                    textBoxMsgFrom.Text     = null;
                    textBoxMessageBody.Text = null;
                    sqlString = string.Format(@"SELECT * FROM t_msg WHERE project LIKE '{0}' AND receiver LIKE '{1}' AND deleted = 0;", glob.ProjectName, glob.loggedUser);
                    db.LoadComboMsgTopicTimesamp(comboMsgSubject, sqlString);
                }
                else
                {
                    MessageBox.Show("No project selected");
                }
            }
            else
            {
                MessageBox.Show("There are documents to be commited before exiting active project");
            }
        }
コード例 #2
0
 private void btnProjSet_Click(object sender, EventArgs e)
 {
     if (!String.IsNullOrEmpty(glob.ProjectName) && glob.passLevel > 8)
     {
         FormProjectSettings FrmProjSet = new FormProjectSettings();
         FrmProjSet.ShowDialog();
         //Refresh does not work, so....manualy :)
         Baza db = new Baza();
         labRepozName.Text = db.GetRepozName(); //show repository name in label on the form(if repository is created and in t_repoz table).
         labProjName.Text  = glob.ProjectName;
         db.GetProjectsInCombo(comboProjects);
         listViewProjDoc.Items.Clear(); //Clear list, and load all file names from db (Query is hardcoded)
         db.LoadVeiwListProjectDocuments(listViewProjDoc);
     }
     else
     {
         MessageBox.Show("No active project or access level < 9");
     }
 }