Beispiel #1
0
        private void MyBind()
        {
            M_UserInfo mu = UserBll.GetLogin();

            IsNotLogin        = mu.UserID < 1;
            login_div.Visible = IsNotLogin;
            M_Temp tempMod = tempBll.SelModelByUid(mu.UserID, 10);

            CartQids = tempMod == null ? "" : tempMod.Str1;
            int       count = 0;
            DataTable dt    = SelPage(out count);

            if (dt.Rows.Count < 1)
            {
                empty_div.Visible = true;
            }
            else
            {
                string hrefTlp = "<a href='javascript:;' onclick='LoadByAjax(\"@query\",@page);' title=''>@text</a>";
                RPT.DataSource = dt;
                RPT.DataBind();
                BindKonwsDT(dt);
                Page_Lit.Text      = PageCommon.CreatePageHtml(PageHelper.GetPageCount(count, psize), PageCommon.GetCPage(), 10, hrefTlp);
                count_sp.InnerText = count.ToString();
            }
        }
Beispiel #2
0
        public ActionResult PaperCenter_Submit()
        {
            M_Temp            tempMod  = tempBll.SelModelByUid(mu.UserID, 10);
            M_Exam_Sys_Papers paperMod = new M_Exam_Sys_Papers();

            if (string.IsNullOrEmpty(tempMod.Str1))
            {
                function.WriteErrMsg("试题蓝为空,无法生成试卷!"); return(null);
            }
            paperMod.p_name      = Request.Form["title_t"];
            paperMod.p_class     = 0;
            paperMod.p_Remark    = Request.Form["desc_t"];
            paperMod.p_UseTime   = DataConverter.CLng(Request.Form["usetime_t"]);
            paperMod.p_BeginTime = DateTime.Now;
            paperMod.p_endTime   = DateTime.Now.AddYears(1);
            paperMod.p_Style     = 2;
            paperMod.UserID      = mu.UserID;
            paperMod.QIDS        = tempMod.Str1;
            paperMod.QuestList   = Request.Form["qinfo_hid"];
            paperMod.Price       = DataConverter.CLng(Request.Form["price_t"]);
            int newid = paperBll.Insert(paperMod);

            //-------------------------
            tempMod.Str1 = "";
            tempBll.UpdateByID(tempMod);
            ViewBag.pname = paperMod.p_name;
            ViewBag.newid = newid;
            ViewBag.step  = 2;
            return(View("PaperCenter"));
        }
        private void MyBind()
        {
            M_Temp tempMod = tempBll.SelReturnModel(Mid);

            FName_T.Text   = tempMod.Str1;
            Content_T.Text = tempMod.Str2;
            txtCode.Text   = "<script id='zlchat' data-option='{\"theme\":\"def\",\"id\":\"" + tempMod.ID + "\"}' src='/JS/Plugs/Chat/chat_def.js'></script>";
        }
Beispiel #4
0
        private M_Temp GetCartByUid(int uid, int usetype = 10)
        {
            M_Temp tempMod = tempBll.SelModelByUid(uid, usetype);

            if (tempMod == null)
            {
                tempMod = new M_Temp(); tempMod.UserID = uid; tempMod.UseType = usetype;
            }
            return(tempMod);
        }
Beispiel #5
0
 private void AddORUpdate(M_Temp model)
 {
     if (model.ID > 0)
     {
         tempBll.UpdateByID(model);
     }
     else
     {
         tempBll.Insert(model);
     }
 }
Beispiel #6
0
        public ActionResult PaperCenter()
        {
            M_Temp    tempMod = tempBll.SelModelByUid(mu.UserID, 10);
            DataTable questDt = questBll.SelByIDSForExam(tempMod.Str1);
            DataTable typeDt  = ansBll.GetTypeDT(questDt);

            ViewBag.title   = DateTime.Now.ToString("yyyy年MM月dd日" + mu.UserName + "的组卷");
            ViewBag.questDt = questDt;
            ViewBag.typeDt  = typeDt;
            return(View());
        }
Beispiel #7
0
        //public void DownFile(string url)
        //{
        //    SafeSC.DownFile(url);
        //}
        //用户可自由变换所属会员组,仅VIP组可访问该页面(前端判断)
        public IActionResult ChangeGroup()
        {
            M_Group gpMod = gpBll.SelReturnModel(mu.GroupID);
            M_Temp  tpMod = tpBll.SelModelByUid(mu.UserID, 13);

            if (gpMod.VIPGroup != 1 && tpMod == null)
            {
                return(WriteErr("你所在的会员组无权使用该功能页"));
            }
            ViewBag.gpMod = gpMod;
            ViewBag.gpdt  = gpBll.Sel();
            return(View());
        }
        public VM_QuestManage(HttpRequestBase Request)
        {
            this.mu = tubll.GetLogin();
            M_Temp tempMod = tempBll.SelModelByUid(mu.UserID, 10);

            if (tempMod == null)
            {
                tempMod = new M_Temp();
            }
            gradeDT    = B_GradeOption.GetGradeList(6, 0);
            verDT      = verBll.Sel();
            QListCount = questBll.GetCountByIDS(tempMod.Str1);
            //function.Script(this, "RenderQList(" + list + ");");
            QuestType_Lit = GetTreeStr(FillQuest(nodeBll.SelectQuesClasses()), 0, "quest");
        }
Beispiel #9
0
        public IActionResult Group_Change()
        {
            M_Temp  tpMod  = tpBll.SelModelByUid(mu.UserID, 13);
            M_Group gpMod  = gpBll.SelReturnModel(mu.GroupID);
            string  action = RequestEx["action_hid"];

            if (gpMod.VIPGroup != 1 && tpMod == null)
            {
                return(WriteErr("你所在的会员组无权使用该功能页", "ChangeGroup"));
            }
            switch (action)
            {
            case "change":
                int gid = Convert.ToInt32(RequestEx["Group_DP"]);
                if (tpMod == null)
                {
                    tpMod         = new M_Temp();
                    tpMod.UserID  = mu.UserID;
                    tpMod.Str1    = mu.GroupID.ToString();
                    tpMod.UseType = 13;
                    tpBll.Insert(tpMod);
                }
                buser.UpdateGroupId(mu.UserID.ToString(), gid);
                return(WriteOK("切换会员组成功", "ChangeGroup"));

            case "recover":
                if (tpMod == null)
                {
                    return(WriteErr("未找到切换前的会员组记录"));
                }
                buser.UpdateGroupId(mu.UserID.ToString(), Convert.ToInt32(tpMod.Str1));
                tpBll.Del(tpMod.ID);
                return(WriteOK("恢复会员组成功", "ChangeGroup"));

            default:
                return(WriteErr("未指定操作"));
            }
        }
        protected void Save_Btn_Click(object sender, EventArgs e)
        {
            M_Temp tempMod = new M_Temp();

            if (Mid > 0)
            {
                tempMod = tempBll.SelReturnModel(Mid);
            }
            tempMod.Str1 = FName_T.Text;
            tempMod.Str2 = Content_T.Text;
            tempMod.Str4 = Request.Form["theme_rad"];
            if (Mid > 0)
            {
                tempBll.UpdateByID(tempMod);
            }
            else
            {
                tempMod.UseType = 12;
                tempMod.Str3    = Guid.NewGuid().ToString();
                tempMod.ID      = tempBll.Insert(tempMod);
            }
            function.WriteSuccessMsg("操作成功", "ServiceCode.aspx?ID=" + tempMod.ID);
        }
Beispiel #11
0
        public void Group_Change()
        {
            M_Temp  tpMod  = tpBll.SelModelByUid(mu.UserID, 13);
            M_Group gpMod  = gpBll.SelReturnModel(mu.GroupID);
            string  action = Request.Form["action_hid"];

            if (gpMod.VIPGroup != 1 && tpMod == null)
            {
                function.WriteErrMsg("你所在的会员组无权使用该功能页", "ChangeGroup"); return;
            }
            switch (action)
            {
            case "change":
                int gid = Convert.ToInt32(Request.Form["Group_DP"]);
                if (tpMod == null)
                {
                    tpMod         = new M_Temp();
                    tpMod.UserID  = mu.UserID;
                    tpMod.Str1    = mu.GroupID.ToString();
                    tpMod.UseType = 13;
                    tpBll.Insert(tpMod);
                }
                buser.UpdateGroupId(mu.UserID.ToString(), gid);
                function.WriteSuccessMsg("切换会员组成功", "ChangeGroup");
                break;

            case "recover":
                if (tpMod == null)
                {
                    function.WriteErrMsg("未找到切换前的会员组记录"); return;
                }
                buser.UpdateGroupId(mu.UserID.ToString(), Convert.ToInt32(tpMod.Str1));
                tpBll.Del(tpMod.ID);
                function.WriteSuccessMsg("恢复会员组成功", "ChangeGroup");
                break;
            }
        }
Beispiel #12
0
        public void MyBind()
        {
            //后期将其分离
            M_OnlineUser user = chatBll.GetLogin();

            if (user != null)
            {
                UserName_L.Text = user.UserName; UserID_Hid.Value = user.UserID;
            }
            if (!string.IsNullOrEmpty(Login))
            {
                function.Script(this, "VisitorToLogin('用户" + DateTime.Now.ToString("yyyyMMddHHmmss") + "','" + Request["idflag"] + "');");
            }
            else if (user == null)
            {
                function.Script(this, "ShowModal();");
            }

            if (!string.IsNullOrEmpty(UserFlag))
            {
                M_OnlineUser mu = chatBll.GetModelByUid(UserFlag);
                //function.WriteErrMsg(mu.UserID+":"+mu.UserName);
                function.Script(this, "ChangeTalker('" + mu.UserID + "','" + mu.UserName + "','" + mu.UserFace + "');");
            }
            else if (UserID > 0)
            {
                M_UserInfo mu = buser.GetSelect(UserID);
                function.Script(this, "ChangeTalker('" + mu.UserID + "','" + mu.UserName + "','" + mu.UserFace + "');");
            }
            if (buser.CheckLogin())
            {
                DataTable dt = friendBll.SelMyFriend(Convert.ToInt32(user.UserID));
                Friend_RPT.DataSource = dt;
                Friend_RPT.DataBind();
                if (dt == null)
                {
                    Friend_Num.Text = "0";
                }
                else
                {
                    Friend_Num.Text = dt.Rows.Count.ToString();
                    function.Script(this, "InitUserList(" + JsonHelper.JsonSerialDataTable(dt) + ");");
                }
            }
            //用于显示欢迎信息
            if (CodeID > 0)
            {
                M_Temp tempMod = tempBll.SelReturnModel(CodeID);
                if (tempMod != null && tempMod.UseType == 12)
                {
                    Wel_Hid.Value = tempMod.Str2;
                    function.Script(this, "ShowWel('" + tempMod.Str1 + "');");
                }
            }
            //-----------------------------------
            //if (badmin.CheckLogin())
            //{
            //    visitor_ul.Visible = true;
            //    List<M_OnlineUser> list = chatBll.GetOnlineVisitor();
            //    Y_RPT.DataSource = list;
            //    Y_RPT.DataBind();
            //    Unum_L.Text = list.Count.ToString();
            //    M_AdminInfo adminmod=badmin.GetAdminLogin();
            //    DataTable dt = SeatBll.SelBySUid(adminmod.AdminId);
            //    function.Script(this, "SetMyInfo('" + adminmod.AdminId + "','" + adminmod.AdminName + "','" + dt.Rows[0]["S_ImgUrl"] + "');BeginInit();");
            //}
            //else
            {
                //DataTable dt = SeatBll.Select_All();
                //DataTable dt = UserDT;
                //dt.DefaultView.RowFilter = "Status=0";
                //dt = dt.DefaultView.ToTable();
                B_User_Plat upBll = new B_User_Plat();
                DataTable   dt    = upBll.SelByCompany(B_User_Plat.GetLogin().CompID);
                Customs_RPT.DataSource = dt;
                Customs_RPT.DataBind();
            }
            if (user != null)
            {
                function.Script(this, "SetMyInfo('" + user.UserID + "','" + user.UserName + "','" + user.UserFace + "');BeginInit();");
            }
        }
Beispiel #13
0
        public ActionResult QuestAPI()
        {
            string action = Request["action"] ?? "";
            int    qid    = DataConverter.CLng(Request["qid"]);
            int    qtype  = DataConverter.CLng(Request["qtype"]);
            string qids   = (Request["qids"] ?? "").Trim(',');

            while (qids.Contains(",,"))
            {
                qids.Replace(",,", ",");
            }
            int    result  = Failed;
            M_Temp tempMod = new M_Temp();

            switch (action)
            {
            case "cart_add":    //试题篮
                tempMod      = GetCartByUid(mu.UserID);
                tempMod.Str1 = StrHelper.AddToIDS(tempMod.Str1, qid.ToString());
                AddORUpdate(tempMod);
                result = Success;
                break;

            case "cart_adds":
                if (string.IsNullOrEmpty(qids))
                {
                    break;
                }
                tempMod = GetCartByUid(mu.UserID);
                foreach (string q in qids.Split(','))
                {
                    if (string.IsNullOrEmpty(q))
                    {
                        continue;
                    }
                    tempMod.Str1 = StrHelper.AddToIDS(tempMod.Str1, q);
                }
                AddORUpdate(tempMod);
                result = Success;
                break;

            case "cart_remove":
                tempMod      = GetCartByUid(mu.UserID);
                tempMod.Str1 = StrHelper.RemoveToIDS(tempMod.Str1, qid.ToString());
                AddORUpdate(tempMod);
                result = Success;
                break;

            case "cart_clear":
                tempMod      = GetCartByUid(mu.UserID);
                tempMod.Str1 = "";
                AddORUpdate(tempMod);
                result = Success;
                break;

            case "collect_add":    //试题收藏与移除
                break;

            case "collect_remove":
                break;
            }
            return(Content(result.ToString()));
        }