Ejemplo n.º 1
0
 private void dataGridView1_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
 {
     AccountOperation addMAccount = new ModifyAccount(e.RowIndex);
     addMAccount.SetDataTable(originalTable);
     addMAccount.ShowDialog();
     FillTheDatagrid();
 }
Ejemplo n.º 2
0
        private void dataGridView1_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            AccountOperation addMAccount = new ModifyAccount(e.RowIndex);

            addMAccount.SetDataTable(originalTable);
            addMAccount.ShowDialog();
            FillTheDatagrid();
        }
Ejemplo n.º 3
0
 private void button2_Click(object sender, EventArgs e)
 {
     //Modify the current account;
     int rowIndex=dataGridView1.CurrentRow.Index;
     AccountOperation addMAccount=new ModifyAccount(rowIndex);
     addMAccount.SetDataTable(originalTable);
     addMAccount.ShowDialog();
     FillTheDatagrid();
 }
Ejemplo n.º 4
0
        private void button2_Click(object sender, EventArgs e)
        {
            //Modify the current account;
            int rowIndex = dataGridView1.CurrentRow.Index;
            AccountOperation addMAccount = new ModifyAccount(rowIndex);

            addMAccount.SetDataTable(originalTable);
            addMAccount.ShowDialog();
            FillTheDatagrid();
        }
Ejemplo n.º 5
0
        public string InsertTeacherAccount(CreateTeacherAccount model)
        {
            DateTime      birth   = new DateTime(model.year, model.month, model.day);
            string        md5pass = new Md5Function().MD5HashFunction(model.password);
            ModifyAccount ma      = new ModifyAccount();
            ModifyTeacher mt      = new ModifyTeacher();

            if (ma.Check(model.username))
            {
                return("false");
            }
            else
            {
                ma.Insert(model.username, md5pass, 2);
                mt.Insert(model.name, model.gender, model.country, model.branch, birth, model.phoneNumber, model.username);
                return("true");
            }
        }
Ejemplo n.º 6
0
        public string InsertStudentAccount(CreateStudentAccount model)
        {
            DateTime      birth   = new DateTime(model.year, model.month, model.day);
            string        md5pass = new Md5Function().MD5HashFunction(model.password);
            ModifyAccount ma      = new ModifyAccount();
            ModifyStudent ms      = new ModifyStudent();

            if (ma.Check(model.username))
            {
                return("false");
            }
            else
            {
                ma.Insert(model.username, md5pass, 3);
                ms.Insert(model.name, birth, model.gender, model.country, model.address, model.username, model.course, model.branch);
                return("true");
            }
        }
        public string InsertAdminAccount(string username, string password, int positionID, string name)
        {
            ModifyAccount ma  = new ModifyAccount();
            Md5Function   md5 = new Md5Function();
            ModifyAdmin   mad = new ModifyAdmin();

            if (ma.Check(username))
            {
                return("false");
            }
            else
            {
                string md5pass = md5.MD5HashFunction(password);
                ma.Insert(username, md5pass, positionID);
                mad.Insert(mad.GetNextID(), name, username);
                return("true");
            }
        }