Exemplo n.º 1
0
        public ReportDetailForm(ClassDTO _class)
        {
            InitializeComponent();
            SignupDAL signupDAL = new SignupDAL();

            signupDAL.ConnectToDatabase();
            List <SignupDTO> signupDTOs = signupDAL.GetAllSignupClass(_class.ClassId);

            dgvReport.DataSource = signupDTOs;
            ProgramDAL programDAL = new ProgramDAL();

            programDAL.ConnectToDatabase();
            TotalFee       = (programDAL.GetProgram(_class.ProgramId).Fee *signupDTOs.Count).ToString();
            labelType.Text = "Tổng số tiền thu được (USD): ";
            labelInfo.Text = TotalFee;
        }
Exemplo n.º 2
0
        public StudentReportForm(StudentDTO _studentDTO)
        {
            InitializeComponent();

            string            TotalFee = "";
            List <StudentDTO> a        = new List <StudentDTO>();

            a.Add(_studentDTO);
            SignupDAL signupDAL = new SignupDAL();

            signupDAL.ConnectToDatabase();
            List <SignupDTO> signupDTOs = signupDAL.GetAllSignupStudent(_studentDTO.StudentId);


            //DataTable dt = new DataTable();
            //dt.Columns.Add("StudentId", typeof(string));
            //dt.Columns.Add("StudentName", typeof(string));
            //dt.Columns.Add("StudentMail", typeof(string));
            //dt.Columns.Add("StudentAddress", typeof(string));
            //dt.Columns.Add("StudentPhone", typeof(string));
            //dt.Columns.Add("StudentBirthDate", typeof(DateTime));
            //DataRow row = dt.NewRow();
            //row["StudentId"] = _studentDTO.StudentId;
            //row["StudentName"] = _studentDTO.StudentName;
            //row["StudentMail"] = _studentDTO.StudentMail;
            //row["StudentAddress"] = _studentDTO.StudentAddress;
            //row["StudentPhone"] = _studentDTO.StudentPhone;
            //row["StudentBirthDate"] = _studentDTO.StudentBirthDate;
            //dt.Rows.Add(row);
            //DataSet ds = new DataSet();
            //ds.Tables.Add(dt);
            //StudentInfoReport1.SetDataSource(ds);

            ((TextObject)StudentInfoReport1.Section4.ReportObjects["txtId"]).Text        = "Mã: " + _studentDTO.StudentId;
            ((TextObject)StudentInfoReport1.Section4.ReportObjects["txtName"]).Text      = "Tên: " + _studentDTO.StudentName;
            ((TextObject)StudentInfoReport1.Section4.ReportObjects["txtMail"]).Text      = "Địa chỉ mail: " + _studentDTO.StudentMail;
            ((TextObject)StudentInfoReport1.Section4.ReportObjects["txtAddress"]).Text   = "Địa chỉ: " + _studentDTO.StudentAddress;
            ((TextObject)StudentInfoReport1.Section4.ReportObjects["txtPhone"]).Text     = "Số điện thoại: " + _studentDTO.StudentPhone;
            ((TextObject)StudentInfoReport1.Section4.ReportObjects["txtBirthDate"]).Text = "Ngày sinh: " + _studentDTO.StudentBirthDate.ToLongDateString();


            TotalFee = (250 * signupDTOs.Count).ToString();
            ((TextObject)StudentInfoReport1.Section4.ReportObjects["txtMoney"]).Text = "Tổng số tiền đã đóng (USD): " + TotalFee;
            crystalReportViewerStudent.ReportSource = StudentInfoReport1;
            crystalReportViewerStudent.Refresh();
            crystalReportViewerStudent.RefreshReport();
        }
Exemplo n.º 3
0
 private void btnConfirm_Click(object sender, EventArgs e)
 {
     foreach (DataGridViewRow item in dgvListStudent.Rows)
     {
         if ((Convert.ToBoolean(item.Cells[0].Value) == true))
         {
             string    studentId = item.Cells[1].Value.ToString();
             SignupDAL signupDAL = new SignupDAL();
             signupDAL.ConnectToDatabase();
             if (signupDAL.DeleteSignup(studentId, classId, "Joined"))
             {
                 MessageBox.Show(" Xoá thành công!!!");
                 this.Close();
             }
         }
     }
 }
Exemplo n.º 4
0
        public ReportDetailForm(StudentDTO _student)
        {
            int fees = 0;

            InitializeComponent();

            List <StudentDTO> a = new List <StudentDTO>();

            a.Add(_student);
            dgvReport.DataSource = a;
            SignupDAL signupDAL = new SignupDAL();

            signupDAL.ConnectToDatabase();
            List <SignupDTO> signupDTOs = signupDAL.GetAllSignupStudent(_student.StudentId);

            TotalFee       = (250 * signupDTOs.Count).ToString();
            labelType.Text = "Tổng số tiền đã đóng (USD): ";
            labelInfo.Text = TotalFee;
        }
Exemplo n.º 5
0
        public DeleteStudentToClassForm(string _classId, String nameClass)
        {
            InitializeComponent();
            InitOfficialStudentData();
            classId  = _classId;
            lb3.Text = "Xoá học viên khỏi lớp: " + nameClass;
            SignupDAL studentDAL = new SignupDAL();

            studentDAL.ConnectToDatabase();
            List <SignupDTO> studentDTOs = studentDAL.GetAllSignupClass(nameClass);

            dgvListStudent.DataSource = studentDTOs;
            DataGridViewCheckBoxColumn deleteConfirm = new DataGridViewCheckBoxColumn()
            {
                HeaderText = "Delete"
            };

            dgvListStudent.Columns.Add(deleteConfirm);
        }
Exemplo n.º 6
0
        public ClassReportForm(ClassDTO _classDTO)
        {
            InitializeComponent();
            ((TextObject)ClassInfoReport1.Section4.ReportObjects["txtClassId"]).Text   = "Mã lớp: " + _classDTO.ClassId;
            ((TextObject)ClassInfoReport1.Section4.ReportObjects["txtClassName"]).Text = "Tên lớp: " + _classDTO.ClassName;
            ((TextObject)ClassInfoReport1.Section4.ReportObjects["txtStartHour"]).Text = "Giờ học: " + _classDTO.StartHour;
            ((TextObject)ClassInfoReport1.Section4.ReportObjects["txtProgramId"]).Text = "Mã chương trình học: " + _classDTO.ProgramId;
            ((TextObject)ClassInfoReport1.Section4.ReportObjects["txtStartDate"]).Text = "Ngày bắt đầu: " + _classDTO.StartDate.ToLongDateString();
            ((TextObject)ClassInfoReport1.Section4.ReportObjects["txtEndDate"]).Text   = "Ngày kết thúc: " + _classDTO.EndDate.ToLongDateString();

            SignupDAL signupDAL = new SignupDAL();

            signupDAL.ConnectToDatabase();
            List <SignupDTO> signupDTOs = signupDAL.GetAllSignupClass(_classDTO.ClassId);
            ProgramDAL       programDAL = new ProgramDAL();

            programDAL.ConnectToDatabase();
            string TotalFee = (programDAL.GetProgram(_classDTO.ProgramId).Fee *signupDTOs.Count).ToString();

            ((TextObject)ClassInfoReport1.Section4.ReportObjects["txtStudentCount"]).Text = "Tổng số học sinh: " + signupDTOs.Count.ToString();
            ((TextObject)ClassInfoReport1.Section4.ReportObjects["txtMoney"]).Text        = "Tổng số tiền thu được (USD):  " + TotalFee;
        }