//tab2=================== #region 数据绑定================================= private void JudgeBind(string _strWhere, string _order) { int pageSize = JudgeGetPageSize(15); //每页数量 int page = MyRequest.GetQueryInt("page", 1); //string keywords = MyRequest.GetQueryString("keywords"); string keywords = this.keywordTab0; int start_index = pageSize * (page - 1) + 1; int end_index = pageSize * page; this.txtKeywords.Text = keywords; var bll = new BLL.CCOM.Judge(); //计算数量 int totalCount = bll.GetRecordCount(_strWhere); //绑定当页 this.Repeater1.DataSource = bll.GetListByPage(_strWhere, _order, start_index, end_index); this.Repeater1.DataBind(); //绑定页码 txtJudgePageNum.Text = pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("ConfResource.aspx", "fun_id={0}&keywords={1}&page={2}", DESEncrypt.Encrypt(this.fun_id), keywords, "__id__"); this.Div2.InnerHtml = Utils.OutPageList(pageSize, page, totalCount, pageUrl, 8, true); }
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.View_User bll = new BLL.CCOM.View_User(); //计算数量 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("ScoreList.aspx", "fun_id={0}&keywords={1}&page={2}", this.fun_id, this.keywords, "__id__"); this.PageContent.InnerHtml = Utils.OutPageList(pageSize, page, totalCount, pageUrl, 8, true); }
//删除 protected void lbtSingleDelete_Click(object sender, EventArgs e) { BLL.CCOM.Topic bll = new BLL.CCOM.Topic(); 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 = MyRequest.GetQueryString("keywords"); int page = MyRequest.GetQueryInt("page", 1); if (result == true) { //JscriptMsg("删除成功!", Utils.CombUrlTxt("ManagerList.aspx", "fun_id={0}&keywords={1}&page={2}", // DESEncrypt.Encrypt(this.fun_id), keywords, page.ToString()), "Success"); JscriptMsg("删除成功!", Utils.CombUrlTxt("TopicList.aspx", "fun_id={0}&keywords={1}&page={2}", this.fun_id, keywords, page.ToString()), "Success"); // Response.Redirect("TopicList.aspx?fun_id=" + get_fun_id("CCOM/TopicManage/TopicList.aspx")); } else { JscriptMsg("删除失败!", Utils.CombUrlTxt("TopicList.aspx", "fun_id={0}&keywords={1}&page={2}", DESEncrypt.Encrypt(this.fun_id), keywords, page.ToString()), "Error"); } } }
//#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); }
private void RptBind(string _order) { string _strWhere = ""; string str = GetStudentID(); if (str != "") { _strWhere += "Student_id in (" + str + ")"; } else { _strWhere += "Student_id=-1"; } 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; BLL.CCOM.View_Selete_Topic bll = new BLL.CCOM.View_Selete_Topic(); //计算数量 // int totalCount = bll.GetRecordCount(_strWhere); //绑定我的选题 this.rptList.DataSource = bll.GetListByPage(_strWhere, _order, start_index, end_index); this.rptList.DataBind(); }
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; int end_index = pageSize * page; this.txtKeywords.Text = keywords; var bll = new BLL.CCOM.SMS_apply_record(); //计算数量 int totalCount = bll.GetRecordCount(_strWhere); //绑定当页 if (check_type == 0 || check_type == -1) { this.rptList.DataSource = bll.GetListByPage(_strWhere, _order, start_index, end_index); this.rptList.DataBind(); } else { this.Repeater1.DataSource = bll.GetListByPage(_strWhere, _order, start_index, end_index); this.Repeater1.DataBind(); } //绑定页码 txtPageNum.Text = pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("Manage_SMS_apply.aspx", "fun_id={0}&keywords={1}&page={2}", this.fun_id, this.keywords, "__id__"); this.PageContent.InnerHtml = Utils.OutPageList(pageSize, page, totalCount, pageUrl, 8, true); }
protected void lbtSingleDelete_Click(object sender, EventArgs e) { var bll = new BLL.CCOM.SMS_apply_record(); var lbtn = sender as LinkButton; if (lbtn != null) { var SMS_apply_id = Int64.Parse(DESEncrypt.Decrypt(lbtn.ToolTip.ToString())); bool result = true; try { result = bll.Delete(SMS_apply_id); } catch { result = false; } //string keywords = MyRequest.GetQueryString("keywords"); int page = MyRequest.GetQueryInt("page", 1); if (result == true) { JscriptMsg("删除成功!", Utils.CombUrlTxt("Manage_SMS_apply.aspx", "fun_id={0}&keywords={1}&page={2}", this.fun_id, this.keywords, page.ToString()), "Success"); } else { JscriptMsg("删除失败!", Utils.CombUrlTxt("Manage_SMS_apply.aspx", "fun_id={0}&keywords={1}&page={2}", this.fun_id, this.keywords, page.ToString()), "Error"); } } }
//删除 protected void lbtJudgeDelete_Click(object sender, EventArgs e) { BLL.CCOM.Judge bll = new BLL.CCOM.Judge(); 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.keywordTab0; int page = MyRequest.GetQueryInt("page", 1); if (result == true) { JscriptMsg("删除成功!", Utils.CombUrlTxt("ConfResource.aspx", "fun_id={0}&keywords={1}&page={2}", DESEncrypt.Encrypt(this.fun_id), keywords, page.ToString()), "Success"); } else { JscriptMsg("删除失败!", Utils.CombUrlTxt("ConfResource.aspx", "fun_id={0}&keywords={1}&page={2}", DESEncrypt.Encrypt(this.fun_id), keywords, page.ToString()), "Error"); } } }
private void RptBind(string _strWhere, string _order) { int pageSize = GetPageSize(30); //每页数量 int page = MyRequest.GetQueryInt("page", 1); int start_index = pageSize * (page - 1) + 1; int end_index = pageSize * page; BLL.CCOM.View_AEE_Score bll = new BLL.CCOM.View_AEE_Score(); //计算数量 int totalCount = bll.GetRecordCount(_strWhere); // txtSearchResult.Text = "本次命中" + totalCount.ToString() + "条"; //绑定当页 this.rptList.DataSource = bll.GetListByPage(_strWhere, _order, start_index, end_index); this.rptList.DataBind(); //绑定页码 txtPageNum.Text = pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("AEEScoreList.aspx", "fun_id={0}&page={1}&keywords={2}&major_id={3}", DESEncrypt.Encrypt(this.fun_id), "__id__", this.txtKeywords.Text, DESEncrypt.Encrypt(this.major_id)); this.PageContent.InnerHtml = Utils.OutPageList(pageSize, page, totalCount, pageUrl, 8, true); }
protected void Page_Load(object sender, EventArgs e) { action = MyEnums.ActionEnum.Add.ToString(); userId = 0; action = MyRequest.GetQueryString("action"); userId = MyRequest.GetQueryInt("userId"); if (!Page.IsPostBack) { // BindId_Type(); BindAgency(); // BindRole(); if (action == MyEnums.ActionEnum.Edit.ToString()) { if (userId == 0) { JscriptMsg("传输参数不正确!", "back", "Error"); return; } ShowInfo(userId); this.btnSubmit.Text = "确认保存"; } else { this.btnSubmit.Text = "确认添加"; } } }
//单个删除 protected void lbtSingleDelete_Click(object sender, EventArgs e) { var lbtn = sender as LinkButton; BLL.CCOM.News_type bll = new BLL.CCOM.News_type(); BLL.CCOM.News news_bll = new BLL.CCOM.News(); if (lbtn != null) { bool result = false; int newsTypeId = Int32.Parse(DESEncrypt.Decrypt(lbtn.ToolTip.ToString())); if (newsTypeId > 0) { Model.CCOM.News_type model = bll.GetModel(newsTypeId); if (model.News_type_creator_id == GetAdminInfo_CCOM().User_id) { news_bll.Delete(" News_type_id=" + newsTypeId); result = bll.Delete(newsTypeId); } int page = MyRequest.GetQueryInt("page", 1); if (result) { JscriptMsg("删除成功!", Utils.CombUrlTxt("News_type_manage.aspx", "&keywords={0}&page={1}&fun_id={2}", keywords, page.ToString(), DESEncrypt.Encrypt(this.fun_id)), "Success"); } } } }
//绑定通知类别 //private void BindPushType() //{ // var typeList = new BLL.CCOM.Notice_type().GetModelList(""); // if(typeList!=null&&typeList.Count>0) // { // StringBuilder sb = new StringBuilder(); // var className = "btn btn-success"; // var className1 = "btn"; // string noticeTypeId = MyRequest.GetQueryString("notice_type_id"); // if(noticeTypeId==null||noticeTypeId.Length==0)//若为传值则默认为未分类 // { // sb.Append("<a href=\"Notice_list_manager.aspx?notice_type_id=" + DESEncrypt.Encrypt("0") + "¬ice_type=" + this.NoticeType + "&fun_id=" + DESEncrypt.Encrypt(this.fun_id) + "\" class='" + className + "'>"); // sb.Append("未分类</a> "); // for(int i=0;i<typeList.Count;i++) // { // sb.Append("<a href=\"Notice_list_manager.aspx?notice_type_id=" + DESEncrypt.Encrypt(typeList[i].Notice_type_id.ToString()) + "¬ice_type=" + this.NoticeType + "&fun_id=" + DESEncrypt.Encrypt(this.fun_id) + "\" class='" + className1 + "'>"); // sb.Append(typeList[i].Notice_type_name + "</a> "); // } // this.NoticeTypeDiv.InnerHtml = sb.ToString(); // } // else // { // try // { // long notice_type_id = long.Parse(DESEncrypt.Decrypt(noticeTypeId)); // if(notice_type_id==0) // { // sb.Append("<a href=\"Notice_list_manager.aspx?notice_type_id=" + DESEncrypt.Encrypt("0") + "¬ice_type=" + this.NoticeType + "&fun_id=" + DESEncrypt.Encrypt(this.fun_id) + "\" class='" + className + "'>"); // sb.Append("未分类</a> "); // for (int i = 0; i < typeList.Count; i++) // { // sb.Append("<a href=\"Notice_list_manager.aspx?notice_type_id=" + DESEncrypt.Encrypt(typeList[i].Notice_type_id.ToString()) + "¬ice_type=" + this.NoticeType + "&fun_id=" + DESEncrypt.Encrypt(this.fun_id) + "\" class='" + className1 + "'>"); // sb.Append(typeList[i].Notice_type_name + "</a> "); // } // } // else // { // sb.Append("<a href=\"Notice_list_manager.aspx?notice_type_id=" + DESEncrypt.Encrypt("0") + "¬ice_type=" + this.NoticeType + "&fun_id=" + DESEncrypt.Encrypt(this.fun_id) + "\" class='" + className1 + "'>"); // sb.Append("未分类</a> "); // for (int i = 0; i < typeList.Count; i++) // { // if(typeList[i].Notice_type_id==notice_type_id) // { // sb.Append("<a href=\"Notice_list_manager.aspx?notice_type_id=" + DESEncrypt.Encrypt(typeList[i].Notice_type_id.ToString())+"¬ice_type="+this.NoticeType + "&fun_id=" + DESEncrypt.Encrypt(this.fun_id) + "\" class='" + className + "'>"); // sb.Append(typeList[i].Notice_type_name + "</a> "); // } // else // { // sb.Append("<a href=\"Notice_list_manager.aspx?notice_type_id=" + DESEncrypt.Encrypt(typeList[i].Notice_type_id.ToString()) + "¬ice_type=" + this.NoticeType + "&fun_id=" + DESEncrypt.Encrypt(this.fun_id) + "\" class='" + className1 + "'>"); // sb.Append(typeList[i].Notice_type_name + "</a> "); // } // } // } // this.NoticeTypeDiv.InnerHtml = sb.ToString(); // } // catch // { // } // } // } //} #region 数据绑定================================= private void RptBind(string _strWhere, string _order) { int pageSize = GetPageSize(10); //每页数量 int page = MyRequest.GetQueryInt("page", 1); string keywords = MyRequest.GetQueryString("keywords"); int start_index = pageSize * (page - 1) + 1; int end_index = pageSize * page; this.txtKeywords.Text = keywords; var bll = new BLL.CCOM.Notice(); //计算数量 int totalCount = bll.GetRecordCount(_strWhere); //绑定当页 var ds = bll.GetListByPage(_strWhere, _order, start_index, end_index); this.rptList.DataSource = ds; this.rptList.DataBind(); //绑定页码 txtPageNum.Text = pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("Notice_list_manager.aspx", "fun_id={0}&keywords={1}&page={2}¬ice_type_id={3}", DESEncrypt.Encrypt(this.fun_id), this.keywords, "__id__", DESEncrypt.Encrypt(this.ptId.ToString())); this.PageContent.InnerHtml = Utils.OutPageList(pageSize, page, totalCount, pageUrl, 8, true); }
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(); }
//删除 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"); } } }
/// <summary> /// 置顶 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void lbtTop_Click(object sender, EventArgs e) { var bll = new BLL.CCOM.News(); var lbtn = sender as LinkButton; if (lbtn != null) { int news_id = Int32.Parse(DESEncrypt.Decrypt(lbtn.ToolTip.ToString())); bool isTop = false; bool result = true; try { var model = bll.GetModel(news_id); if (model.News_top != null && !(bool)model.News_top) { isTop = false; model.News_top = true; DateTime date = Convert.ToDateTime(model.News_date); TimeSpan time_span = DateTime.Now - date; int day = time_span.Days; model.News_top_time = day + 3; bll.Update(model); } else { isTop = true; model.News_top = false; model.News_top_time = 0; bll.Update(model); } result = true; } catch { result = false; } //string keywords = MyRequest.GetQueryString("keywords"); int page = MyRequest.GetQueryInt("page", 1); if (result == true) { JscriptMsg(isTop ? "取消置顶成功!" : "置顶成功!", Utils.CombUrlTxt("News_list_manager.aspx", "keywords={0}&page={1}&fun_id={2}", keywords, page.ToString(), DESEncrypt.Encrypt(this.fun_id)), "Success"); } else { JscriptMsg(isTop ? "取消置顶失败!" : "置顶失败!", Utils.CombUrlTxt("News_list_manager.aspx", "keywords={0}&page={1}&fun_id={2}", keywords, page.ToString(), DESEncrypt.Encrypt(this.fun_id)), "Error"); } } }
//批量删除 protected void btnDelete_Click(object sender, EventArgs e) { BLL.CCOM.News_type bll = new BLL.CCOM.News_type(); int count = 0; bool result = false; for (int i = 0; i < this.rptList.Items.Count; i++) { System.Web.UI.WebControls.CheckBox cb = (System.Web.UI.WebControls.CheckBox)rptList.Items[i].FindControl("chkId"); if (!cb.Checked) { continue; } else { int newsTypeId = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value); if (newsTypeId > 0) { Model.CCOM.News_type model = bll.GetModel(newsTypeId); if (model.News_type_creator_id == GetAdminInfo_CCOM().User_id) { result = bll.Delete(newsTypeId); } if (result) { count++; } } } } if (count < 1) { JscriptMsg("请您选择需要删除的资讯类别!", "", "Error"); return; } string keywords = MyRequest.GetQueryString("keywords"); int page = MyRequest.GetQueryInt("page", 1); if (result == true) { JscriptMsg("批量删除成功!", Utils.CombUrlTxt("News_type_manage.aspx", "&keywords={0}&page={1}&fun_id={2}", keywords, page.ToString(), DESEncrypt.Encrypt(this.fun_id)), "Success"); } else { JscriptMsg("批量删除失败!", Utils.CombUrlTxt("News_type_manage.aspx", "keywords={0}&page={1}&fun_id={2}", keywords, page.ToString(), DESEncrypt.Encrypt(this.fun_id)), "Error"); } }
//批量删除 protected void btnDelete_Click(object sender, EventArgs e) { var bll = new BLL.CCOM.Notice(); var result = true; int iCnt = 0; for (int i = 0; i < rptList.Items.Count; i++) { long id = Convert.ToInt64(((HiddenField)rptList.Items[i].FindControl("hidId")).Value); CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId"); if (cb.Checked) { iCnt++; try { var m = bll.GetModel(id); if (IsSelfPush(m.Notice_sender_id.ToString()) == false) { JscriptMsg("您无权进行删除!", "", "Error"); return; } bll.Delete(id); } catch { result = false; } } } if (iCnt < 1) { JscriptMsg("请您选择需要删除的信息!", "", "Error"); return; } string keywords = MyRequest.GetQueryString("keywords"); int page = MyRequest.GetQueryInt("page", 1); if (result == true) { JscriptMsg("批量删除成功!", Utils.CombUrlTxt("Notice_list_manager.aspx", "fun_id={0}&ptId={1}&keywords={2}&page={3}", DESEncrypt.Encrypt(this.fun_id), this.ptId.ToString(), keywords, page.ToString()), "Success"); } else { JscriptMsg("批量删除失败!", Utils.CombUrlTxt("Notice_list_manager.aspx", "fun_id={0}&ptId={1}&keywords={2}&page={3}", DESEncrypt.Encrypt(this.fun_id), this.ptId.ToString(), keywords, page.ToString()), "Error"); } }
protected void Page_Load(object sender, EventArgs e) { //this.fun_id = get_fun_id("CCOM/notice/SelectUserDept.aspx"); this.isSendCounsellor = MyRequest.GetQueryInt("isSendCounsellor"); if (!IsPostBack) { //绑定机构树 DepartmentTreeBindNoCheck(this.trDepartmentList); //绑定通讯组树 //UserGroupTreeBindNoCheck(this.trUserGroup); //绑定通讯录 BindDDL(); this.trDepartmentList.Attributes.Add("onclick", "CheckEvent()"); //this.trUserGroup.Attributes.Add("onclick", "CheckEvent()"); } }
protected void Page_Load(object sender, EventArgs e) { homeworkId = 0; homeworkId = MyRequest.GetQueryInt("homeworkId"); if (!Page.IsPostBack) { if (homeworkId == 0) { JscriptMsg("传输参数不正确!", "back", "Error"); return; } //if(GetAdminInfo_CCOM().Role_id != 3) //{ // JscriptMsg("只有学生用户才可以提交材料!", "back", "Error"); // return; //} ShowInfo(homeworkId); } }
private void RptBind(string _order) { string _strWhere = ""; _strWhere += "Accept_state = 1 and Teacher_id =" + GetAdminInfo_CCOM().User_id; 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; BLL.CCOM.View_Selete_Topic bll = new BLL.CCOM.View_Selete_Topic(); //计算数量 // int totalCount = bll.GetRecordCount(_strWhere); //绑定我的选题 this.rptList.DataSource = bll.GetListByPage(_strWhere, _order, start_index, end_index); this.rptList.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { action = MyEnums.ActionEnum.Add.ToString(); datumId = 0; action = MyRequest.GetQueryString("action"); datumId = MyRequest.GetQueryInt("weeklyId"); if (!Page.IsPostBack) { BindDate(); if (action == MyEnums.ActionEnum.Edit.ToString()) { if (datumId == 0) { JscriptMsg("传输参数不正确!", "back", "Error"); return; } ShowInfo(datumId); JscriptMsg("请重新编辑提交类型!", "", "Success"); } } }
protected void lbtAble_Click(object sender, EventArgs e) { var bll = new BLL.CCOM.Topic(); var lbtn = sender as LinkButton; if (lbtn != null) { var id = Int64.Parse(DESEncrypt.Decrypt(lbtn.ToolTip.ToString())); bool isOn = false; bool result = true; try { var m = bll.GetModel("Topic_id=" + id); //isOn = m.Selected_state == true; //m.Selected_state = isOn ^ true; if (bll.Update(m) == false) { result = false; } } catch { result = false; } string keywords = MyRequest.GetQueryString("keywords"); int page = MyRequest.GetQueryInt("page", 1); if (result == true) { JscriptMsg(isOn ? "退选成功!" : "选择成功!", Utils.CombUrlTxt("StudentChoose.aspx", "fun_id={0}&keywords={1}&page={2}", DESEncrypt.Encrypt(this.fun_id), keywords, page.ToString()), "Success"); } else { JscriptMsg(isOn ? "退选失败!" : "选择失败!", Utils.CombUrlTxt("StudentChoose.aspx", "fun_id={0}&keywords={1}&page={2}", DESEncrypt.Encrypt(this.fun_id), keywords, page.ToString()), "Error"); } RptBind(CombSqlTxt(this.keywords), " User_id desc "); } }
public void ProcessRequest(HttpContext context) { string data = MyRequest.GetQueryString("data"); string result = string.Empty; if (data != null && data.Length > 0) { try { result = DESEncrypt.Decrypt(data); } catch { } } else { context.Response.Write("传入数据有误"); return; } string pic = MyRequest.GetQueryString("pic"); if (pic == "") { pic = "/images/login/ccom_logo.png"; } int QRCodeScale = MyRequest.GetQueryInt("codescale", 10); if (!Tools.CheckParams(result)) { GetQRCode qrcode = new GetQRCode(); //qrcode.ProcessRequest(HttpContext.Current, result, QRCodeScale , pic); qrcode.ProcessRequest_path(HttpContext.Current, result, QRCodeScale, pic, "/AdminMetro/CCOM/Certificate/QRcode_image/" + result + ".png"); } else { context.Response.Write("传入数据包含非法字符!"); return; } }
protected void Page_Load(object sender, EventArgs e) { action = MyRequest.GetQueryString("action"); roleId = MyRequest.GetQueryInt("roleId"); if (!Page.IsPostBack) { if (action == MyEnums.ActionEnum.Edit.ToString()) { if (roleId == 0) { JscriptMsg("传输参数不正确!", "back", "Error"); return; } ShowInfo(roleId); this.btnSubmit.Text = "确认保存"; } else { this.btnSubmit.Text = "确认添加"; } } }
//删除单条通知 protected void lbtSingleDelete_Click(object sender, EventArgs e) { var bll = new BLL.CCOM.Notice(); var lbtn = sender as LinkButton; if (lbtn != null) { var id = Int64.Parse(DESEncrypt.Decrypt(lbtn.ToolTip.ToString())); bool result = true; try { var m = bll.GetModel(id); if (IsSelfPush(m.Notice_sender_id.ToString()) == false) { JscriptMsg("您无权进行删除!", "", "Error"); return; } bll.Delete(id); } catch { result = false; } string keywords = MyRequest.GetQueryString("keywords"); int page = MyRequest.GetQueryInt("page", 1); if (result == true) { JscriptMsg("删除成功!", Utils.CombUrlTxt("Notice_list_manager.aspx", "fun_id={0}&ptId={1}&keywords={2}&page={3}", DESEncrypt.Encrypt(this.fun_id), this.ptId.ToString(), keywords, page.ToString()), "Success"); } else { JscriptMsg("删除失败!", Utils.CombUrlTxt("Notice_list_manager.aspx", "fun_id={0}&ptId={1}&keywords={2}&page={3}", DESEncrypt.Encrypt(this.fun_id), this.ptId.ToString(), keywords, page.ToString()), "Error"); } } }
private void bindData() { BLL.CCOM.News_type bll = new BLL.CCOM.News_type(); string strWhere = string.Empty; int pageSize = GetPageSize(10); //每页数量 int page = MyRequest.GetQueryInt("page", 1); keywords = MyRequest.GetQueryString("keywords"); if (keywords != null && keywords.Length > 0) { if (strWhere != "") { strWhere = strWhere + " and News_type_name '%" + keywords + "%' "; } else { strWhere = " News_type_name like '%" + keywords + "%' "; } } int start_index = pageSize * (page - 1) + 1; int end_index = pageSize * page; //计算数量 int totalCount = bll.GetRecordCount(""); //绑定当页 this.rptList.DataSource = bll.GetListByPage(strWhere, " News_type_date DESC ", start_index, end_index); this.rptList.DataBind(); //绑定页码 this.txtPageNum.Text = pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("News_type_manage.aspx", "keywords={0}&page={1}&fun_id={2}", keywords, "__id__", DESEncrypt.Encrypt(this.fun_id)); this.PageContent.InnerHtml = Utils.OutPageList(pageSize, page, totalCount, pageUrl, 8, true); }
private void RptBind() { int pageSize = 10; //每页数量 int page = MyRequest.GetQueryInt("page", 1); string keywords = this.keywords; //MyRequest.GetQueryString("keywords"); int start_index = pageSize * (page - 1) + 1; int end_index = pageSize * page; this.txtKeywords.Value = keywords; StringBuilder ulSb = new StringBuilder(); //获取该用户的所有未读通知Id BLL.CCOM.User_notice bll = new BLL.CCOM.User_notice(); Model.CCOM.User_notice model = bll.GetModel(" User_id=" + GetAdminInfo_CCOM().User_id); if (model != null) { string all_news_id = string.Empty; if (type == 0) { all_news_id = model.Notice_id; this.no_read.Style.Value = "background-color:#a5d16c"; this.read.Style.Value = "background-color:lightgrey"; } else { all_news_id = model.Notice_read_id; this.read.Style.Value = "background-color:#a5d16c"; this.no_read.Style.Value = "background-color:lightgrey"; } if (all_news_id.Length > 0) { string[] ids = all_news_id.Split(','); string strWhere = string.Empty; if (keywords != null && keywords.Length > 0) { strWhere += " Notice_content like '%" + keywords + "%' "; } else { strWhere += " 1=1"; } if (ids.Length > 0) { for (int i = 0; i < ids.Length; i++) { if (i == 0) { strWhere += " and ( Notice_id=" + ids[i]; } else { strWhere += " or Notice_id=" + ids[i]; } } strWhere += " )"; //获取通知信息 BLL.CCOM.Notice bll_notice = new BLL.CCOM.Notice(); int totalCount = bll_notice.GetRecordCount(strWhere); //计算数量 DataTable dt = bll_notice.GetListByPage(strWhere, "Notice_date DESC", start_index, end_index).Tables[0]; //绑定当页 long userId = GetAdminInfo_CCOM().User_id; if (dt.Rows.Count > 0) { BLL.CCOM.User_information user_bll = new BLL.CCOM.User_information(); string realname = string.Empty; foreach (DataRow dr in dt.Rows) { var content = ""; content = "<a href=\"ViewNotice.aspx?id=" + DESEncrypt.Encrypt(dr["Notice_id"].ToString()) + "\" target=\"_blank\">"; content += dr["Notice_title"] + "</a>"; content += "<br />"; content += dr["Notice_content"]; try { realname = user_bll.GetModel(Convert.ToInt32(dr["Notice_sender_id"])).User_realname; } catch { realname = "---"; } ulSb.Append("<li>"); ulSb.Append("<div class=\"media\">"); ulSb.Append("<span class=\"label pull-left label-success\"><i class=\"icon-bell\"></i></span>"); ulSb.Append("<div class=\"media-body\">"); ulSb.Append("<div class=\"notice-collapse\" style=\"padding: 5px;\">"); ulSb.Append("<div class=\"text\" style=\"padding: 2px 4px; text-decoration: none;\">"); ulSb.Append(" <p style=\"font-weight:bold;\">" + content + "</p>"); ulSb.Append(" <p class=\"attribution\">" + realname + " " + ((DateTime)dr["Notice_date"]).ToString("yyyy-MM-dd HH:mm") + "</p>"); ulSb.Append("</div>"); ulSb.Append("</div>"); ulSb.Append("</div>"); ulSb.Append("</div>"); ulSb.Append("</li>"); } //this.page_size.Style.Add("display", ""); } else { //this.page_size.Style.Add("display", "none"); ulSb.Append("<li style=\"height:40px;font-size:18px;text-align:center;padding-top:21px;\">暂无通知消息!</li>"); } //绑定页码 string pageUrl = Utils.CombUrlTxt("Notice_list.aspx", "keywords={0}&page={1}&fun_id={2}&type={3}", this.keywords, "__id__", DESEncrypt.Encrypt(this.fun_id), DESEncrypt.Encrypt(this.type.ToString())); this.PageContent.InnerHtml = Utils.OutPageList(pageSize, page, totalCount, pageUrl, 8, true); } } else { ulSb.Append("<li style=\"height:40px;font-size:18px;text-align:center;padding-top:21px;\">暂无通知消息!</li>"); //this.page_size.Style.Add("display", "none"); } } else//为空则创建该用户 { Model.CCOM.User_notice user_notice_model = new Model.CCOM.User_notice(); user_notice_model.User_id = GetAdminInfo_CCOM().User_id; bll.Add(user_notice_model); } this.noticeList.InnerHtml = ulSb.ToString(); }
public void ProcessRequest(HttpContext context) { int id = MyRequest.GetQueryInt("id"); //获得下载ID if (id < 1) { context.Response.Redirect(siteConfig.webpath + "error.aspx?msg=" + Utils.UrlEncode("出错啦,参数传值不正确哦!")); return; } ////检查下载记录是否存在 //BLL.download_attach bll = new BLL.download_attach(); //if (!bll.Exists(id)) //{ // context.Response.Redirect(siteConfig.webpath + "error.aspx?msg=" + Utils.UrlEncode("出错啦,您要下载的文件不存在或已经被删除啦!")); // return; //} //Model.download_attach model = bll.GetModel(id); ////检查积分是否足够 //if (model.point > 0) //{ // //检查用户是否登录 // Model.users userModel = new Web.UI.BasePage().GetUserInfo(); // if (userModel == null) // { // //自动跳转URL // HttpContext.Current.Response.Redirect(new Web.UI.BasePage().linkurl("login")); // } // //防止重复扣积分 // string cookie = Utils.GetCookie(MyKeys.COOKIE_DOWNLOAD_KEY, "attach_" + userModel.id.ToString()); // if (cookie != model.id.ToString()) // { // //检查积分 // if (model.point > userModel.point) // { // context.Response.Redirect(siteConfig.webpath + "error.aspx?msg=" + Utils.UrlEncode("出错啦,您的积分不足支付本次下载!")); // return; // } // //扣取积分 // new BLL.point_log().Add(userModel.id, userModel.user_name, model.point * -1, "下载附件:“" + model.title + "”,扣减积分"); // //写入Cookie // Utils.WriteCookie(MyKeys.COOKIE_DOWNLOAD_KEY, "attach_" + userModel.id.ToString(), model.id.ToString(), 8640); // } //} ////下载次数+1 //bll.UpdateField(id, "down_num=down_num+1"); ////检查文件本地还是远程 //if (model.file_path.ToLower().StartsWith("http://")) //{ // context.Response.Redirect(model.file_path); // return; //} //else //{ // //取得文件物理路径 // string fullFileName = Utils.GetMapPath(model.file_path); // if (!File.Exists(fullFileName)) // { // context.Response.Redirect(siteConfig.webpath + "error.aspx?msg=" + Utils.UrlEncode("出错啦,您要下载的文件不存在或已经被删除啦!")); // return; // } // FileInfo file = new FileInfo(fullFileName);//路径 // context.Response.ContentEncoding = System.Text.Encoding.GetEncoding("UTF-8"); //解决中文乱码 // context.Response.AddHeader("Content-Disposition", "attachment; filename=" + HttpUtility.UrlEncode(model.title)); //解决中文文件名乱码 // context.Response.AddHeader("Content-length", file.Length.ToString()); // context.Response.ContentType = "application/pdf"; // context.Response.WriteFile(file.FullName); // context.Response.End(); //} }
//删除 protected void lbtSingleDelete_Click(object sender, EventArgs e) { var lbtn = sender as LinkButton; if (lbtn != null) { var id = Int32.Parse(DESEncrypt.Decrypt(lbtn.ToolTip.ToString())); bool result = true; try { switch (this.ddlResourceType.SelectedValue) { case "1": bll_province = new BLL.CCOM.Province(); result = bll_province.Delete(id); break; case "2": bll_politics = new BLL.CCOM.Politics(); result = bll_politics.Delete(id); break; case "3": bll_nationality = new BLL.CCOM.Nationality(); result = bll_nationality.Delete(id); break; case "4": bll_nation = new BLL.CCOM.Nation(); result = bll_nation.Delete(id); break; case "5": bll_musical_instrument = new BLL.CCOM.Musical_instrument(); result = bll_musical_instrument.Delete(id); break; case "6": bll_degree = new BLL.CCOM.Degree(); result = bll_degree.Delete(id); break; case "7": bll_certivicate_type = new BLL.CCOM.Certificate_type(); result = bll_certivicate_type.Delete(id); break; default: break; } } catch { result = false; } string keywords = this.keywordTab0; int page = MyRequest.GetQueryInt("page", 1); if (result == true) { JscriptMsg("删除成功!", Utils.CombUrlTxt("ResourceList.aspx", "fun_id={0}&keywords={1}&page={2}&selectid={3}", DESEncrypt.Encrypt(this.fun_id), keywords, page.ToString(), this.ddlResourceType.SelectedValue), "Success"); } else { JscriptMsg("删除失败!", Utils.CombUrlTxt("ResourceList.aspx", "fun_id={0}&keywords={1}&page={2}&selectid={3}", DESEncrypt.Encrypt(this.fun_id), keywords, page.ToString(), this.ddlResourceType.SelectedValue), "Error"); } } }
//tab1=================== #region 数据绑定================================= private void RptBind(string _strWhere, string _order) { int pageSize = GetPageSize(15); //每页数量 int page = MyRequest.GetQueryInt("page", 1); //string keywords = MyRequest.GetQueryString("keywords"); string keywords = this.keywordTab0; int start_index = pageSize * (page - 1) + 1; int end_index = pageSize * page; this.txtKeywords.Text = keywords; int totalCount = 0; switch (this.ddlResourceType.SelectedValue) { case "1": bll_province = new BLL.CCOM.Province(); totalCount = bll_province.GetRecordCount(_strWhere); this.rptList.DataSource = bll_province.GetListByPage(_strWhere, _order, start_index, end_index); break; case "2": bll_politics = new BLL.CCOM.Politics(); totalCount = bll_politics.GetRecordCount(_strWhere); this.rptList.DataSource = bll_politics.GetListByPage(_strWhere, _order, start_index, end_index); break; case "3": bll_nationality = new BLL.CCOM.Nationality(); totalCount = bll_nationality.GetRecordCount(_strWhere); this.rptList.DataSource = bll_nationality.GetListByPage(_strWhere, _order, start_index, end_index); break; case "4": bll_nation = new BLL.CCOM.Nation(); totalCount = bll_nation.GetRecordCount(_strWhere); this.rptList.DataSource = bll_nation.GetListByPage(_strWhere, _order, start_index, end_index); break; case "5": bll_musical_instrument = new BLL.CCOM.Musical_instrument(); totalCount = bll_musical_instrument.GetRecordCount(_strWhere); this.rptList.DataSource = bll_musical_instrument.GetListByPage(_strWhere, _order, start_index, end_index); break; case "6": bll_degree = new BLL.CCOM.Degree(); totalCount = bll_degree.GetRecordCount(_strWhere); this.rptList.DataSource = bll_degree.GetListByPage(_strWhere, _order, start_index, end_index); break; case "7": bll_certivicate_type = new BLL.CCOM.Certificate_type(); totalCount = bll_certivicate_type.GetRecordCount(_strWhere); this.rptList.DataSource = bll_certivicate_type.GetListByPage(_strWhere, _order, start_index, end_index); break; default: break; } this.rptList.DataBind(); //绑定页码 txtPageNum.Text = pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("ResourceList.aspx", "fun_id={0}&keywords={1}&page={2}&selectid={3}", DESEncrypt.Encrypt(this.fun_id), keywords, "__id__", this.ddlResourceType.SelectedValue); this.PageContent.InnerHtml = Utils.OutPageList(pageSize, page, totalCount, pageUrl, 8, true); }