コード例 #1
0
 public SchoolEditForm()
 {
     InitializeComponent();
     dataLayoutControl = myDataLayoutControl;
     bll      = new SchoolBll(myDataLayoutControl);
     cardType = CardType.School;
     EventsLoad();
 }
コード例 #2
0
        public ActionResult Login(string account, string pwd)
        {
            bool             success          = false;
            string           msg              = "";
            SchoolBll        schoolBll        = new SchoolBll();
            SchoolTeacherBll schoolTeacherBll = new SchoolTeacherBll();

            DtoSchoolTeacher schoolTeacher = schoolTeacherBll.Login(account, pwd);
            DtoSchool        school        = null;

            if (schoolTeacher != null && schoolTeacher.Yoh_Status == (int)StatusEnum.效)
            {
                school = schoolBll.GetSchoolDto(schoolTeacher.Yoh_SchoolId);
                if (schoolTeacher != null && school != null && school.Bsl_Status != (int)SchoolStatusEnum.合同到期 && school.Bsl_IsValid)
                {
                    CookieUserModel user = new CookieUserModel();
                    user.Teacher = schoolTeacher.ConvertTo <CookieTeacher>();;
                    user.School  = school.ConvertTo <CookieSchool>();
                    LoginCookieHelper.SetCurrentUser(user);
                    success = true;
                    msg     = "登录成功";
                }
                else
                {
                    msg = "当前校区不允许登录";
                }
            }
            else
            {
                msg = "登录失败";
            }
            if (!success)
            {
                LoginCookieHelper.SetCurrentUser(null);
            }

            return(Json(new JsonSimpleResponse()
            {
                State = success, ErrorMsg = msg
            }));
        }
コード例 #3
0
        public ActionResult GetSchool(int pageNumber, int pageSize, string name)
        {
            SchoolBll       schoolBll = new SchoolBll();
            PagingObject    paging    = new PagingObject(pageNumber, pageSize);
            var             schools   = schoolBll.GetSchoolByIdOrName(paging, name);
            SelectPageModel model     = new SelectPageModel();
            List <Dictionary <string, object> > listDic = new List <Dictionary <string, object> >();

            foreach (var item in schools)
            {
                var option = new Dictionary <string, object>()
                {
                    { "name", item.value },
                    { "id", item.key }
                };
                listDic.Add(option);
            }
            model.list     = listDic;
            model.totalRow = paging.TotalCount;
            return(Json(new { Data = model }));
            //var schools = schoolBll.GetSchoolByIdOrName(paging,perName).ToDictionary(k => k.key, v => v.value);
            //var result = OptionFactory.CreateOptions(schools);
            //return Select2(result, JsonRequestBehavior.AllowGet);
        }
コード例 #4
0
 public SchoolListForm()
 {
     InitializeComponent();
     bll = new SchoolBll();
 }