public ActionResult Add(ClassManageModel model)
        {
            ClassManageInfo classManageInfo = new ClassManageInfo();

            if (ModelState.IsValid)
            {
                classManageInfo.ClassID   = model.ClassID;
                classManageInfo.ClassName = model.ClassName;

                ClassManages.CreateClassManage(classManageInfo);
                return(PromptView("班级新加成功"));
            }
            return(View(model));
        }
        public ActionResult Edit(int id = -1)
        {
            ClassManageInfo classManageInfo = ClassManages.GetClassManageById(id);

            if (classManageInfo == null)
            {
                return(PromptView("班级不存在"));
            }

            ClassManageModel model = new ClassManageModel();

            model.ClassID   = classManageInfo.ClassID;
            model.ClassName = classManageInfo.ClassName;

            //Load();

            return(View(model));
        }
Beispiel #3
0
        /// <summary>
        ///
        /// </summary>
        public static ClassManageInfo[] GetClassManageList()
        {
            DataTable dt = BonSite.Core.BSData.RDBS.GetClassManageList();

            ClassManageInfo[] classManageList = new ClassManageInfo[dt.Rows.Count];

            int index = 0;

            foreach (DataRow row in dt.Rows)
            {
                ClassManageInfo classManageInfo = new ClassManageInfo();
                classManageInfo.ClassID   = TypeHelper.ObjectToInt(row["ClassID"]);
                classManageInfo.ClassName = row["ClassName"].ToString();
                classManageList[index]    = classManageInfo;
                index++;
            }
            return(classManageList);
        }
        public ActionResult Edit(ClassManageModel model, int id = -1)
        {
            ClassManageInfo classManageInfo = ClassManages.GetClassManageById(id);

            if (classManageInfo == null)
            {
                return(PromptView("班级不存在"));
            }

            if (ModelState.IsValid)
            {
                classManageInfo.ClassName = model.ClassName;
                classManageInfo.ClassID   = id;

                ClassManages.UpdateClassManage(classManageInfo);
                AddAdminOperateLog("修改班级", "修改班级,班级ID为:" + id);
                return(PromptView("班级修改成功"));
            }

            // Load();
            return(View(model));
        }
Beispiel #5
0
 /// <summary>
 /// 更新班级
 /// </summary>
 public static void UpdateClassManage(ClassManageInfo classManageInfo)
 {
     BonSite.Data.ClassManages.UpdateClassManage(classManageInfo);
     //BonSite.Core.BSCache.Remove(CacheKeys.SITE_FRIENDLINK_LIST);
 }
Beispiel #6
0
 /// <summary>
 /// 更新班级
 /// </summary>
 public static void UpdateClassManage(ClassManageInfo classManageInfo)
 {
     BonSite.Core.BSData.RDBS.UpdateClassManage(classManageInfo);
 }