Exemple #1
0
        public void update()
        {
            ClubBLL bll   = new ClubBLL();
            var     model = new Model.club();

            model.id   = 2;
            model.name = "123321";
            model.logo = "123321";
            bll.Update(model, new[] { "id", "name", "logo" });
            JsonSerializer serializer = new JsonSerializer();

            Console.WriteLine(JsonConvert.SerializeObject(model));
        }
Exemple #2
0
        public void add()
        {
            ClubBLL bll   = new ClubBLL();
            var     model = new Model.club();

            model.date  = DateTime.Now;
            model.logo  = "d";
            model.name  = "d";
            model.state = 1;
            bll.Add(model);
            JsonSerializer serializer = new JsonSerializer();

            Console.WriteLine(JsonConvert.SerializeObject(model));
        }
Exemple #3
0
        public void Allow(int id)
        {
            Update(id, 1);
            //社团表中加入新的社团
            var bll       = new BLL.newClub();
            var model     = bll.GetModel(p => p.id == id);
            var clubBLL   = new BLL.ClubBLL();
            var clubModel = new Model.club();

            clubModel.date = DateTime.Now;
            clubModel.logo = model.logo;
            clubModel.name = model.name;
            clubBLL.Add(clubModel);
            //申请人设置为管理员
            var manager = new Model.clubmanager();

            manager.cludID = clubModel.id;
            manager.userID = new BLL.newClub().GetModel(p => p.id == id).userID;
            new BLL.clubManager().Add(manager);
            Response.Redirect("/teacher/NewClub/");
        }