private void grVListStudents_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            if (e.Column == colAction)
            {
                int getId = 0;
                int.TryParse("" + grVListStudents.GetFocusedRowCellValue("Id"), out getId);


                if (getId > 0)
                {
                    btnHoanTatChonHv.Enabled = true;
                    StudentLists obj = mStudentListsBll.getElementById(getId);
                    //foreach (StudentLists item in lstselected)
                    //{
                    //    if (item.Id == obj.Id)
                    //        return;
                    //}
                    foreach (StudentLists item in lstStudentLists)
                    {
                        if (obj.Id == item.Id)
                        {
                            lstStudentLists.Remove(item);
                            break;
                        }
                    }
                    grCListStudents.DataSource = lstStudentLists;
                    grCListStudents.RefreshDataSource();
                    grCListStudents.Refresh();

                    lstselected.Add(obj);
                    LoadDataStudentSelected();
                }
            }
        }
        public uStudent(Account oAccount) : base(oAccount)
        {
            InitializeComponent();
            mStudentLists      = new StudentLists();
            mCommentSupport    = new CommentSupport();
            mLisCommentSupport = new List <CommentSupport>();
            mStudentListsBll   = new StudentListsBll(mAccount);
            dateEditFromDateCheckIn.EditValue = DateTime.Now.AddMonths(-3);

            dateEditToDateCheckIn.EditValue = DateTime.Now;
            //dateEditFromDateCheckIn.Text = ;
            //dateEditToDateCheckIn.Text = dateEditToDateCheckIn.EditValue.ToString();
        }
Exemple #3
0
 private void btnSearch_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty("" + dtpStart.Text) && !string.IsNullOrEmpty("" + dtpEnd.Text))
     {
         DateTime dtStartTime = DateTime.Parse("" + dtpStart.Value);
         DateTime dtEndTime   = DateTime.Parse("" + dtpEnd.Value);
         if (mAccount.IsSuperUser == true)
         {
             List <StudentLists> lisTemp = new StudentListsBll(mAccount).
                                           getElementByTime(dtStartTime, dtEndTime);
             if (lisTemp != null && lisTemp.Count > 0)
             {
                 List <StudentLists> lisStudent = new List <StudentLists>();
                 foreach (StudentLists o in lisTemp)
                 {
                     StudentLists oStudentList = new StudentLists();
                     oStudentList.Id       = o.Id;
                     oStudentList.FullName = o.FullName;
                     if (!string.IsNullOrEmpty(o.Email))
                     {
                         oStudentList.Email = new Common().DecryptInfo(o.Email);
                     }
                     oStudentList.Address = o.Address;
                     if (!string.IsNullOrEmpty(o.Mobile))
                     {
                         oStudentList.Mobile = new Common().DecryptInfo(o.Mobile);
                     }
                     oStudentList.DateCreate = o.DateCreate;
                     oStudentList.UserName   = o.UserName;
                     oStudentList.CourseName = o.CourseName;
                     oStudentList.StatusName = o.StatusName;
                     lisStudent.Add(oStudentList);
                 }
                 gridControlHVHeThong.DataSource = lisStudent;
             }
         }
         else
         {
             MessageBox.Show("Bạn ko có quyền sử dụng tính năng này");
         }
     }
 }
        /// <summary>
        /// Hàm binding dữ liệu lên form để chỉnh sửa
        /// Author            Date           Comment
        /// hungld          04/02/2013      Tạo mới
        /// </summary>
        private void Bindings(StudentLists oStudentLists)
        {
            txtHoTen.Text  = oStudentLists.FullName;
            txtDiaChi.Text = oStudentLists.Address;
            if (oStudentLists.Email != null)
            {
                txtEmail.Text = new Common().DecryptInfo(oStudentLists.Email);
            }
            else
            {
                txtEmail.Text = "";
            }
            if (oStudentLists.Mobile != null)
            {
                txtDiDong.Text = new Common().DecryptInfo(oStudentLists.Mobile);
            }
            else
            {
                txtDiDong.Text = "";
            }

            txtDescription.Text = oStudentLists.Description;
            dateEditBirth.Text  = oStudentLists.DateBirthday != null?oStudentLists.DateBirthday.Value.ToString("dd/MM/yyyy") : "";

            if (oStudentLists.StatusId.HasValue)
            {
                lookUpEditStatus.EditValue = oStudentLists.StatusId;
            }
            if (oStudentLists.CourseId > 0)
            {
                lookUpEditCourse.EditValue = oStudentLists.CourseId;
            }
            if (oStudentLists.Sex == 0)
            {
                cmbSex.Text = "Nam";
            }
            else
            {
                cmbSex.Text = "Nữ";
            }
        }