public void Update(ClassStudentMapEntity entity)
        {
            entity.UpdateTime = DateTime.Now;

            IDbSession session = SessionFactory.CreateSession();

            try
            {
                session.BeginTrans();
                Repository.Update <ClassStudentMapEntity>(session.Connection, entity, session.Transaction);
                session.Commit();
            }
            catch (System.Exception)
            {
                session.Rollback();
                throw;
            }
            finally
            {
                session.Dispose();
            }
        }
Example #2
0
        public string PutClassStudentMap(ClassStudentMapEntity entity)
        {
            try
            {
                if (entity == null)
                {
                    return("error");
                }

                ClassStudentMapManager manager = new ClassStudentMapManager();

                entity.CreateTime = DateTime.Now;
                entity.CreateTime = DateTime.Now;

                manager.Update(entity);

                return("success");
            }
            catch (Exception e)
            {
                return(e.ToString());
            }
        }
Example #3
0
        public string DeleteClassStudentMap(int id)
        {
            try
            {
                ClassStudentMapManager manager = new ClassStudentMapManager();

                ClassStudentMapEntity entity = manager.GetClassStudentMapByID(id);
                if (entity != null)
                {
                    entity.Valid      = "F";
                    entity.CreateTime = DateTime.Now;
                    entity.CreateTime = DateTime.Now;

                    manager.Update(entity);
                }

                return("success");
            }
            catch (Exception e)
            {
                return(e.ToString());
            }
        }