Ejemplo n.º 1
0
        private void btnAssignUser_Click(object sender, EventArgs e)
        {
            string sqlString = null;
            String username  = comboUsers.Text;

            sqlString = string.Format(@"INSERT INTO  t_team (username, project) values( '{0}', '{1}');", username, glob.ProjectName);
            db.SendQueryToDb(sqlString);
            listProjectTeam.Items.Clear();
            sqlString = string.Format(@"SELECT username FROM t_team WHERE project like'{0}';", glob.ProjectName);
            db.LoadTextList(listProjectTeam, "username", sqlString);
        }
Ejemplo n.º 2
0
        private void FormProjectSettings_Load(object sender, EventArgs e)
        {
            this.Text = "Project settings";
            string sqlString = null;
            Baza   db        = new Baza();

            labRepozName.Text  = db.GetRepozName();
            labLoggedUser.Text = glob.loggedUser;
            labProjName.Text   = glob.ProjectName;
            sqlString          = @"SELECT username FROM t_members;";
            db.LoadCombo(comboUsers, "username", sqlString);
            listProjectTeam.Items.Clear();
            sqlString = string.Format(@"SELECT username FROM t_team WHERE project like'{0}';", glob.ProjectName);
            db.LoadTextList(listProjectTeam, "username", sqlString);
            sqlString = string.Format(@"SELECT filename FROM t_doc WHERE project like'{0}';", glob.ProjectName);

            db.LoadTextList(listBoxDoc, "filename", sqlString);
        }
Ejemplo n.º 3
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");
            }
        }