Exemple #1
0
        private void showEvaluationsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Show_Evaluations Evaluation = new Show_Evaluations();

            this.Hide();
            Evaluation.Show();
        }
        private void cmdCancel_Click(object sender, EventArgs e)
        {
            Show_Evaluations evaluation = new Show_Evaluations();

            this.Hide();
            evaluation.Show();
        }
 private void cmdSave_Click(object sender, EventArgs e)
 {
     if (!is_invalid())
     {
         if (!is_editMode())
         {
             string query = string.Format("insert into Evaluation(Name,TotalMarks,TotalWeightage) values('{0}','{1}','{2}')", txtBxName.Text, int.Parse(txtBxTotalMark.Text), int.Parse(txtBxTotalWeightage.Text));
             DataBaseConnection.getInstance().executeQuery(query);
             MessageBox.Show("Evaluation added Successfully");
         }
         else
         {
             string query = string.Format("update Evaluation set Name='{0}',TotalMarks='{1}',TotalWeightage='{2}' where Id='{3}'", txtBxName.Text, int.Parse(txtBxTotalMark.Text), int.Parse(txtBxTotalWeightage.Text), GeneralID.selectedObjectid);
             DataBaseConnection.getInstance().executeQuery(query);
             MessageBox.Show("Evaluation updated Successfully");
             GeneralID.selectedObjectid = 0; //reset it to zero after successfull update
         }
         Show_Evaluations evaluation = new Show_Evaluations();
         this.Hide();
         evaluation.Show();
     }
 }