Ejemplo n.º 1
0
        public ActionResult Login1()
        {
            //return Content(this.Encrypt("123456", "nltswx05nltswx05", "nltswx05nltswx05"));
            if (Request["userName"] == null || Request["pwd"] == null || Request["code"] == null)
            {
                return Json(new { Result = 6 });
            }

            string userName = HttpUtility.UrlDecode(Request["userName"]);
            string pwd = HttpUtility.UrlDecode(Request["pwd"]);
            string code = Request["code"];

            string checkCode = Dianda.Common.StringSecurity.MD5Lib.Encrypt(userName + "shlllnet" + DateTime.Now.ToString("yyyyMMddHH"));
            if (!code.Equals(checkCode, StringComparison.CurrentCultureIgnoreCase))
            {
                return Json(new { Result = 5 });
            }

            string aesKey = "nltswx05nltswx05";
            string aesIV = "nltswx05nltswx05";
            string decPwd = this.Decrypt(pwd, aesKey, aesIV).Replace("\0", "");

            if (string.IsNullOrEmpty(decPwd))
            {
                return Json(new { Result = 4 });
            }

            if (decPwd.Length > 11)
                decPwd = decPwd.Substring(0, 11);

            EntranceLoginBLL bll = new EntranceLoginBLL();

            int userId;
            if (bll.Login(userName, decPwd + "%", out userId))
            {
                Member_BaseInfo member = new Member_BaseInfoBLL().GetListModel("AccountId=" + userId).FirstOrDefault();
                if (member == null)
                {
                    return Json(new { Result = 3 });
                }
                else
                {
                    if (string.IsNullOrEmpty(member.RealName) || string.IsNullOrEmpty(member.TeacherNo))
                    {
                        return Json(new { Result = 3 });
                    }
                    else
                    {
                        var DataModel = new { Name = member.RealName, TeacherNumber = member.TeacherNo };
                        return Json(new { Result = 1, DataModel });
                    }
                }
            }
            else
            {
                return Json(new { Result = 2 });
            }
        }
Ejemplo n.º 2
0
        public bool IsCanRegister(int ClassId, bool Issingle, int MemberId, int Type)
        {
            int ParentOrganId = 1;
            int oType = 1;
            int partitionId = Code.SiteCache.Instance.LoginInfo.PartitionId;
            int UserId = MemberId;
            Member_AccountBLL member_AccountBLL = new Member_AccountBLL();
            Member_Account ma = member_AccountBLL.GetModel(UserId, "");
            int OrganId = 1;
            if (Issingle)
            {
                ParentOrganId = (int)organ_DetailBLL.GetModel(Code.SiteCache.Instance.OrganId).ParentId;
                oType = (int)organ_DetailBLL.GetModel(Code.SiteCache.Instance.OrganId).OType;
                OrganId = Code.SiteCache.Instance.OrganId;
            }
            else
            {
                ParentOrganId = (int)organ_DetailBLL.GetModel(Code.SiteCache.Instance.ManageOrganId).ParentId;
                oType = (int)organ_DetailBLL.GetModel(Code.SiteCache.Instance.ManageOrganId).OType;
                OrganId = Code.SiteCache.Instance.ManageOrganId;
            }

            Member_BaseInfoBLL member_BaseInfoBLL = new Member_BaseInfoBLL();
            Member_BaseInfo m = member_BaseInfoBLL.GetModelByAccountId(UserId);
            string where = " and td.PartitionId='" + partitionId + "'and cd.PlanId='" + Code.SiteCache.Instance.PlanId + "' and cd.PartitionId='" + partitionId + "' and cd.Id='" + ClassId + "'";

            if (oType == 1)
            {
                where += " and td.OrganId='" + OrganId + "'";
            }
            else if (oType == 2)
            {
                if (m != null)
                {
                    switch (Type)
                    {
                        case 1:
                            where += " and ((css.StudySection in(select StudySection from Member_StudySection where AccountId='" + UserId + "' and Delflag='false')and css.delflag='false' )or cd.StudyLevel=1)";
                            break;
                        case 2:
                            where += " and ((cts.TeachSubject in(select TeachSubject from Member_TeachSubject where AccountId='" + UserId + "' and Delflag='false')and cts.delflag='false' )or cd.Subject=1)";
                            break;
                        case 3:
                            where += " and ((ctg.TeachGrade in(select TeachGrade from Member_TeachGrade where AccountId='" + UserId + "' and Delflag='false')and ctg.delflag='false' )or cd.TeachGrade=1)";
                            break;
                        case 4:
                            where += " and ((ctr.TeachRank in(select WorkRank from Member_WorkRank where AccountId='" + UserId + "' and Delflag='false')and ctr.delflag='false' )or cd.TeachRank=1)";
                            break;
                        case 5:
                            where += " and (CHARINDEX('," + OrganId + ",',','+cd.OrganRange+',')>0 or cd.OrganRange='0')";
                            break;
                    }
                    where += " and (td.OrganId='" + ParentOrganId + "' or td.Range=2)";

                }
                else
                {
                    where += "and 1=2";
                }
            }
            else if (oType == 5)
            {
                if (m != null)
                {
                    switch (Type)
                    {
                        case 1:
                            where += " and ((css.StudySection in(select StudySection from Member_StudySection where AccountId='" + UserId + "' and Delflag='false')and css.delflag='false' )or cd.StudyLevel=1)";
                            break;
                        case 2:
                            where += " and ((cts.TeachSubject in(select TeachSubject from Member_TeachSubject where AccountId='" + UserId + "' and Delflag='false')and cts.delflag='false' )or cd.Subject=1)";
                            break;
                        case 3:
                            where += " and ((ctg.TeachGrade in(select TeachGrade from Member_TeachGrade where AccountId='" + UserId + "' and Delflag='false')and ctg.delflag='false' )or cd.TeachGrade=1)";
                            break;
                        case 4:
                            where += " and ((ctr.TeachRank in(select WorkRank from Member_WorkRank where AccountId='" + UserId + "' and Delflag='false')and ctr.delflag='false' )or cd.TeachRank=1)";
                            break;
                        case 5:
                            where += " and (CHARINDEX('," + ma.OrganId + ",',','+cd.OrganRange+',')>0 or cd.OrganRange='0')";
                            break;
                    }
                    where += " and (td.OrganId='" + OrganId + "' or td.Range=2)";
                }
                else
                {
                    where += "and 1=2";
                }
            }
            else
            {
                where += " and 1=2";
            }
            Traning_DetailBLL traning_DetailBLL = new Traning_DetailBLL();
            int total = 0;
            List<Traning_Detail> tdlist = traning_DetailBLL.GetListHasClass(10, 1, where, "CreateDate desc", out total);
            return total > 0;
        }
Ejemplo n.º 3
0
        public ActionResult CoursemarketVerifyPage(int Id)
        {
            int groupId = Code.SiteCache.Instance.GroupId;//4,学校管理7,普通教师
            ViewData["groupId"] = groupId;
            ViewData["mId"] = Id;
            ViewBag.Title = "报名审核";
            Member_ClassRegisterBLL member_ClassRegisterBLL = new Member_ClassRegisterBLL();
            Member_ClassRegister member_ClassRegister = new Member_ClassRegister();
            member_ClassRegister = member_ClassRegisterBLL.GetModel(Id, "");

            Class_DetailBLL class_DetailBLL = new Class_DetailBLL();
            Class_Detail class_Detail = new Class_Detail();
            class_Detail = class_DetailBLL.GetModel(member_ClassRegister.ClassId);

            Member_AccountBLL member_AccountBLL = new Member_AccountBLL();
            ViewBag.AcountInfo = member_AccountBLL.GetModel(member_ClassRegister.AccountId, "");

            Member_BaseInfoBLL member_BaseInfoBLL = new Member_BaseInfoBLL();
            ViewBag.BaseInfo = member_BaseInfoBLL.GetModelByAccountId(member_ClassRegister.AccountId);

            Member_ClassRegisterApplicationBLL member_ClassRegisterApplicationBLL = new Member_ClassRegisterApplicationBLL();
            ViewBag.CApplicationList = member_ClassRegisterApplicationBLL.GetList(" Delflag='false' and ClassRegisterId='" + member_ClassRegister.Id + "'", "CreateDate");
            return View(class_Detail);
        }
Ejemplo n.º 4
0
        public ActionResult DetailInformation(int Id)
        {
            ViewBag.Title = "报名详细信息";
            Member_ClassRegisterBLL member_ClassRegisterBLL = new Member_ClassRegisterBLL();
            Member_ClassRegister member_ClassRegister = new Member_ClassRegister();
            member_ClassRegister = member_ClassRegisterBLL.GetModel(Id, "");

            Class_DetailBLL class_DetailBLL = new Class_DetailBLL();
            Class_Detail class_Detail = new Class_Detail();
            class_Detail = class_DetailBLL.GetModel(member_ClassRegister.ClassId);

            Member_AccountBLL member_AccountBLL = new Member_AccountBLL();
            ViewBag.AcountInfo = member_AccountBLL.GetModel(member_ClassRegister.AccountId, "");

            Member_BaseInfoBLL member_BaseInfoBLL = new Member_BaseInfoBLL();
            ViewBag.BaseInfo = member_BaseInfoBLL.GetModelByAccountId(member_ClassRegister.AccountId);

            Member_ClassRegisterApplicationBLL member_ClassRegisterApplicationBLL = new Member_ClassRegisterApplicationBLL();
            ViewBag.CApplicationList = member_ClassRegisterApplicationBLL.GetList(" Delflag='false' and ClassRegisterId='" + member_ClassRegister.Id + "'", "CreateDate");
            return View(class_Detail);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 教师--课程超市列表
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="organId"></param>
        /// <param name="field"></param>
        /// <param name="searchTitle"></param>
        /// <returns></returns>
        //[UrlDecrypt]
        public ActionResult CoursemarketSingleList(int? pageIndex, int? organId, int? field, string searchTitle)
        {
            ViewBag.Title = "课程超市";

            int i = TypeConverter.ObjectToInt(pageIndex, 1);
            int groupId = Code.SiteCache.Instance.GroupId;//4,学校管理7,普通教师
            Organ_DetailBLL organ_DetailBLL = new Organ_DetailBLL();
            int CountyOrganId = 0;

            int oType = 1;
            if (groupId == 7)
            {
                oType = (int)organ_DetailBLL.GetModel(Code.SiteCache.Instance.OrganId).OType;
                CountyOrganId = (int)organ_DetailBLL.GetModel(Code.SiteCache.Instance.OrganId).ParentId;
            }
            else if (groupId == 2 || groupId == 3 || groupId == 4)
            {
                oType = (int)organ_DetailBLL.GetModel(Code.SiteCache.Instance.ManageOrganId).OType;
                if (groupId == 4)
                    CountyOrganId = (int)organ_DetailBLL.GetModel(Code.SiteCache.Instance.ManageOrganId).ParentId;
                else
                    CountyOrganId = Code.SiteCache.Instance.ManageOrganId;
            }
            ViewBag.OType = oType;
            int partitionId = Code.SiteCache.Instance.LoginInfo.PartitionId;
            Member_BaseInfoBLL member_BaseInfoBLL = new Member_BaseInfoBLL();
            Member_BaseInfo m = member_BaseInfoBLL.GetModelByAccountId(Code.SiteCache.Instance.LoginInfo.UserId);
            string where = " and td.PartitionId='" + partitionId + "'and cd.PlanId='" + Code.SiteCache.Instance.PlanId + "' and cd.PartitionId='" + partitionId + "'";

            if (oType == 1)
            {
                ViewBag.OrganList = organ_DetailBLL.GetListModel(" OType=1 and Delflag='false'");
            }
            else if (oType == 2 || oType == 5)
            {
                ViewBag.OrganList = organ_DetailBLL.GetListModel(" OType=5 and Delflag='false'");
            }
            else
            {
                where += " and 1=2";
            }

            if (m != null)
            {
                where += " and (td.OrganId='" + CountyOrganId + "' or td.Range=2)";
            }
            else
            {
                where += " and 1=2";
            }

            if (organId != null && organId > 0)
            {
                where += " and td.OrganId='" + organId + "' ";
            }
            else { organId = -1; }
            if (!string.IsNullOrEmpty(searchTitle))
            { where += " and td.Title like'%" + searchTitle.Replace("'", "''") + "%' "; }
            string where2 = where;
            if (field != null && field > 0)
            { where += " and td.TraingField='" + field + "' "; }
            Traning_DetailBLL traning_DetailBLL = new Traning_DetailBLL();
            int total = 0;
            List<Traning_Detail> tdlist = traning_DetailBLL.GetListHasClass(10, i, where, "CreateDate desc", out total);

            ViewData["searchTitle"] = string.IsNullOrEmpty(searchTitle) ? "" : searchTitle;
            ViewData["organId"] = organId;
            ViewData["field"] = field;
            ViewData["partitionId"] = partitionId;
            ViewData["groupId"] = groupId;
            ViewBag.pageIndex = i;
            ViewBag.totalPage = total;

            Traning_FieldBLL traning_FieldBLL = new Traning_FieldBLL();

            List<Traning_Field> traning_FieldList = traning_FieldBLL.GetList(" Delflag='false' and display='1' and Id<>3", " Sort");
            ViewBag.FieldList = traning_FieldList;
            List<Traning_Detail> tdlistall = traning_DetailBLL.GetListHasClass(-1, -1, where2, "CreateDate desc", out total);
            List<int> list = new List<int>(traning_FieldList.Count);
            int sum = 0;
            foreach (Traning_Field tf in traning_FieldList)
            {
                int c = tdlistall.Where(a => a.TraingField == tf.Id).Count();
                list.Add(c);
                sum += c;
            }

            ViewBag.Sum = sum;
            ViewBag.FCount = list;
            return View(tdlist);
        }