示例#1
0
        public override List <StudentClasses> CheckElementByObject(StudentClasses oT)
        {
            TrainingCenterEntities oEntities = ConnectionEntities.getTrainingCenter(mAcount);
            var oData = oEntities.SP_GETLITSTUDENT_BYID_CLASS_02(oT.ClassId).ToList();
            List <StudentClasses> olisStudentClasses = new List <StudentClasses>();
            Commons oCommons = new Commons();

            foreach (var o in oData)
            {
                StudentClasses oStudentClasses = new StudentClasses();
                oStudentClasses.Id      = o.Id;
                oStudentClasses.ClassId = (int)o.ClassId;
                //oStudentClasses.ClassName = o.ClassName;
                oStudentClasses.DateStart = (DateTime)o.DateStart;
                oStudentClasses.FullName  = o.FullName;
                oStudentClasses.Email     = string.IsNullOrEmpty(o.Email) ? "" : oCommons.DecryptInfo(o.Email);
                //oStudentClasses.FullName = o.FullName;
                oStudentClasses.Mobile = string.IsNullOrEmpty(o.Mobile) ? "" : oCommons.DecryptInfo(o.Mobile);
                oStudentClasses.Sex    = (int)o.Sex;
                if (oStudentClasses.Sex == 0)
                {
                    oStudentClasses.sSex = "Nam";
                }
                else
                {
                    oStudentClasses.sSex = "Nữ";
                }
                //oStudentClasses.sSex = o.sSex;
                oStudentClasses.StudentId  = (int)o.StudentId;
                oStudentClasses.TotalPrice = string.IsNullOrEmpty("" + o.TotalPrice) ? 0 : (int)o.TotalPrice;
                oStudentClasses.Price1     = string.IsNullOrEmpty("" + o.Price1) ? 0 : (int)o.Price1;
                oStudentClasses.Price2     = string.IsNullOrEmpty("" + o.Price2) ? 0 : (int)o.Price2;
                oStudentClasses.Price3     = string.IsNullOrEmpty("" + o.Price3) ? 0 : (int)o.Price3;
                oStudentClasses.MustPay    = string.IsNullOrEmpty("" + o.MustPay) ? 0 : (int)o.MustPay;
                olisStudentClasses.Add(oStudentClasses);
            }
            return(olisStudentClasses);
        }
        public override List <Candidate> getElements()
        {
            List <Candidate> lstCandidate = new List <Candidate>();

            TrainingCenterEntities oEntity = ConnectionEntities.getTrainingCenter(mAcount);
            var lst = oEntity.SP_GetAll_Candidates();

            foreach (var item in lst)
            {
                Candidate oCan = new Candidate();
                oCan.Address          = item.Address;
                oCan.Avatar           = item.Avatar;
                oCan.CenterId         = item.CenterId;
                oCan.Contents         = item.Contents;
                oCan.DateBirthday     = item.DateBirthday;
                oCan.DateCreate       = item.DateCreate;
                oCan.DateInterview    = item.DateInterview;
                oCan.DateLastUpdate   = item.DateLastUpdate;
                oCan.DateSent         = item.DateSent;
                oCan.Description      = item.Description;
                oCan.DocumentPath     = item.DocumentPath;
                oCan.FirstName        = item.FirstName;
                oCan.FullName         = item.FullName;
                oCan.Id               = item.Id;
                oCan.ImagePath        = item.ImagePath;
                oCan.JobTitleId       = item.JobTitleId;
                oCan.LastName         = item.LastName;
                oCan.Notes            = item.Notes;
                oCan.OrderNumber      = item.OrderNumber;
                oCan.RecruitmentId    = item.RecruitmentId;
                oCan.Sex              = item.Sex;
                oCan.UniversityDegree = item.UniversityDegree;
                oCan.YearsExperience  = item.YearsExperience;

                lstCandidate.Add(oCan);
            }
            return(lstCandidate);
        }
示例#3
0
        public override Classes getElementById(object id)
        {
            TrainingCenterEntities oEntities = ConnectionEntities.getTrainingCenter(mAcount);
            var            oData             = oEntities.SP_GETELEMENT_BYID_CLASSES((int)id).ToList();
            List <Classes> lisClasses        = new List <Classes>();

            foreach (var o in oData)
            {
                Classes oClasses = new Classes
                {
                    Id             = o.Id,
                    ClassName      = o.ClassName,
                    FromDate       = o.FromDate,
                    ToDate         = o.ToDate,
                    PlaceTraining  = o.PlaceTraining,
                    NumberStudents = o.NumberStudents,
                    Description    = o.Description,
                    Status         = o.Status
                };
                return(oClasses);
            }
            return(null);
        }
示例#4
0
        public override List <Classes> getElements()
        {
            TrainingCenterEntities oEntities = ConnectionEntities.getTrainingCenter(mAcount);
            var            oData             = oEntities.SP_GETALL_AYEAR_CLASS().ToList();
            List <Classes> lisClasses        = new List <Classes>();

            foreach (var o in oData)
            {
                Classes oClasses = new Classes
                {
                    Id             = o.Id,
                    ClassName      = o.ClassName,
                    FromDate       = o.FromDate,
                    ToDate         = o.ToDate,
                    PlaceTraining  = o.PlaceTraining,
                    NumberStudents = o.NumberStudents,
                    Description    = o.Description,
                    Status         = o.Status
                };
                lisClasses.Add(oClasses);
            }
            return(lisClasses);
        }
        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 <CommentSupport> CheckElementById(object Id)
        {
            TrainingCenterEntities oEntities = ConnectionEntities.getTrainingCenter(mAcount);
            var oData = oEntities.SP_GETELEMENTSBYIDSTUDENT_COMMONTSUPPORT((int)Id).ToList();
            List <CommentSupport> lisComment = new List <CommentSupport>();

            foreach (var o in oData)
            {
                CommentSupport oComment = new CommentSupport
                {
                    Id          = o.Id,
                    CommentName = o.CommentName,
                    Desription  = o.Desription,
                    UserId      = o.UserId,


                    UserName = o.UserName,

                    DateLastUpdate = o.DateLastUpdate
                };
                lisComment.Add(oComment);
            }
            return(lisComment.Count <= 0 ? null : lisComment);
        }
 public override bool DeleteElement(object id)
 {
     TrainingCenterEntities oEntities = ConnectionEntities.getTrainingCenter(mAcount);
     return oEntities.SP_DELETE_EXPERTINFO_XOA((int)id) > 0 ? true : false ;
 }
        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);
            }
        }
        public override bool DeleteElement(Account oT)
        {
            TrainingCenterEntities oEntities = ConnectionEntities.getTrainingCenter(mAcount);

            return(oEntities.SP_DELETE_USER(oT.UserId) > 0);
        }
示例#11
0
        public override bool DeleteElement(object id)
        {
            TrainingCenterEntities oEntity = ConnectionEntities.getTrainingCenter(mAcount);

            return(oEntity.SP_Delete_Candidate(int.Parse("" + id)) > 0?true:false);
        }
示例#12
0
        public override bool DeleteElement(Employee oT)
        {
            TrainingCenterEntities oEntity = ConnectionEntities.getTrainingCenter(mAcount);

            return(oEntity.SP_Delete_Employee(oT.Id) > 0?true:false);
        }
        public override bool UpdateElement(stanfTabPermission o)
        {
            TrainingCenterEntities oEntity = ConnectionEntities.getTrainingCenter(mAcount);

            return(oEntity.SP_UPDATE_TABPERMISSION(o.TabPermissionId, o.LastModifiedByUserId, o.IsList, o.IsAdd, o.IsEdit, o.IsDelete, o.IsReport) > 0);
        }
        public override bool InsertElement(stanfTabPermission o)
        {
            TrainingCenterEntities oEntity = ConnectionEntities.getTrainingCenter(mAcount);

            return(oEntity.SP_INSERT_TABPERMISSION(o.PermissionId, o.RoleId, o.UserId, o.CreatedByUserId, o.LastModifiedByUserId, o.PermissionList) > 0);
        }