Exemple #1
0
        public ActionResult SaveOrUpdate(TeacherEntities teachenetities)
        {
            TeacherBL teacherBl      = new TeacherBL();
            int       recordAffected = teacherBl.SaveOrUpdate(teachenetities);

            return(Json(recordAffected, JsonRequestBehavior.AllowGet));
        }
        public void populateDAataGrideview()
        {
            DataTable dt           = new DataTable();
            TeacherBL TeacherBLOBJ = new TeacherBL();

            dt = TeacherBLOBJ.GetExistingTeacherBL();
            TeacherdataGridView.DataSource = dt;
        }
Exemple #3
0
 public TeacherProfileUpdate(Teacher teacher)
 {
     InitializeComponent();
     teacherBL        = new TeacherBL();
     this.teacher     = new Teacher();
     this.teacher     = teacher;
     txtUserName.Text = teacher.UserID;
     LoadData();
 }
Exemple #4
0
 public ViewTeacherCourses(Teacher teacher)
 {
     InitializeComponent();
     teacherBL        = new TeacherBL();
     this.teacher     = new Teacher();
     txtUserName.Text = teacher.UserID;
     this.teacher     = teacher;
     LoadMyCourses();
 }
Exemple #5
0
 public HomePage(string UserName)
 {
     InitializeComponent();
     teacherBL        = new TeacherBL();
     txtUserName.Text = UserName;
     this.teacher     = new Teacher();
     teacher.UserID   = UserName;
     txtUserName.Text = UserName;
     LoadTeacher();
 }
        //private void teacherbackbutton_Click(object sender, EventArgs e)
        //{

        //    Courses CoursesUI = new Courses();
        //    CoursesUI.Show();
        //    this.Hide();
        //}

        private void Savebutton_Click(object sender, EventArgs e)
        {
            Teacher aTeacher = new Teacher();

            aTeacher.ID              = teacheridtextbox.Text;
            aTeacher.Name            = teachernametextBox.Text;
            aTeacher.Desegnation     = desegnationtextBox.Text;
            aTeacher.Depertment      = teacherdepertmenttextBox.Text;
            aTeacher.ContactNo       = teachercontacttextBox.Text;
            aTeacher.CourseAdvisor   = courseAdvisorcomboBox.Text;
            aTeacher.CouncellingHour = councellinghourtextBox.Text;
            aTeacher.Salary          = 0;
            float.TryParse(salarytextBox.Text, out aTeacher.Salary);
            aTeacher.Adress = teacheradresstextbox.Text;

            TeacherBL TeacherBLOBJ = new TeacherBL();
            bool      result       = TeacherBLOBJ.ValidateANewTeacherAndSendToDA(aTeacher);

            //string connectionstring = @"Data Source =DESKTOP-1U7PLQM\SQLEXPRESS;Database =SMS;Integrated Security = SSPI";
            //SqlConnection connection = new SqlConnection();
            //connection.ConnectionString = connectionstring;
            //connection.Open();

            //string query = "INSERT INTO Teacher VALUES('" + teacheridtextbox.Text + "','" + teachernametextBox.Text + "','" + designationtextBox.Text + "','" + teacherdepertmenttextBox.Text + "','" + teachercontacttextBox.Text + "','" + coursespecialiestcomboBox.Text + "','" + councellinghourtextBox.Text + "','" + salarytextBox.Text + "','" + teacheradresstextbox.Text + "')";
            //SqlCommand command = new SqlCommand(query, connection);
            //int rowsAffected = command.ExecuteNonQuery();
            //MessageBox.Show(rowsAffected + "row(s) Affected.");
            if (result)
            {
                MessageBox.Show("Welcome A New Teacher");

                this.populateDAataGrideview();
                Savebutton.Enabled = true;

                teacherupdatebutton.Enabled = true;
                teacherdeletebutton.Enabled = true;
                clearbutton.Enabled         = true;

                teacheridtextbox.Text         = " ";
                teachernametextBox.Text       = " ";
                desegnationtextBox.Text       = " ";
                teacherdepertmenttextBox.Text = " ";
                teachercontacttextBox.Text    = " ";
                courseAdvisorcomboBox.Text    = " ";
                councellinghourtextBox.Text   = " ";
                salarytextBox.Text            = " ";
                teacheradresstextbox.Text     = " ";
            }
            else
            {
                MessageBox.Show("RESULT: " + TeacherBLOBJ.Message);
            }
        }
        private void teacherupdatebutton_Click_1(object sender, EventArgs e)
        {
            Teacher aTeacher = new Teacher();

            aTeacher.ID              = teacheridtextbox.Text;
            aTeacher.Name            = teachernametextBox.Text;
            aTeacher.Desegnation     = desegnationtextBox.Text;
            aTeacher.Depertment      = teacherdepertmenttextBox.Text;
            aTeacher.ContactNo       = teachercontacttextBox.Text;
            aTeacher.CourseAdvisor   = courseAdvisorcomboBox.Text;
            aTeacher.CouncellingHour = councellinghourtextBox.Text;
            aTeacher.Salary          = 0;
            float.TryParse(salarytextBox.Text, out aTeacher.Salary);
            aTeacher.Adress = teacheradresstextbox.Text;

            TeacherBL TeacherBLOBJ = new TeacherBL();
            bool      result       = TeacherBLOBJ.UpdateANewTeacherAndSendToDA(aTeacher);

            if (result)
            {
                MessageBox.Show("UPDATE IS COMPLETE");
                this.populateDAataGrideview();
                teacherupdatebutton.Enabled = true;
                teacherdeletebutton.Enabled = true;
                clearbutton.Enabled         = true;
                Savebutton.Enabled          = true;



                teacheridtextbox.Text         = " ";
                teachernametextBox.Text       = " ";
                desegnationtextBox.Text       = " ";
                teacherdepertmenttextBox.Text = " ";
                teachercontacttextBox.Text    = " ";
                courseAdvisorcomboBox.Text    = "";
                councellinghourtextBox.Text   = " ";
                salarytextBox.Text            = " ";
                teacheradresstextbox.Text     = " ";
            }
            else
            {
                MessageBox.Show("RESULT: " + TeacherBLOBJ.Message);
            }
        }
Exemple #8
0
 public void registerTeacher(Teacher teacher)
 {
     TeacherBL.registerTeacher(teacher);
 }
Exemple #9
0
 public List <TeacherDTO> GetAllTeacher()
 {
     return(TeacherBL.GetAllTeacher());
 }
Exemple #10
0
 public TeacherDTO LoginTeacher(Login login)
 {
     return(TeacherBL.LoginTeacher(login.UserName, login.Password));
 }
Exemple #11
0
 public bool RegisterUser(TeacherDTO teacher)
 {
     return(TeacherBL.RegisterTeacher(teacher));
 }