private void BasicUser_button_Click(object sender, EventArgs e)
        {
            // ---------------
            user = new BasicUser("mai", "benami", "307889402", 22, "maibe", "benami24");

            // ---------------

            this.basicUserForm = new BasicUser_Form(ref user);
            this.Hide();
            basicUserForm.FormClosed += new FormClosedEventHandler(basicUserForm_FormClosed);
            basicUserForm.ShowDialog();
        }
Exemple #2
0
 public BasicUser_Registration_Form(ref BasicUser user, Boolean isRegistration)
 {
     this.basicUser      = user;
     this.isRegistration = isRegistration;
     //this.FormClosed += new FormClosedEventHandler();
     InitializeComponent();
     if (basicUser.Id != null)
     {
         FirstName_textBox.Text = basicUser.FirstName;
         LastName_textBox.Text  = basicUser.LastName;
         textBox1.Text          = basicUser.Id;
         textBox1.ReadOnly      = true;
         Age_textBox.Text       = "" + basicUser.Age;
         Username_textBox.Text  = basicUser.Username;
         Password_textBox.Text  = basicUser.Password;
     }
 }
        private void AddNewTeachingAssist_button_Click(object sender, EventArgs e)
        {
            /*AddNewTeachingAssistantForm regForm = new AddNewTeachingAssistantForm();
             * regForm.FormClosed += new FormClosedEventHandler(FormClosedHandling);
             * regForm.ShowDialog();
             * regForm.CallBasicUserRegisteration();
             * //regForm = null;
             */
            this.Hide();

            //BasicUser newUser = null;
            //BasicUser_Registration_Form regForm = new BasicUser_Registration_Form(ref newUser);
            this.teachingAssist           = new TeachingAssistant();
            this.teachingAssist.FirstName = "empty";
            BasicUser temp = (BasicUser)this.teachingAssist;
            BasicUser_Registration_Form regForm = new BasicUser_Registration_Form(ref temp);

            regForm.FormClosed += new FormClosedEventHandler(FormClosedHandling);
            regForm.ShowDialog();

            if (temp != null)
            {
                String tempt = "The new user details: FirstName:" + temp.FirstName + ", lastname:" + temp.LastName + ",password:"******"INSERT INTO TeachingAssistantTable (firstName, lastName, id, age, userName,password) VALUES(%s, %s, %s, %d, %s, %s)", temp.FirstName, temp.LastName, temp.Id, temp.Age, temp.Username, temp.Password);
                 * //sql = "SELECT * FROM TeachingAssistantTable";
                 *
                 * command = new SqlCommand(sql, conn);
                 *  adapter.SelectCommand = command;
                 *  adapter.Fill(ds);
                 *  adapter.Dispose();
                 *  command.Dispose();
                 *
                 *  String result = "";
                 *  for (i = 0; i <= ds.Tables[0].Rows.Count - 1; i++)
                 *  {
                 *      result+= (ds.Tables[0].Rows[i].ItemArray[0]
                 + "--" + ds.Tables[0].Rows[i].ItemArray[1]
                 + "--" + ds.Tables[0].Rows[i].ItemArray[2]
                 + "--" + ds.Tables[0].Rows[i].ItemArray[3]
                 + "--" + ds.Tables[0].Rows[i].ItemArray[4]
                 + "--" + ds.Tables[0].Rows[i].ItemArray[5]
                 + "\n");
                 +
                 +  }
                 */
                // --------------------------------------------------------------------
            }
        }
Exemple #4
0
 public BasicUser_Form(ref BasicUser user)
 {
     this.basicUser = user;
     InitializeComponent();
 }
 public BasicUser_Registration_Form(ref BasicUser user)
 {
     this.basicUser = user;
     //this.FormClosed += new FormClosedEventHandler();
     InitializeComponent();
 }