public override List <OfflineStudentRegisters> getElementByTime(DateTime dtStartTime, DateTime dtEndTime)
        {
            TrainingCenterEntities oEntities = ConnectionEntities.getTrainingCenter(mAcount);
            var oData = oEntities.SP_IMIC_Student_Register_Offline_ByTimes(dtStartTime, dtEndTime).ToList();
            List <OfflineStudentRegisters> lisOffRegister = new List <OfflineStudentRegisters>();
            Commons oCommons = new Commons(mAcount);

            foreach (var o in oData)
            {
                OfflineStudentRegisters oRegister = new OfflineStudentRegisters();
                oRegister.RegisterDetailId = o.RegisterDetailId;
                oRegister.FullName         = o.FullName;
                oRegister.Email            = oCommons.DecryptInfo(o.Email);
                oRegister.Phone            = oCommons.DecryptInfo(o.Phone);
                oRegister.Message          = o.Message;
                oRegister.Address          = o.Address;
                oRegister.CreatedTime      = (DateTime)o.CreatedTime;
                oRegister.UpdateDateTime   = (DateTime)o.UpdateDateTime;
                oRegister.UserName         = o.UserName;

                lisOffRegister.Add(oRegister);
            }
            return(lisOffRegister.Count <= 0 ? null : lisOffRegister);
        }
        public bool InsertAndUpdateNoEncrypt(StudentLists oT)
        {
            TrainingCenterEntities oEntities = ConnectionEntities.getTrainingCenter(mAcount);
            byte bOption = 0;

            if (oT.Id == 0)
            {
                bOption = 1;  //Insert
            }
            else
            {
                bOption = 0;  //Update
            }
            Commons oCommons = new Commons();

            oEntities.SP_Insert_Update_Student(bOption, oT.Id, oT.FirstName, oT.LastName, oT.FullName, oT.Sex,
                                               string.IsNullOrEmpty(oT.Mobile) ? ""
                                    : oT.Mobile, oT.DateBirthday,
                                               string.IsNullOrEmpty(oT.Email) ? ""
                                    : oT.Email, oT.Address,
                                               oT.DateCreate, oT.UserId, oT.CourseId, oT.StatusId,
                                               oT.Description);
            return(true);
        }
        public override List <StudentLists> getElementByTime(DateTime dtStartTime, DateTime dtEndTime)
        {
            TrainingCenterEntities oEntities = ConnectionEntities.getTrainingCenter(mAcount);

            if (mClasses != null)
            {
                var oData = oEntities.SP_GETLISTSTUDENT_NOTINCLASS_BYCLASSID_STUDENTS(dtStartTime.ToShortDateString(), mClasses.Id, dtEndTime.ToShortDateString()).ToList();
                List <StudentLists> lisStudent = new List <StudentLists>();
                Commons             oCommons   = new Commons();
                foreach (var o in oData)
                {
                    StudentLists oStudentLists = new StudentLists();
                    oStudentLists.Id       = o.Id;
                    oStudentLists.FullName = o.FullName;
                    if (o.Sex == 0)
                    {
                        oStudentLists.SexString = "Nam";
                    }
                    else
                    {
                        oStudentLists.SexString = "Nữ";
                    }
                    oStudentLists.Sex          = o.Sex;
                    oStudentLists.Mobile       = string.IsNullOrEmpty(o.Mobile) ? "" : /*o.Mobile*/ oCommons.DecryptInfo(o.Mobile);
                    oStudentLists.DateBirthday = o.DateBirthday;
                    oStudentLists.Email        = string.IsNullOrEmpty(o.Email) ? "" : /*o.Email*/ oCommons.DecryptInfo(o.Email);
                    oStudentLists.Address      = o.Address;
                    oStudentLists.DateBirthday = o.DateBirthday;
                    oStudentLists.UserId       = o.UserId;
                    oStudentLists.UserName     = o.UserName;
                    oStudentLists.CourseId     = o.CourseId;
                    oStudentLists.CourseName   = o.CourseName;
                    oStudentLists.StatusId     = o.StatusId;
                    oStudentLists.StatusName   = o.StatusName;
                    oStudentLists.Description  = o.Description;
                    oStudentLists.DateCreate   = (DateTime)o.DateCreate;
                    lisStudent.Add(oStudentLists);
                }

                return(lisStudent.Count <= 0 ? null : lisStudent);
            }
            else
            {
                var oData = oEntities.SP_GETELEMENTS_BYDATE_STUDENTS(dtStartTime.ToShortDateString(), dtEndTime.ToShortDateString()).ToList();
                List <StudentLists> lisStudent = new List <StudentLists>();
                Commons             oCommons   = new Commons();
                foreach (var o in oData)
                {
                    StudentLists oStudentLists = new StudentLists();
                    oStudentLists.Id       = o.Id;
                    oStudentLists.FullName = o.FullName;
                    if (o.Sex == 0)
                    {
                        oStudentLists.SexString = "Nam";
                    }
                    else
                    {
                        oStudentLists.SexString = "Nữ";
                    }
                    oStudentLists.Sex          = o.Sex;
                    oStudentLists.Mobile       = string.IsNullOrEmpty(o.Mobile) ? "" : /*o.Mobile*/ oCommons.DecryptInfo(o.Mobile);
                    oStudentLists.DateBirthday = o.DateBirthday;
                    oStudentLists.Email        = string.IsNullOrEmpty(o.Email) ? "" : /*o.Email*/ oCommons.DecryptInfo(o.Email);
                    oStudentLists.Address      = o.Address;
                    oStudentLists.DateBirthday = o.DateBirthday;
                    oStudentLists.UserId       = o.UserId;
                    oStudentLists.UserName     = o.UserName;
                    oStudentLists.CourseId     = o.CourseId;
                    oStudentLists.CourseName   = o.CourseName;
                    oStudentLists.StatusId     = o.StatusId;
                    oStudentLists.StatusName   = o.StatusName;
                    oStudentLists.Description  = o.Description;
                    oStudentLists.DateCreate   = (DateTime)o.DateCreate;
                    lisStudent.Add(oStudentLists);
                }

                return(lisStudent.Count <= 0 ? null : lisStudent);
            }
        }