コード例 #1
0
        public List <StudentObjects> GetAll()
        {
            List <StudentObjects> lst = new List <StudentObjects>();
            var db   = new eTrainingScheduleEntities();
            var list = db.sp_tbl_S07_Student_GetAll();

            foreach (var item in list)
            {
                if (item.Deleted == true)
                {
                    continue;
                }
                StudentObjects ob = new StudentObjects();
                ob.StudetId  = item.StudetId;
                ob.FullName  = item.FullName;
                ob.CreatDate = (DateTime)item.CreateDate;
                ob.Email     = new SecurityConexts().DecryptInfo(item.Email);
                ob.Mobile    = new SecurityConexts().DecryptInfo(item.Mobile);
                ob.Address   = item.Address;
                ob.Status    = item.Status.Value;
                ob.Deleted   = item.Deleted;
                lst.Add(ob);
            }
            return(lst);
        }
コード例 #2
0
        public bool Update(StudentObjects ob)
        {
            var db   = new eTrainingScheduleEntities();
            var data = db.sp_tbl_S07_Student_UPDATE(ob.StudetId, ob.FullName, ob.Email, ob.Mobile, ob.Address, ob.Status, ob.Deleted);

            return(true);
        }
コード例 #3
0
        public bool Insert(StudentObjects ob)
        {
            ob.StudetId = Guid.NewGuid();
            var db   = new eTrainingScheduleEntities();
            var data = db.sp_tbl_S07_Student_INSERT(ob.StudetId, ob.FullName, ob.Email, ob.Mobile, ob.Address, ob.Status, ob.Deleted);

            return(true);
        }
コード例 #4
0
        public StudentObjects GetByStudetId(Guid ID)
        {
            var db   = new eTrainingScheduleEntities();
            var list = db.sp_tbl_S07_Student_GetByStudetId(ID);

            foreach (var item in list)
            {
                StudentObjects obj = new StudentObjects();
                obj.StudetId = item.StudetId; obj.FullName = item.FullName; obj.Email = item.Email; obj.Mobile = item.Mobile; obj.Address = item.Address; obj.Status = item.Status; obj.Deleted = item.Deleted;
                return(obj);
            }
            return(null);
        }
コード例 #5
0
        public List <StudentObjects> GetAll()
        {
            List <StudentObjects> lst = new List <StudentObjects>();
            var db   = new eTrainingScheduleEntities();
            var list = db.sp_tbl_S07_Student_GetAll();

            foreach (var item in list)
            {
                if (item.Deleted == true)
                {
                    continue;
                }
                StudentObjects ob = new StudentObjects();
                ob.StudetId = item.StudetId; ob.FullName = item.FullName; ob.Email = item.Email; ob.Mobile = item.Mobile; ob.Address = item.Address; ob.Status = item.Status; ob.Deleted = item.Deleted;
                lst.Add(ob);
            }
            return(lst);
        }
コード例 #6
0
        public ActionResult Edit(StudentObjects objS)
        {
            objS.Deleted = false;
            if (!String.IsNullOrEmpty(objS.Email))
            {
                objS.Email = new SecurityConexts().EncryptInfo(objS.Email);
            }
            if (!String.IsNullOrEmpty(objS.Mobile))
            {
                objS.Mobile = new SecurityConexts().EncryptInfo(objS.Mobile);
            }
            var b = new StudentBCL().Update(objS);

            if (b)
            {
                return(RedirectToAction("Index", "Student"));
            }
            else
            {
                ModelState.AddModelError("", "Edit that bai");
            }

            return(View());
        }
コード例 #7
0
 public bool Insert(StudentObjects ob)
 {
     return(new StudentDao().Insert(ob));
 }
コード例 #8
0
 public bool Update(StudentObjects ob)
 {
     return(new StudentDao().Update(ob));
 }