Exemplo n.º 1
0
        void InitProgramData()
        {
            ProgramDAL programDAL = new ProgramDAL();

            programDAL.ConnectToDatabase();
            List <ProgramDTO> programDTOs = programDAL.GetAllProgram();

            dgvListProgram.DataSource = programDTOs;
        }
Exemplo n.º 2
0
        void LoadComboBoxProgram()
        {
            ProgramDAL programDAL = new ProgramDAL();

            programDAL.ConnectToDatabase();
            List <ProgramDTO> programDTOs = programDAL.GetAllProgram();

            comboBoxProgram.DataSource    = programDTOs;
            comboBoxProgram.DisplayMember = "ProgramName";
            comboBoxProgram.ValueMember   = "ProgramId";
        }
Exemplo n.º 3
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.º 4
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         ProgramDAL programDAL = new ProgramDAL();
         programDAL.ConnectToDatabase();
         int        level      = Int32.Parse(Level.Text);
         int        fee        = Int32.Parse(Fee.Text);
         ProgramDTO programDTO = new ProgramDTO(ID.Text, name.Text, level, fee);
         if (programDAL.UpdateProgram(programDTO))
         {
             MessageBox.Show("Cập nhật Chương trình học thành công!!!");
             this.Close();
         }
     }
     catch (Exception)
     {
         MessageBox.Show("Lỗi, cập nhật Chương trình học không thành công!");
     }
 }
Exemplo n.º 5
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;
        }