Exemplo n.º 1
0
        private void showProjectToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Show_Projects showProject = new Show_Projects();

            this.Hide();
            showProject.Show();
        }
Exemplo n.º 2
0
        private void cmdCancel_Click(object sender, EventArgs e)
        {
            GeneralID.selectedObjectid = 0; //reset it to zero after successfull update
            Show_Projects projects = new Show_Projects();

            this.Hide();
            projects.Show();
        }
Exemplo n.º 3
0
 private void cmdSave_Click(object sender, EventArgs e)
 {
     if (!is_invalid())
     {
         if (!is_editMode())
         {
             string queryProject = string.Format("insert into Project(Description,Title) values('{0}','{1}')", richTextBxDesc.Text, txtBxTitle.Text);
             DataBaseConnection.getInstance().executeQuery(queryProject);
             MessageBox.Show("Added Success");
         }
         else
         {
             string updateQuery = string.Format("update Project  set Title='{0}',Description='{1}' where Id='{2}'", txtBxTitle.Text, richTextBxDesc.Text, GeneralID.selectedObjectid);
             DataBaseConnection.getInstance().executeQuery(updateQuery);
             MessageBox.Show("Update Success");
             GeneralID.selectedObjectid = 0; //reset it to zero after successfull update
         }
         Show_Projects showProject = new Show_Projects();
         this.Hide();
         showProject.Show();
     }
 }