Пример #1
0
        //public ViewNews()
        //{
        //    this.checkFunID = false;
        //    this.checkUserStaus = false;
        //    this.checkSchoolLevelAdminUser = false;
        //}
        //private static String tokenValidateUrl = ConfigurationManager.AppSettings["ApiServerUrl"].ToString();
        protected void Page_Load(object sender, EventArgs e)
        {
            String encNewsId = "";
            //String userAgent = "";
            //if (Request.Headers["user-agent"] != null)
            //{
            //    userAgent = Request.Headers["user-agent"].ToString();
            //}
            int newsId = 0;

            try
            {
                encNewsId = MyRequest.GetString("id");
                newsId    = Int32.Parse(DESEncrypt.Decrypt(encNewsId));
            }
            catch (Exception ex)
            {
                Response.Redirect("/home/news/template/news_error.html");
            }

            if (newsId > 0)
            {
                ShowNews(newsId);
            }
        }
        protected string UpdateTopicState()
        {
            JsonData data = new JsonData();
            string   id   = MyRequest.GetString("ID");

            string msg = "";

            try
            {
                var     bll  = new BLL.CCOM.Topic();
                var     m    = bll.GetModel("Topic_id=" + id);
                Boolean isOn = m.Selected_state == true;
                m.Selected_state = isOn ^ true;
                if (bll.Update(m) == false)
                {
                    msg = "修改发生异常!";
                }
            }
            catch
            {
                msg = "修改发生异常!";
            }

            if (msg == "")
            {
                data["msg"]  = "修改成功";
                data["code"] = 1;
            }
            else
            {
                data["msg"]  = msg;
                data["code"] = 0;
            }
            return(data.ToJson());
        }
Пример #3
0
        protected void BindRpt()
        {
            if (uo_id.Equals(""))
            {
                this.uo_id = this.ddlOrgan.SelectedValue;
            }
            if (provence.Equals(""))
            {
                this.provence = this.ddlprovence.SelectedValue;
            }
            else
            {
                if (!uo_id.Equals("-1"))
                {
                    this.ddlOrgan.SelectedValue = uo_id.ToString();
                }

                if (!provence.Equals("-1"))
                {
                    this.ddlprovence.SelectedValue = provence.ToString();
                }
            }
            string _order = MyRequest.GetString("sort").Replace(",", " ");

            if (_order == "" || Tools.CheckParams(_order))
            {
                _order = " User_id asc";
            }
            RptBind(CombSqlTxt(this.uo_id, this.provence, this.keywords), _order);
        }
        protected string DeleteWeek()
        {
            JsonData data = new JsonData();
            string   id   = MyRequest.GetString("ID");
            string   msg  = "";

            try
            {
                BLL.CCOM.Teach_week bll = new BLL.CCOM.Teach_week();
                bll.Delete(Int32.Parse(id));
            }
            catch
            {
                msg = "删除发生异常!";
            }

            if (msg == "")
            {
                data["msg"]  = "删除成功";
                data["code"] = 1;
            }
            else
            {
                data["msg"]  = msg;
                data["code"] = 0;
            }
            return(data.ToJson());
        }
Пример #5
0
        protected void bindall()
        {
            BLL.CCOM.Agency bll = new  BLL.CCOM.Agency();

            this.ddlSelectUD.DataSource     = GetOrgList_DataSet(false);
            this.ddlSelectUD.DataTextField  = "Agency_name";
            this.ddlSelectUD.DataValueField = "Agency_id";
            this.ddlSelectUD.DataBind();
            //List<Model.admin.Universities_Organization> list = GetAdminUserOrg_List(false);

            if (MyRequest.GetString("selectid") != "")
            {
                this.ddlSelectUD.SelectedValue = MyRequest.GetString("selectid");
            }
            else if (MyRequest.GetString("keywords") != "")
            {
                if (Tools.CheckParams(MyRequest.GetString("keywords")) == false)
                {
                    List <Model.CCOM.Agency> uds = bll.GetModelList(" UO_Name like '%" + MyRequest.GetString("keywords").ToString() + "%' ");
                    if (uds.Count > 0)
                    {
                        this.ddlSelectUD.SelectedValue = uds[0].Agency_id.ToString();
                    }
                }
            }
        }
Пример #6
0
        //删除
        protected void lbtSingleDelete_Click(object sender, EventArgs e)
        {
            BLL.CCOM.Reply_group bll = new BLL.CCOM.Reply_group();
            var lbtn = sender as LinkButton;

            if (lbtn != null)
            {
                var  id     = Int32.Parse(DESEncrypt.Decrypt(lbtn.ToolTip.ToString()));
                bool result = true;
                try
                {
                    result = bll.Delete(id);
                }
                catch
                {
                    result = false;
                }
                string keywords = this.keywords;
                int    page     = MyRequest.GetQueryInt("page", 1);
                if (result == true)
                {
                    JscriptMsg("删除成功!", Utils.CombUrlTxt("ExamList.aspx", "fun_id={0}&keywords={1}&sort={2}&page={3}",
                                                         this.fun_id, this.keywords, MyRequest.GetString("sort"), "__id__"), "Success");
                }
                else
                {
                    JscriptMsg("删除失败!", Utils.CombUrlTxt("ExamList.aspx", "fun_id={0}&keywords={1}&sort={2}&page={3}",
                                                         this.fun_id, this.keywords, MyRequest.GetString("sort"), "__id__"), "Error");
                }
            }
        }
Пример #7
0
        //将Page_Load里的处理逻辑挪到此方法中,客户端种完js后再由前台调用此方法,通过隐藏域传token
        protected void PushRedirect(object sender, EventArgs e)
        {
            String pushId    = "";
            Int64  userid    = 0;
            String token     = "";
            String userAgent = "";

            if (Request.Headers["user-agent"] != null)
            {
                userAgent = Request.Headers["user-agent"].ToString();
            }
            pushId = MyRequest.GetString("id");
            try
            {
                pushId = DESEncrypt.Decrypt(pushId);
            }
            catch
            {
                Response.Redirect("/home/push/template/push_error.html");
            }
            try
            {
                if (IsAdminLogin())
                {
                    userid = GetAdminInfo_CCOM().User_id;
                }
            }
            catch (Exception ex)
            {
                Response.Redirect("/home/push/template/push_error.html");
            }

            ShowWebPush(userid, pushId);
        }
Пример #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                ListItem list1 = new ListItem("行政机构", "0");
                ListItem list2 = new ListItem("部", "1");
                ListItem list3 = new ListItem("系", "2");
                ListItem list4 = new ListItem("专业", "3");
                //this.DropDownList1.Items.Add(list1);
                //this.DropDownList1.Items.Add(list2);
                //this.DropDownList1.Items.Add(list3);
                //this.DropDownList1.Items.Add(list4);

                Model.CCOM.Agency model = new BLL.CCOM.Agency().GetModel(1);
                //this.hiduo_id.Value = model.Agency_id.ToString();

                //this.ddlAddParentID.DataSource = GetOrgList_DataSet(false);
                //this.ddlAddParentID.DataTextField = "Agency_name";
                //this.ddlAddParentID.DataValueField = "Agency_id";
                //this.ddlAddParentID.DataBind();

                try
                {
                    UD_PID = Utils.StrToInt(DESEncrypt.Decrypt(MyRequest.GetString("selectid")), 0);
                }
                catch { }
                //this.ddlAddParentID.SelectedValue = selectOrgan.ToString();
                //}
            }
        }
Пример #9
0
        protected string BatchRemoveStudent()
        {
            JsonData data     = new JsonData();
            string   Group_id = MyRequest.GetString("GroupID");
            string   value    = MyRequest.GetString("StudentID");
            string   msg      = "";

            if (Tools.CheckParams(Group_id + value))
            {
                msg = "传输异常,存在非法字符!";
            }
            else if (value == "")
            {
                msg = "参数异常!";
            }
            else
            {
                try
                {
                    value = Utils.DelLastComma(value);
                    string[] list = value.Split(',');
                    foreach (var tmp in list)
                    {
                        long userid  = long.Parse(tmp);
                        int  groupid = int.Parse(Group_id);
                        BLL.CCOM.Reply_student   bll   = new BLL.CCOM.Reply_student();
                        Model.CCOM.Reply_student model = bll.GetModel(" Group_id=" + groupid + " and User_id=" + userid);
                        if (msg == "")
                        {
                            if (model == null)
                            {
                                continue;
                            }
                            else
                            {
                                if (!bll.Delete(model.Rs_id))
                                {
                                    msg = "移除失败";
                                }
                            }
                        }
                    }
                }
                catch (Exception)
                {
                    msg = "移除发生异常!";
                }
            }
            if (msg == "")
            {
                data["msg"]  = "移除成功";
                data["code"] = 1;
            }
            else
            {
                data["msg"]  = msg;
                data["code"] = 0;
            }
            return(data.ToJson());
        }
Пример #10
0
        private void SendSMSById(HttpContext context)
        {
            long   userid     = long.Parse(DESEncrypt.Decrypt(MyRequest.GetString("userid")));
            string smsContent = "您有一项任务未完成,请加快进度。 任务标题:" + DESEncrypt.Decrypt(MyRequest.GetString("tasktitle"));
            string res        = ManDaoSMS.SendSMS(new BLL.admin.Universities_UserInfo().GetModel(userid).UI_Mobile, smsContent);

            FlushResponse(context, res);
        }
Пример #11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Model.CCOM.User_infomation model = GetAdminInfo_CCOM();
            _id = model.User_id;
            String keywords = MyRequest.GetQueryString("keywords");

            if (!Page.IsPostBack)
            {
                this.keywordTab0 = keywords;
                RoomBind(RoomCombSqlTxt(keywords), " Er_id desc ");
                this.keywordTab1 = keywords;
                JudgeBind(JudgeCombSqlTxt(keywords), " Judge_id desc ");

                this.selectid = MyRequest.GetString("selectid");
                if (this.selectid.Equals(""))
                {
                    this.selectid = "1";
                }
                this.ddlResourceType.SelectedValue = selectid;
                this.ddltype.SelectedValue         = selectid;
                this.ddltype.Enabled = false;
                this.nameText.Text   = "";
                switch (this.selectid)
                {
                case "1":
                    selectIndex = "Province_id";
                    break;

                case "2":
                    selectIndex = "Politics_id";
                    break;

                case "3":
                    selectIndex = "Nationality_id";
                    break;

                case "4":
                    selectIndex = "Nation_id";
                    break;

                case "5":
                    selectIndex = "Mi_id";
                    break;

                case "6":
                    selectIndex = "Degree_id";
                    break;

                case "7":
                    selectIndex = "Ct_id";
                    break;

                default:
                    break;
                }
                RptBind(CombSqlTxt(keywords), " " + selectIndex + " desc ");
            }
        }
        protected void BindRpt()
        {
            string _order = MyRequest.GetString("sort").Replace(",", " ");

            if (_order == "" || Tools.CheckParams(_order))
            {
                _order = " Topic_id asc";
            }
            RptBind(CombSqlTxt(this.keywords), _order);
        }
Пример #13
0
        protected void BindRpt()
        {
            string _order = MyRequest.GetString("sort").Replace(",", " ");

            if (_order == "" || Tools.CheckParams(_order))
            {
                _order = " Group_id asc";
            }
            RptBind("", _order);
        }
Пример #14
0
        protected string AddTeacher()
        {
            JsonData data     = new JsonData();
            string   Group_id = MyRequest.GetString("GroupID");
            string   User_id  = MyRequest.GetString("TeacherID");
            string   msg      = "";

            if (Tools.CheckParams(Group_id + User_id))
            {
                msg = "传输异常,存在非法字符!";
            }
            else
            {
                try
                {
                    long userid  = long.Parse(User_id);
                    long groupid = long.Parse(Group_id);
                    BLL.CCOM.Reply_commission   bll   = new BLL.CCOM.Reply_commission();
                    Model.CCOM.Reply_commission model = bll.GetModel(" Group_id=" + groupid + " and User_id=" + userid);
                    if (msg == "")
                    {
                        if (model != null)
                        {
                            msg = "教师已在该答辩组中";
                        }
                        else
                        {
                            model          = new Model.CCOM.Reply_commission();
                            model.Group_id = groupid;
                            model.User_id  = userid;
                            if (bll.Add(model) <= 0)
                            {
                                msg = "添加失败";
                            }
                        }
                    }
                }
                catch (Exception)
                {
                    msg = "添加发生异常!";
                }
            }
            if (msg == "")
            {
                data["msg"]  = "添加成功";
                data["code"] = 1;
            }
            else
            {
                data["msg"]  = msg;
                data["code"] = 0;
            }
            return(data.ToJson());
        }
        protected string Pass(HttpContext context)
        {
            JsonData data          = new JsonData();
            string   _schooluserid = MyRequest.GetString("schooluserid");
            string   Pass          = MyRequest.GetString("pass");
            string   PassConfirm   = MyRequest.GetString("passconfirm");
            string   msg           = "";

            if (Tools.CheckParams(Pass + PassConfirm))
            {
                msg = "传输异常,存在非法字符!";
            }
            else
            {
                if (Pass.Length < 6 || Pass.Length > 16)
                {
                    msg = "密码长度请控制在6-16位!";
                }
                else if (Pass != PassConfirm)
                {
                    msg = "两次密码输入不一致!";
                }
                else
                {
                    try
                    {
                        BLL.CCOM.User_information bll     = new BLL.CCOM.User_information();
                        long schooluserid                 = long.Parse(DESEncrypt.Decrypt(_schooluserid));
                        Model.CCOM.User_information model = bll.GetModel(schooluserid);
                        model.User_password = DESEncrypt.MD5Encrypt(Pass);
                        bool res = bll.Update(model);
                        if (res == false)
                        {
                            msg = "修改失败,参数发生异常!";
                        }
                    }
                    catch (Exception)
                    {
                        msg = "修改发生异常!";
                    }
                }
            }
            if (msg == "")
            {
                data["msg"]  = "修改成功";
                data["code"] = 1;
            }
            else
            {
                data["msg"]  = msg;
                data["code"] = 0;
            }
            return(data.ToJson());
        }
Пример #16
0
        protected void BindRpt()
        {
            string _order = MyRequest.GetString("sort").Replace(",", " ");

            if (_order == "" || Tools.CheckParams(_order))
            {
                _order = " Topic_id asc";
            }
            Model.CCOM.User_information user_model = GetAdminInfo_CCOM();
            RptBind(" Teacher_id=" + user_model.User_id, _order);
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         string _order = MyRequest.GetString("sort").Replace(",", " ");
         if (_order == "" || Tools.CheckParams(_order))
         {
             _order = " Student_id asc";
         }
         RptBind(_order);
     }
 }
Пример #18
0
        protected string RemoveTeacher()
        {
            JsonData data     = new JsonData();
            string   Group_id = MyRequest.GetString("GroupID");
            string   User_id  = MyRequest.GetString("TeacherID");
            string   msg      = "";

            if (Tools.CheckParams(Group_id + User_id))
            {
                msg = "传输异常,存在非法字符!";
            }
            else
            {
                try
                {
                    long userid  = long.Parse(User_id);
                    int  groupid = int.Parse(Group_id);
                    BLL.CCOM.Reply_commission   bll   = new BLL.CCOM.Reply_commission();
                    Model.CCOM.Reply_commission model = bll.GetModel(" Group_id=" + groupid + " and User_id=" + userid);
                    if (msg == "")
                    {
                        if (model == null)
                        {
                            msg = "教师不在该答辩组中";
                        }
                        else
                        {
                            if (!bll.Delete(model.Rc_id))
                            {
                                msg = "移除失败";
                            }
                        }
                    }
                }
                catch (Exception)
                {
                    msg = "移除发生异常!";
                }
            }
            if (msg == "")
            {
                data["msg"]  = "移除成功";
                data["code"] = 1;
            }
            else
            {
                data["msg"]  = msg;
                data["code"] = 0;
            }
            return(data.ToJson());
        }
Пример #19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.fun_id = MyRequest.GetQueryString("fun_id");

            if (!Page.IsPostBack)
            {
                string _order = MyRequest.GetString("sort").Replace(",", " ");
                if (_order == "" || Tools.CheckParams(_order))
                {
                    _order = " Group_id asc";
                }
                RptBind(CombSqlTxt(), _order);
            }
        }
Пример #20
0
        protected void bindall()
        {
            Model.CCOM.Agency model = new BLL.CCOM.Agency().GetModel(1);
            if (model == null)
            {
                InnerRedirect(MyEnums.RediirectErrorEnum.NotAdmin);
            }
            else
            {
                this.hiduoid.Value = model.Agency_id.ToString();
                BLL.CCOM.Agency bll = new BLL.CCOM.Agency();

                this.ddlEditSelect.DataSource     = GetOrgList_DataSet(true);
                this.ddlEditSelect.DataTextField  = "Agency_name";
                this.ddlEditSelect.DataValueField = "Agency_id";
                this.ddlEditSelect.DataBind();

                int UO_ID = 0;
                try {
                    UO_ID = Utils.StrToInt(MyRequest.GetQueryString("selectid"), 0);
                }
                catch { }
                if (UO_ID == 0 || UO_ID == -1 || UO_ID == 1)
                {
                    this.txtEditName.Enabled   = false;
                    this.rbEditStatus.Enabled  = false;
                    this.btnEditSubmit.Enabled = false;
                    this.ddlType.Enabled       = false;
                }
                else
                {
                    this.txtEditName.Enabled   = true;
                    this.rbEditStatus.Enabled  = true;
                    this.btnEditSubmit.Enabled = true;
                    this.ddlType.Enabled       = true;
                    Model.CCOM.Agency uo = bll.GetModel(UO_ID);
                    this.ddlEditSelect.SelectedValue = MyRequest.GetString("selectid");
                    this.txtEditName.Text            = uo.Agency_name;
                    this.ddlType.SelectedValue       = uo.Agency_type.ToString();
                    if (uo.Agency_status)
                    {
                        this.rbEditStatus.SelectedValue = "1";
                    }
                    else
                    {
                        this.rbEditStatus.SelectedValue = "0";
                    }
                }
            }
        }
        protected string UpdateFormValue()
        {
            JsonData data        = new JsonData();
            string   userid      = MyRequest.GetString("UserID");
            string   formid      = MyRequest.GetString("FormID");
            string   selectValue = MyRequest.GetString("SelectValue");
            string   msg         = "";

            try
            {
                var form_value_model = new BLL.CCOM.Form_value().GetModel(" User_id=" + userid + " and Form_id=" + formid);
                if (form_value_model == null)   //增加一条记录
                {
                    Model.CCOM.Form_value value_model = new Model.CCOM.Form_value();
                    value_model.User_id    = long.Parse(userid);
                    value_model.Form_id    = int.Parse(formid);
                    value_model.Self_value = int.Parse(selectValue);
                    value_model.Tea_value  = 0;
                    if (new BLL.CCOM.Form_value().Add(value_model) == 0)
                    {
                        msg = "添加失败";
                    }
                }
                else//更新一条记录
                {
                    form_value_model.Self_value = int.Parse(selectValue);
                    if (!new BLL.CCOM.Form_value().Update(form_value_model))
                    {
                        msg = "更新失败";
                    }
                }
            }
            catch
            {
                msg = "发生异常!";
            }

            if (msg == "")
            {
                data["msg"]  = "";
                data["code"] = 1;
            }
            else
            {
                data["msg"]  = msg;
                data["code"] = 0;
            }
            return(data.ToJson());
        }
Пример #22
0
        protected void Page_Load(object sender, EventArgs e)
        {
            String encNewsId = "";
            Int64  userid    = 0;
            String token     = "";
            String userAgent = "";

            if (Request.Headers["user-agent"] != null)
            {
                userAgent = Request.Headers["user-agent"].ToString();
            }

            if (NewsHtml.IsFromMobile(userAgent))
            {
                try
                {
                    encNewsId = MyRequest.GetString("id");
                    //userid = Convert.ToInt64(MyRequest.GetString("userid"));
                    token = MyRequest.GetString("token");
                    if (token == "")
                    {
                        token = "0";
                    }
                    else
                    {
                        userid = new BLL.admin.AppLoginHistory().Get_AppUser_UserID(token);
                    }
                }
                catch (Exception ex)
                {
                    Response.Redirect("/home/news/template/news_error.html");
                }

                String[] arrStr = DESEncrypt.Decrypt(encNewsId).Split(',');
                if (arrStr[1] == "1") //正常新闻
                {
                    ShowNews(userid, arrStr[0], token);
                }
                else
                {
                    ShowPushNews(userid, arrStr[0]);
                }
            }
            else
            {
                Response.Redirect("/home/news/web/webnews.aspx?id=" + MyRequest.GetString("id"));
            }
        }
Пример #23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.fun_id = MyRequest.GetQueryString("fun_id");

            if (!Page.IsPostBack)
            {
                var model = GetAdminInfo_CCOM();
                BLL.CCOM.Reply_group               rg_bll     = new BLL.CCOM.Reply_group();
                BLL.CCOM.Reply_commission          rc_bll     = new BLL.CCOM.Reply_commission();
                List <Model.CCOM.Reply_group>      modellist1 = rg_bll.GetModelList("User_id=" + model.User_id);
                List <Model.CCOM.Reply_commission> modellist2 = rc_bll.GetModelList("User_id=" + model.User_id);
                if (modellist1.Count == 0 && modellist2.Count == 0)
                {
                    string ht = "";
                    ht = " <div class=\"content\" align=\"center\"><h3>您尚无权限<h3><table class=\"table table-striped table-bordered dataTable\"></table></div>";
                    this.print_div.InnerHtml = ht;
                }
                else
                {
                    string _order = MyRequest.GetString("sort").Replace(",", " ");
                    if (_order == "" || Tools.CheckParams(_order))
                    {
                        _order = " Group_id asc";
                    }

                    StringBuilder strTemp = new StringBuilder();
                    strTemp.Append("(");
                    string res = "";
                    foreach (Model.CCOM.Reply_group rg_model in modellist1)
                    {
                        res += rg_model.Group_id + ",";
                    }
                    foreach (Model.CCOM.Reply_commission rg_model in modellist2)
                    {
                        res += rg_model.Group_id + ",";
                    }
                    if (res != "")
                    {
                        strTemp.Append(Utils.DelLastComma(res) + ")");
                    }
                    else
                    {
                        strTemp.Append("0)");
                    }
                    RptBind(strTemp.ToString(), _order);
                }
            }
        }
Пример #24
0
        protected void Page_Load(object sender, EventArgs e)
        {
            String encNewsId = "";
            Int64  userid    = 0;
            String token     = "";
            String userAgent = "";

            if (Request.Headers["user-agent"] != null)
            {
                userAgent = Request.Headers["user-agent"].ToString();
            }

            if (NewsHtml.IsFromMobile(userAgent))
            {
                Response.Redirect("/home/news/news.aspx?id=" + MyRequest.GetString("id"));
            }
            else
            {
                try
                {
                    encNewsId = MyRequest.GetString("id");
                    //userid = Convert.ToInt64(MyRequest.GetString("userid"));
                    //token = MyRequest.GetString("token");
                    if (NewsHtml.IsAdminLogin())
                    {
                        userid = NewsHtml.GetAdminInfo().UserID;
                    }
                }
                catch (Exception ex)
                {
                    Response.Redirect("/home/news/template/news_error.html");
                }
                // if (!IsLegalToken(userid, token))
                // {
                // Response.Redirect("news_error.html");
                // }
                String[] arrStr = DESEncrypt.Decrypt(encNewsId).Split(',');
                if (arrStr[1] == "1") //正常新闻
                {
                    ShowNews(userid, arrStr[0]);
                }
                else
                {
                    ShowPushNews(userid, arrStr[0]);
                }
            }
        }
        protected string SutdentSubmitForm()
        {
            JsonData data   = new JsonData();
            string   userId = MyRequest.GetString("userid");
            string   type   = MyRequest.GetString("type");
            string   msg    = "";

            try
            {
                var form_model = new BLL.CCOM.Form_review().GetModel(" User_id=" + userId + " and Form_type_id=" + type);
                if (form_model == null)
                {
                    Model.CCOM.Form_review model = new Model.CCOM.Form_review();
                    model.User_id       = long.Parse(userId);
                    model.Form_type_id  = int.Parse(type);
                    model.Review_result = 0;
                    if (new BLL.CCOM.Form_review().Add(model) == 0)
                    {
                        msg = "提交失败!";
                    }
                }
                else
                {
                    form_model.Review_result = 0;
                    if (!new BLL.CCOM.Form_review().Update(form_model))
                    {
                        msg = "提交失败!";
                    }
                }
            }
            catch
            {
                msg = "提交发生异常!";
            }

            if (msg == "")
            {
                data["msg"]  = "提交成功";
                data["code"] = 1;
            }
            else
            {
                data["msg"]  = msg;
                data["code"] = 0;
            }
            return(data.ToJson());
        }
        /// <summary>
        /// 添加通知类别
        /// </summary>
        /// <param name="context"></param>
        private void AddPushType(HttpContext context)
        {
            if (!IsAdminLogin())
            {
                FlushResponse(context, JsonConvert.SerializeObject(new ReturnObject() { Result = ERROR, Msg = "error" }));
                return;
            }

            String typeName = MyRequest.GetString("t").Trim();
            if (!Common.Utils.IsSafeSqlString(typeName) || typeName == "")
            {
                FlushResponse(context, JsonConvert.SerializeObject(new ReturnObject() { Result = ERROR, Msg = "参数不合法!" }));
                return;
            }

            //添加通知类别
            var typeBll = new BLL.CCOM.Notice_type();
            var userId = GetAdminInfo().User_id;
            var roleType = GetUserRoleType();
            var roleId = GetRoleUserId();

            string strWhere = "Notice_type_name='" + typeName + "'";
            if (typeBll.GetModelList(strWhere).Count == 0)
            {
                var typeModel = new Model.CCOM.Notice_type()
                {
                    Notice_type_name = typeName,
                    Notice_type_creator_id = userId,
                    Notice_type_date = DateTime.Now
                };

                var typeId = typeBll.Add(typeModel);
                //添加成功,返回typeId和typeName
                if (typeId > 0)
                {
                    FlushResponse(context, JsonConvert.SerializeObject(new ReturnType() { Result = OK, Msg = "推送类别添加成功!", id = DESEncrypt.Encrypt(typeId.ToString()), name = typeName }));
                }
                else
                {
                    FlushResponse(context, JsonConvert.SerializeObject(new ReturnObject() { Result = ERROR, Msg = "推送类别添加失败!" }));
                }
            }
            else
            {
                FlushResponse(context, JsonConvert.SerializeObject(new ReturnObject() { Result = ERROR, Msg = "该通知类别已存在!" }));
            }
        }
        protected string TeacherSubmitForm()
        {
            JsonData data   = new JsonData();
            string   userId = MyRequest.GetString("userid");
            string   type   = MyRequest.GetString("type");
            string   result = MyRequest.GetString("result");
            string   msg    = "";

            try
            {
                var form_model = new BLL.CCOM.Form_review().GetModel(" User_id=" + userId + " and Form_type_id=" + type);
                if (form_model == null)
                {
                    msg = "学生尚未提交形式审查表!";
                }
                else
                {
                    form_model.Review_result = int.Parse(result);
                    if (!new BLL.CCOM.Form_review().Update(form_model))
                    {
                        msg = "审核失败!";
                    }
                }
            }
            catch
            {
                msg = "审核发生异常!";
            }

            if (msg == "")
            {
                data["msg"]  = "审核成功";
                data["code"] = 1;
            }
            else
            {
                data["msg"]  = msg;
                data["code"] = 0;
            }
            return(data.ToJson());
        }
Пример #28
0
        private void SingleFile(HttpContext context)
        {
            string         _refilepath  = MyRequest.GetQueryString("ReFilePath"); //取得返回的对象名称
            string         _upfilepath  = MyRequest.GetQueryString("UpFilePath"); //取得上传的对象名称
            string         _delfile     = MyRequest.GetString(_refilepath);
            HttpPostedFile _upfile      = context.Request.Files[_upfilepath];
            bool           _iswater     = false; //默认不打水印
            bool           _isthumbnail = false; //默认不生成缩略图
            bool           _isimage     = false; //默认不限制图片上传

            if (MyRequest.GetQueryString("IsWater") == "1")
            {
                _iswater = true;
            }
            if (MyRequest.GetQueryString("IsThumbnail") == "1")
            {
                _isthumbnail = true;
            }
            if (MyRequest.GetQueryString("IsImage") == "1")
            {
                _isimage = true;
            }

            if (_upfile == null)
            {
                context.Response.Write("{\"msg\": 0, \"msgbox\": \"请选择要上传文件!\"}");
                return;
            }
            UpLoad upFiles = new UpLoad();
            string msg     = upFiles.fileSaveAs(_upfile, _isthumbnail, _iswater, _isimage);

            //删除已存在的旧文件
            Utils.DeleteUpFile(_delfile);
            //返回成功信息
            context.Response.Write(msg);
            context.Response.End();
        }
        private void RptBind(string _strWhere, string _order)
        {
            int    pageSize    = GetPageSize(15); //每页数量
            int    page        = MyRequest.GetQueryInt("page", 1);
            string keywords    = MyRequest.GetQueryString("keywords");
            int    start_index = pageSize * (page - 1) + 1;

            this.st_index = pageSize * (page - 1) + 1;
            int end_index = pageSize * page;

            this.txtKeywords.Value = keywords;

            BLL.CCOM.Topic bll = new BLL.CCOM.Topic();
            //计算数量
            int totalCount = bll.GetRecordCount(_strWhere);

            //绑定当页
            this.rptList.DataSource = bll.GetListByPage(_strWhere, _order, start_index, end_index);
            this.rptList.DataBind();

            //绑定页码
            txtPageNum.Text = pageSize.ToString();
            string pageUrl = Utils.CombUrlTxt("StudentChoose.aspx", "fun_id={0}&keywords={1}&sort={2}&page={3}", this.fun_id, this.keywords, MyRequest.GetString("sort"), "__id__");

            this.PageContent.InnerHtml = Utils.OutPageList(pageSize, page, totalCount, pageUrl, 8, true);

            //绑定我的选题

            BLL.CCOM.View_Selete_Topic selete_bll = new BLL.CCOM.View_Selete_Topic();
            this.rptList2.DataSource = selete_bll.GetList(" Student_id =" + GetAdminInfo_CCOM().User_id);
            //this.rptList2.DataSource = selete_bll.GetListByPage(_strWhere + "and Student_id ="+GetAdminInfo_CCOM().User_id, _order, start_index, end_index);
            this.rptList2.DataBind();
        }
Пример #30
0
        //#region 组合SQL查询语句==========================
        //protected string CombSqlTxt()
        //{
        //    int flag = 0;
        //    int i = 0;
        //    var model = GetAdminInfo_CCOM();
        //    StringBuilder strTemp = new StringBuilder();

        //    BLL.CCOM.Reply_student rs_bll = new BLL.CCOM.Reply_student();
        //    BLL.CCOM.Reply_commission rc_bll = new BLL.CCOM.Reply_commission();
        //    BLL.CCOM.Reply_group rg_bll = new BLL.CCOM.Reply_group();
        //    strTemp.Append("(");
        //    //学生
        //    DataSet ds = rs_bll.GetList("User_id=" + model.User_id);
        //    //if (ds.Tables[0].Rows.Count > 0)
        //    //{
        //    //    flag = 1;
        //    //    strTemp.Append(ds.Tables[0].Rows[0]["Group_id"]);
        //    //    for ( i = 1; i < ds.Tables[0].Rows.Count; i++)
        //    //    {
        //    //        strTemp.Append(","+ds.Tables[0].Rows[i]["Group_id"]);
        //    //    }
        //    //}
        //    //组长
        //    ds = rg_bll.GetList("User_id=" + model.User_id);
        //    if (ds.Tables[0].Rows.Count > 0)
        //    {
        //        if (flag == 0)
        //        {
        //            flag = 1;
        //            strTemp.Append(ds.Tables[0].Rows[0]["Group_id"]);
        //            i = 1;
        //        }
        //        else
        //            i = 0;
        //        for (; i < ds.Tables[0].Rows.Count; i++)
        //        {
        //            strTemp.Append("," + ds.Tables[0].Rows[i]["Group_id"]);
        //        }
        //    }
        //    //组员
        //    //ds = rc_bll.GetList("User_id=" + model.User_id);
        //    //if (ds.Tables[0].Rows.Count > 0)
        //    //{
        //    //    if (flag == 0)
        //    //    {
        //    //        flag = 1;
        //    //        strTemp.Append(ds.Tables[0].Rows[0]["Group_id"]);
        //    //        i = 1;
        //    //    }
        //    //    else
        //    //        i = 0;
        //    //    for (; i < ds.Tables[0].Rows.Count; i++)
        //    //    {
        //    //        strTemp.Append("," + ds.Tables[0].Rows[i]["Group_id"]);
        //    //    }
        //    //}
        //    //if (flag == 0)
        //    //    strTemp.Append("-1");
        //    //strTemp.Append(")");

        //    return strTemp.ToString();
        //}
        //#endregion

        #region 数据绑定=================================
        private void RptBind(string _strWhere, string _order)
        {
            BLL.CCOM.Reply_group bll = new BLL.CCOM.Reply_group();
            int    pageSize          = GetPageSize(15);//每页数量
            int    page        = MyRequest.GetQueryInt("page", 1);
            string keywords    = MyRequest.GetQueryString("keywords");
            int    start_index = pageSize * (page - 1) + 1;

            this.st_index = pageSize * (page - 1) + 1;
            int end_index = pageSize * page;

            if (_strWhere != "")
            {
                _strWhere = "Group_id in" + _strWhere;
            }
            //计算数量
            int totalCount = bll.GetRecordCount(_strWhere);

            //绑定当页
            this.rptList.DataSource = bll.GetListByPage(_strWhere, _order, start_index, end_index);
            this.rptList.DataBind();

            //绑定页码
            txtPageNum.Text = pageSize.ToString();
            string pageUrl = Utils.CombUrlTxt("MyExamList.aspx", "fun_id={0}&keywords={1}&sort={2}&page={3}", this.fun_id, this.keywords, MyRequest.GetString("sort"), "__id__");

            this.PageContent.InnerHtml = Utils.OutPageList(pageSize, page, totalCount, pageUrl, 8, true);
        }