Ejemplo n.º 1
0
        private void BindGrid()
        {
            BulletinBLL bulletinBLL = new BulletinBLL();

            DateTime start = new DateTime(2000, 1, 1);
            DateTime end   = new DateTime(2100, 12, 31);

            if (dateBeginTime.DateValue.ToString() != "")
            {
                start = DateTime.Parse(dateBeginTime.DateValue.ToString());
            }
            if (dateBeginTime.DateValue.ToString() != "")
            {
                end = DateTime.Parse(dateEndTime.DateValue.ToString());
            }


            IList <RailExam.Model.Bulletin> bulletins = bulletinBLL.GetBulletins(txtTitle.Text, int.Parse(ddlImportanceName.SelectedValue),
                                                                                 txtOrgName.Text, txtEmployeeName.Text, start, end, PrjPub.CurrentLoginUser.IsAdmin, PrjPub.CurrentLoginUser.EmployeeID);

            if (bulletins != null)
            {
                Grid1.DataSource = bulletins;
                Grid1.DataBind();
            }
        }
Ejemplo n.º 2
0
    private void Bind(int id)
    {
        Bulletin bulletin = new BulletinBLL().GetBulletinEntity(id);

        if (bulletin != null && bulletin.Id > 0)
        {
            this.txtTitle.Text = bulletin.Title;
            //this.fckMessage.Value = bulletin.Contents;
            elm1.Value = bulletin.Contents;
        }
    }
Ejemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string strBulletinID = Request.QueryString["id"];

                BulletinBLL bulletinBLL = new BulletinBLL();
                Bulletin    bulletin    = bulletinBLL.GetBulletin(int.Parse(strBulletinID));

                ViewState["Title"]      = bulletin.Title;
                ViewState["Author"]     = bulletin.EmployeeName;
                ViewState["Content"]    = bulletin.Content;
                ViewState["CreateTime"] = bulletin.CreateTime;
            }
        }
Ejemplo n.º 4
0
 //保存
 protected void btnSave_Click(object sender, EventArgs e)
 {
     if (verify())
     {
         BulletinBLL bulletinBLL = new BulletinBLL();
         Bulletin    bulletin    = new Bulletin();
         bulletin.Contents        = this.elm1.Value;
         bulletin.PublishUserCode = GetLoginCode();;
         bulletin.Title           = this.txtTitle.Text.Trim();
         bulletin.IsDel           = 1;
         bulletin.OrderId         = 0;
         bulletin.PublishTime     = DateTime.Now;
         bulletin.ScanNum         = 0;
         //修改
         if (!string.IsNullOrEmpty(Request.QueryString["id"]))
         {
             int      id    = Check.GetInt32(Request.QueryString["id"]);
             Bulletin model = bulletinBLL.GetBulletinEntity(id);
             if (model != null && model.Id > 0)
             {
                 bulletin.OrderId     = model.OrderId;
                 bulletin.PublishTime = model.PublishTime;
                 bulletin.ScanNum     = model.ScanNum;
                 bulletin.Id          = id;
             }
             try
             {
                 bulletinBLL.UpdateBulletin(bulletin);
                 Response.Redirect("BulletinList.aspx");
             }
             catch
             {
                 Alert("修改失败,请重试");
             }
         }
         else
         {
             if (new BulletinBLL().AddBulletinReturn(bulletin))
             {
                 Response.Redirect("BulletinList.aspx");
             }
             else
             {
                 Alert("添加失败,请重试");
             }
         }
     }
 }
Ejemplo n.º 5
0
    private void Bind()
    {
        int       numPerPage = 10;//每页显示数量
        string    orderBy    = " PublishTime desc";
        int       totalCount = 0;
        DataTable dt         = new BulletinBLL().GetBulletinListByBack(GetCriteria(), AspNetPager1.CurrentPageIndex, numPerPage, orderBy, out totalCount);

        if (dt != null && dt.Rows.Count > 0)
        {
            Repeater1.DataSource = dt;
        }
        else
        {
            Repeater1.DataSource = new DataTable();
        }
        AspNetPager1.RecordCount = totalCount;
        AspNetPager1.PageSize    = numPerPage;
        Repeater1.DataBind();
    }
Ejemplo n.º 6
0
        public string GetReport()
        {
            BulletinBLL      bulletinbll      = new BulletinBLL();
            Bulletin_dealBLL bulletin_dealbll = new Bulletin_dealBLL();
            WSSJBGBLL        wssjbgbll        = new WSSJBGBLL();
            //查询条件
            var TimeStart     = Request["TimeStart"] ?? "";
            var TimeEnd       = Request["TimeEnd"] ?? "";
            var dlrsswtype    = Request["dlrsswtype"] ?? "";
            var sgtype        = Request["sgtype"] ?? "";
            var wssjtype      = Request["wssjtype"] ?? "";
            var bjnf          = Request["bjnf"] ?? "";
            var type          = int.Parse(Request["type"] ?? "0");
            var returnListObj = new List <Object>();
            var data          = new object();
            //统计时间
            var times = DateTime.Now;
            var timee = DateTime.Now;

            if (TimeStart.Length > 0)
            {
                times = DateTime.Parse(TimeStart);
            }
            if (TimeEnd.Length > 0)
            {
                timee = DateTime.Parse(TimeEnd).AddDays(1);
            }
            //事故事件类型统计

            var count  = 0;
            var count1 = 0;
            var count2 = 0;

            #region 权限
            string where = new AuthorizeBLL().GetModuleDataAuthority(ERCHTMS.Code.OperatorProvider.Provider.Current(), HttpContext.Request.Cookies["currentmoduleId"].Value, "CREATEUSERDEPTCODE", "CREATEUSERORGCODE");
            string sqlwhere = " and IsSubmit_Deal=1 ";
            if (!string.IsNullOrEmpty(where))
            {
                sqlwhere += " and " + where;
            }
            else
            {
                Operator user = ERCHTMS.Code.OperatorProvider.Provider.Current();
                sqlwhere += string.Format(" and CREATEUSERDEPTCODE like '{0}%'", user.DeptCode);
            }
            #endregion
            switch (type)
            {
            //按事故事件类型统计
            case 0:
                var list = bulletin_dealbll.GetList(sqlwhere).Where(e => e.SGTYPE_DEAL != null && (TimeStart.Length > 0 ? e.HAPPENTIME_DEAL >= times : 1 == 1) &&
                                                                    (TimeEnd.Length > 0 ? e.HAPPENTIME_DEAL <= timee : 1 == 1));
                if (list != null)
                {
                    count = list.Count();
                    var date = list.ToList().GroupBy(e => e.SGTYPENAME_DEAL);
                    foreach (var item in date)
                    {
                        var itemCount = decimal.Parse(item.Count().ToString());
                        returnListObj.Add(new { text = item.Key, value = itemCount, bfb = decimal.Round((itemCount / count) * 100, 2) });
                    }
                }
                break;

            //按事故等级统计
            case 1:
                var list1 = bulletin_dealbll.GetList(sqlwhere).Where(e => e.SGTYPENAME_DEAL.Contains("事故") && e.SGLEVEL_DEAL != null && (TimeStart.Length > 0 ? e.HAPPENTIME_DEAL >= times : 1 == 1) &&
                                                                     (TimeEnd.Length > 0 ? e.HAPPENTIME_DEAL <= timee : 1 == 1) && (sgtype.Length > 0 ? e.SGTYPE_DEAL == sgtype : 1 == 1));
                if (list1 != null)
                {
                    count = list1.Count();
                    var date = list1.ToList().GroupBy(e => e.SGLEVELNAME_DEAL);
                    foreach (var item in date)
                    {
                        var itemCount = decimal.Parse(item.Count().ToString());
                        returnListObj.Add(new { text = item.Key, value = itemCount, bfb = decimal.Round((itemCount / count) * 100, 2) });
                    }
                }

                break;

            //按伤亡人数统计
            case 2:
                var list2 = bulletin_dealbll.GetList(sqlwhere).Where(e => e.SGTYPENAME_DEAL.Contains("人身伤亡事故") && e.SGLEVEL_DEAL != null && (TimeStart.Length > 0 ? e.HAPPENTIME_DEAL >= times : 1 == 1) &&
                                                                     (TimeEnd.Length > 0 ? e.HAPPENTIME_DEAL <= timee : 1 == 1) && (sgtype.Length > 0 ? e.SGTYPE_DEAL == sgtype : 1 == 1));
                count = list2.Count();
                if (list2 != null && count > 0)
                {
                    var query = from l in list2
                                group l by new { l.SGLEVELNAME_DEAL } into tab
                        select new
                    {
                        text  = tab.Key.SGLEVELNAME_DEAL,
                        value = tab.Count(),
                        swnum = list2.Where(e => e.SGLEVELNAME_DEAL == tab.Key.SGLEVELNAME_DEAL).Sum(p => p.SWNUM_DEAL),
                        zsnum = list2.Where(e => e.SGLEVELNAME_DEAL == tab.Key.SGLEVELNAME_DEAL).Sum(p => p.ZSNUM_DEAL),
                        sznum = list2.Where(e => e.SGLEVELNAME_DEAL == tab.Key.SGLEVELNAME_DEAL).Sum(p => p.SZNUM_DEAL),
                        qsnum = list2.Where(e => e.SGLEVELNAME_DEAL == tab.Key.SGLEVELNAME_DEAL).Sum(p => p.QSNUM_DEAL)
                    };
                    returnListObj.AddRange(query);
                }
                break;

            //人身伤害事故类别统计
            case 3:
                var list3 = bulletin_dealbll.GetList(sqlwhere).Where(e => e.SGTYPENAME_DEAL.Contains("人身伤亡事故") && e.RSSHSGTYPE_DEAL != null && (TimeStart.Length > 0 ? e.HAPPENTIME_DEAL >= times : 1 == 1) &&
                                                                     (TimeEnd.Length > 0 ? e.HAPPENTIME_DEAL <= timee : 1 == 1) && (sgtype.Length > 0 ? e.SGTYPE_DEAL == sgtype : 1 == 1));
                count = list3.Count();
                if (list3 != null && count > 0)
                {
                    var query = from l in list3
                                group l by new { l.RSSHSGTYPENAME_DEAL } into tab
                        select new
                    {
                        text  = tab.Key.RSSHSGTYPENAME_DEAL,
                        value = tab.Count(),
                        swnum = list3.Where(e => e.RSSHSGTYPENAME_DEAL == tab.Key.RSSHSGTYPENAME_DEAL).Sum(p => p.SWNUM_DEAL),
                        zsnum = list3.Where(e => e.RSSHSGTYPENAME_DEAL == tab.Key.RSSHSGTYPENAME_DEAL).Sum(p => p.ZSNUM_DEAL),
                        sznum = list3.Where(e => e.RSSHSGTYPENAME_DEAL == tab.Key.RSSHSGTYPENAME_DEAL).Sum(p => p.SZNUM_DEAL),
                        qsnum = list3.Where(e => e.RSSHSGTYPENAME_DEAL == tab.Key.RSSHSGTYPENAME_DEAL).Sum(p => p.QSNUM_DEAL)
                    };
                    var listnow = query.ToList();
                    returnListObj.AddRange(query);
                }
                break;

            //伤亡事故原因统计
            case 4:
                var listXXX = bulletin_dealbll.GetList(sqlwhere);
                var list4   = bulletin_dealbll.GetList(sqlwhere).Where(e => (TimeStart.Length > 0 ? e.HAPPENTIME_DEAL >= times : 1 == 1) &&
                                                                       (TimeEnd.Length > 0 ? e.HAPPENTIME_DEAL <= timee : 1 == 1) && (e.SGTYPENAME_DEAL != null ? e.SGTYPENAME_DEAL.Contains("人身伤亡事故") : e.SGTYPENAME_DEAL != null) &&
                                                                       (sgtype.Length > 0 ? e.SGTYPE_DEAL == sgtype : 1 == 1));
                count = list4.Count();

                var xwtext  = "A不安全行为";
                int xwswnum = 0;
                int xwzsnum = 0;
                int xwsznum = 0;
                int xwqsnum = 0;
                int xwvalue = 0;
                var zttext  = "B不安全状态";
                int ztswnum = 0;
                int ztzsnum = 0;
                int ztsznum = 0;
                int ztqsnum = 0;
                int ztvalue = 0;
                //查询包含不安全行为的数据有多少条
                #region  安全行为的数据
                var entityXW     = dataItemBLL.GetEntityByCode("AEM_BAQXW");
                var listXWdetail = dataItemDetailBLL.GetListByCode(entityXW.ItemCode);
                foreach (DataRow row in listXWdetail.Rows)
                {
                    count1++;
                    //是否包含
                    var itemname = row["ItemName"].ToString();
                    var listxw   = list4.Where(e => (e.BAQXWNAME != null) && e.BAQXWNAME.Contains(row["ItemName"].ToString())).ToList();
                    int swnum1   = 0;
                    int zsnum1   = 0;
                    int sznum1   = 0;
                    int qsnum1   = 0;
                    int value1   = 0;
                    if (listxw != null)
                    {
                        value1 = listxw.Count();
                        foreach (var item in listxw)
                        {
                            xwswnum += item.SWNUM_DEAL.Value;
                            xwzsnum += item.ZSNUM_DEAL.Value;
                            xwsznum += item.SZNUM_DEAL.Value;
                            xwqsnum += item.QSNUM_DEAL.Value;

                            swnum1 += item.SWNUM_DEAL.Value;
                            zsnum1 += item.ZSNUM_DEAL.Value;
                            sznum1 += item.SZNUM_DEAL.Value;
                            qsnum1 += item.QSNUM_DEAL.Value;
                        }
                        xwvalue += value1;
                        returnListObj.Add(new { type = 1, text = row["ItemName"].ToString(), value = value1, swnum = swnum1, zsnum = zsnum1, sznum = sznum1, qsnum = qsnum1 });
                    }
                    else
                    {
                        returnListObj.Add(new { type = 1, text = row["ItemName"].ToString(), value = value1, swnum = swnum1, zsnum = zsnum1, sznum = sznum1, qsnum = qsnum1 });
                    }
                }
                returnListObj.Insert(0, new { type = 1, text = xwtext, value = xwvalue, swnum = xwsznum, zsnum = xwzsnum, sznum = xwsznum, qsnum = xwqsnum });

                #endregion


                #region  安全状态的数据
                var entityZT     = dataItemBLL.GetEntityByCode("AEM_BAQZT");
                var listZTdetail = dataItemDetailBLL.GetListByCode(entityZT.ItemCode);
                foreach (DataRow row in listZTdetail.Rows)
                {
                    count2++;
                    count1++;
                    //是否包含
                    var listzt = list4.Where(e => (e.BAQZTNAME != null) && e.BAQZTNAME.Contains(row["ItemName"].ToString()));
                    int swnum2 = 0;
                    int zsnum2 = 0;
                    int sznum2 = 0;
                    int qsnum2 = 0;
                    int value2 = 0;
                    if (listzt != null)
                    {
                        value2 = listzt.Count();
                        foreach (var item in listzt)
                        {
                            ztswnum += item.SWNUM_DEAL.Value;
                            ztzsnum += item.ZSNUM_DEAL.Value;
                            ztsznum += item.SZNUM_DEAL.Value;
                            ztqsnum += item.QSNUM_DEAL.Value;

                            swnum2 += item.SWNUM_DEAL.Value;
                            zsnum2 += item.ZSNUM_DEAL.Value;
                            sznum2 += item.SZNUM_DEAL.Value;
                            qsnum2 += item.QSNUM_DEAL.Value;
                        }
                        ztvalue += value2;

                        returnListObj.Add(new { type = 1, text = row["ItemName"].ToString(), value = value2, swnum = swnum2, zsnum = zsnum2, sznum = sznum2, qsnum = qsnum2 });
                    }
                    else
                    {
                        returnListObj.Add(new { type = 1, text = row["ItemName"].ToString(), value = value2, swnum = swnum2, zsnum = zsnum2, sznum = sznum2, qsnum = qsnum2 });
                    }
                }
                returnListObj.Insert(count1 - count2 + 1, new { type = 1, text = zttext, value = ztvalue, swnum = ztsznum, zsnum = ztzsnum, sznum = ztsznum, qsnum = ztqsnum });
                #endregion


                #region 间接原因
                var entityJJYY = dataItemBLL.GetEntityByCode("AEM_JJYY");
                var listJJYY   = dataItemDetailBLL.GetListByCode(entityJJYY.ItemCode);
                foreach (DataRow row in listJJYY.Rows)
                {
                    count2++;
                    //是否包含
                    var listjjyy = list4.Where(e => (e.JJYYNAME != null) && e.JJYYNAME.Contains(row["ItemName"].ToString()));
                    int swnum3   = 0;
                    int zsnum3   = 0;
                    int sznum3   = 0;
                    int qsnum3   = 0;
                    int value3   = 0;
                    if (listjjyy != null)
                    {
                        value3 = listjjyy.Count();
                        foreach (var item in listjjyy)
                        {
                            swnum3 += item.SWNUM_DEAL.Value;
                            zsnum3 += item.ZSNUM_DEAL.Value;
                            sznum3 += item.SZNUM_DEAL.Value;
                            qsnum3 += item.QSNUM_DEAL.Value;
                        }
                        //xwvalue += value3;
                        returnListObj.Add(new { type = 2, text = row["ItemName"].ToString(), value = value3, swnum = swnum3, zsnum = zsnum3, sznum = sznum3, qsnum = qsnum3 });
                    }
                    else
                    {
                        returnListObj.Add(new { type = 2, text = row["ItemName"].ToString(), value = value3, swnum = swnum3, zsnum = zsnum3, sznum = sznum3, qsnum = qsnum3 });
                    }
                }
                #endregion
                count1 = count1 + 2;
                break;

            //按年份统计
            case 5:
                var listYear = new List <int>();
                if (bjnf.Length > 0 && bjnf != "0")
                {
                    //近五年
                    if (bjnf == "1")
                    {
                        timee = DateTime.Now;
                        for (int i = 1; i < 5; i++)
                        {
                            listYear.Add(times.Year - i);
                        }
                        times = DateTime.Now.AddYears(-5);
                    }
                    //近十年
                    if (bjnf == "2")
                    {
                        timee = DateTime.Now;
                        for (int i = 1; i < 10; i++)
                        {
                            listYear.Add(times.Year - i);
                        }
                        times = DateTime.Now.AddYears(-10);
                    }
                }
                var list5 = bulletin_dealbll.GetList(sqlwhere).Where(e => e.HAPPENTIME_DEAL != null &&
                                                                     (TimeStart.Length > 0 ? e.HAPPENTIME_DEAL.Value.Year >= times.Year : 1 == 1) &&
                                                                     (TimeEnd.Length > 0 ? e.HAPPENTIME_DEAL.Value.Year <= timee.Year : 1 == 1) &&
                                                                     (sgtype == "-1" ? e.SGTYPENAME_DEAL.Contains("事件") : 1 == 1) && //所有的事件
                                                                     (sgtype == "-2" ? e.SGTYPENAME_DEAL.Contains("事故") : 1 == 1) && //所有的事故
                                                                     ((sgtype.Length > 0 && sgtype != "-1" && sgtype != "-2") ? e.SGTYPE_DEAL == sgtype : 1 == 1) //选择了具体的事故或者事件
                                                                     );
                count = list5.Count();
                if (list5 != null && count > 0)
                {
                    var query = from l in list5
                                group l by new { l.HAPPENTIME_DEAL.Value.Year } into tab
                        select new
                    {
                        text  = tab.Key.Year,
                        value = list5.Where(e => e.HAPPENTIME_DEAL.Value.Year == tab.Key.Year).Count(),
                        swnum = list5.Where(e => e.HAPPENTIME_DEAL.Value.Year == tab.Key.Year).Sum(p => p.SWNUM_DEAL),
                        zsnum = list5.Where(e => e.HAPPENTIME_DEAL.Value.Year == tab.Key.Year).Sum(p => p.ZSNUM_DEAL),
                        sznum = list5.Where(e => e.HAPPENTIME_DEAL.Value.Year == tab.Key.Year).Sum(p => p.SZNUM_DEAL),
                        qsnum = list5.Where(e => e.HAPPENTIME_DEAL.Value.Year == tab.Key.Year).Sum(p => p.QSNUM_DEAL)
                    };
                    var listQuery = query.ToList();
                    foreach (var item in query)
                    {
                        if (listYear.Contains(item.text))
                        {
                            continue;
                        }
                        else
                        {
                            listYear.Remove(item.text);
                        }
                    }
                    foreach (var item in listYear)
                    {
                        returnListObj.Add(new { text = item, value = 0, swnum = 0, zsnum = 0, sznum = 0, qsnum = 0 });
                    }

                    returnListObj.AddRange(query);
                }
                break;

            //按未遂事件类型统计
            case 6:
                var list6 = wssjbgbll_deal.GetList(sqlwhere).Where(e => e.WssjType_Deal != null && (TimeStart.Length > 0 ? e.HappenTime_Deal >= times : 1 == 1) &&
                                                                   (TimeEnd.Length > 0 ? e.HappenTime_Deal <= timee : 1 == 1));
                count = list6.Count();
                if (list6 != null && count > 0)
                {
                    var date = list6.ToList().GroupBy(e => e.WssjTypeName_Deal);
                    foreach (var item in date)
                    {
                        var itemCount = decimal.Parse(item.Count().ToString());
                        returnListObj.Add(new { text = item.Key, value = itemCount, bfb = decimal.Round((itemCount / count) * 100, 2) });
                    }
                }
                break;

            //年度变化统计
            case 7:
                var listYearWS = new List <int>();
                if (bjnf.Length > 0 && bjnf != "0")
                {
                    //近五年
                    if (bjnf == "1")
                    {
                        timee = DateTime.Now;
                        for (int i = 1; i < 5; i++)
                        {
                            listYearWS.Add(times.Year - i);
                        }
                        times = DateTime.Now.AddYears(-5);
                    }
                    //近十年
                    if (bjnf == "2")
                    {
                        timee = DateTime.Now;
                        for (int i = 1; i < 10; i++)
                        {
                            listYearWS.Add(times.Year - i);
                        }
                        times = DateTime.Now.AddYears(-10);
                    }
                }

                var list7 = wssjbgbll_deal.GetList(sqlwhere).Where(e => e.HappenTime_Deal != null && (bjnf != "0" ? e.HappenTime_Deal.Value.Year >= times.Year : 1 == 1) &&
                                                                   (bjnf != "0" ? e.HappenTime_Deal.Value.Year <= timee.Year : 1 == 1) && wssjtype.Length > 0 ? e.WssjType_Deal == wssjtype : 1 == 1);
                count = list7.Count();
                if (list7 != null && count > 0)
                {
                    var date = list7.ToList().GroupBy(e => e.HappenTime_Deal.Value.Year);
                    foreach (var item in date)
                    {
                        var itemCount = decimal.Parse(item.Count().ToString());
                        returnListObj.Add(new { text = item.Key, value = itemCount });
                        listYearWS.Remove(item.Key);
                    }
                }


                foreach (var item in listYearWS)
                {
                    returnListObj.Add(new { text = item, value = 0 });
                }

                break;

            default:
                break;
            }

            data = new { list = returnListObj, count = count, count1 = count1, count2 = count2 };
            var json = Newtonsoft.Json.JsonConvert.SerializeObject(data);
            return(json);
        }
Ejemplo n.º 7
0
    private void Bind()
    {
        //int pagecount = new DAL.Bulletin().GetProcListCountByPK("Bulletin","");
        //IList<Models.Bulletin> list = new List<Models.Bulletin>();
        //if (pagecount > 0)
        //    list = new DAL.Bulletin().GetBulletinByList();

        //AspNetPager1.RecordCount = pagecount;
        //AspNetPager1.PageSize = pageSize;
        //this.Repeater1.DataSource = list;
        //this.Repeater1.DataBind();

        #region 分页相关
        //此处正常情况下不需要更改
        int _pageNum = 1;//当前页
        if (!string.IsNullOrEmpty(Request.Form["pageNum"]))
        {
            _pageNum     = int.Parse(Request.Form["pageNum"]);
            parm.pageNum = _pageNum;
        }
        if (!string.IsNullOrEmpty(Request.Form["numPerPage"]))
        {
            parm.numPerPage = int.Parse(Request.Form["numPerPage"]); //每页显示条数(默认20)
        }
        #endregion


        #region 查询
        /***********查询条件*********************/
        BulletinTO sto = new BulletinTO();
        if (!string.IsNullOrEmpty(Request.Form["Title"]))
        {
            parm.DeptName = sto.Title = Request.Form["Title"];
        }
        //if (!string.IsNullOrEmpty(Request.Form["DeptCode"]))
        //    parm.DeptCode = sto.DeptCode = Request.Form["DeptCode"];
        //if (!string.IsNullOrEmpty(Request.Form["DeptID"]))
        //{
        //    parm.DeptID = sto.DeptID = Request.Form["DeptID"];
        //    if (sto.DeptID == "0") sto.DeptID = "";
        //}
        //else
        //    parm.DeptID = "0";


        #endregion

        #region 排序
        /************排序*************************/
        string columName = "";//排序的列明
        /***********排序字段*********************/
        if (!string.IsNullOrEmpty(Request.Form["orderField"]))
        {
            if (string.IsNullOrEmpty(Request.Form["orderDirection"]))
            {
                parm.orderDirection = " asc ";
            }
            else
            {
                parm.orderDirection = Request.Form["orderDirection"];
            }

            parm.orderField = Request.Form["orderField"];

            if (Request.Form["orderField"] == "DeptName")//xiaoqu order
            {
                parm.DeptNameOrder = parm.orderDirection;
                columName          = " DeptName ";             //需要加表别名防止重名报错
            }
            else if (Request.Form["orderField"] == "DeptCode") //jigou mc order
            {
                parm.DeptCodeOrder = parm.orderDirection;
                columName          = " DeptCode ";
            }
        }
        string orderBy = "";
        if (!string.IsNullOrEmpty(Request.Form["orderField"]))
        {
            orderBy = columName + " " + parm.orderDirection;
        }
        else
        {
            parm.DeptCodeOrder = "asc";
        }

        #endregion


        #region 列表

        StringBuilder sbd = new StringBuilder();
        //查询列表
        BulletinBLL bulletinBLL = new BulletinBLL();

        DataTable dt = bulletinBLL.GetBulletinList(sto, parm.pageNum, parm.numPerPage, orderBy, out parm.totalCount);

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            DataRow dr = dt.Rows[i];
            //sbd.AppendFormat("<tr target=\"sid_user\" rel=\"{0}\">", dr["DeptID"]);
            //sbd.AppendFormat("<td>{0}</td>", (i + 1) + (_pageNum - 1) * parm.numPerPage);//编号
            //sbd.AppendFormat("<td>{0}</td>", dr["DeptCode"]);
            //sbd.AppendFormat("<td>{0}</td>", dr["DeptName"]);
            //sbd.Append("</tr>");

            //sbd.AppendFormat("<div id=\"u68\" class=\"u68_container\"   >");
            //sbd.AppendFormat("<div id=\"u68_img\" >");
            //sbd.AppendFormat("<img src=\"Resoures/Bulletin/u63_normal.gif\"  class=\"raw_image\"></div>");
            //sbd.AppendFormat("<div id=\"u69\" class=\"u69\" style=\"visibility:hidden;\"  >");
            //sbd.AppendFormat("<div id=\"u69_rtf\"></div>");
            //sbd.AppendFormat("</div>");
            //sbd.AppendFormat("</div>");
            //sbd.AppendFormat("<div id=\"u70\" class=\"u70\"  >");
            //sbd.AppendFormat("<div id=\"u70_rtf\"><p style=\"text-align:left;\"><span style=\"font-family:Arial;font-size:14px;font-weight:bold;font-style:normal;text-decoration:none;color:#2C629E;\">关于中秋放假休息的通知</span><span style=\"font-family:Arial;font-size:14px;font-weight:bold;font-style:normal;text-decoration:none;color:#2C629E;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style=\"font-family:Arial;font-size:14px;font-weight:bold;font-style:normal;text-decoration:none;color:#999999;\">&nbsp; &nbsp;&nbsp; </span></p></div>");
            //sbd.AppendFormat("</div>");
            //sbd.AppendFormat("<div id=\"u71\" class=\"u71\"  >");
            //sbd.AppendFormat("<div id=\"u71_rtf\"><p style=\"text-align:left;\"><span style=\"font-family:Arial;font-size:13px;font-weight:normal;font-style:normal;text-decoration:none;color:#333333;\">根据国务院《关于修改&lt;全国年节及纪念日放假办法&gt;的决定》,2013年9月19日至9月21日放假</span><span style=\"font-family:Arial;font-size:13px;font-weight:normal;font-style:normal;text-decoration:none;color:#333333;\">共</span><span style=\"font-family:Arial;font-size:13px;font-weight:normal;font-style:normal;text-decoration:none;color:#333333;\">3</span><span style=\"font-family:Arial;font-size:13px;font-weight:normal;font-style:normal;text-decoration:none;color:#333333;\">天。其中9月19日(星期四,农历中秋节)法定节假日,9月21日(星期六)公休日,9月22日(星期日)公休调至9月20日,9月22日(星期日)照常上班。</span></p></div>");
            //sbd.AppendFormat("</div><div id=\"u72\" class=\"u72\" >");
            //sbd.AppendFormat("<DIV id=\"u72_line\" class=\"u72_line\" ></DIV>");
            //sbd.AppendFormat("</div>");


            sbd.AppendFormat("<div style='width:100%;'>{0}</div>", dr["Title"]);
        }
        parm.DataRowList = sbd.ToString();

        #endregion
    }
Ejemplo n.º 8
0
        private void DeleteData(int nBulletinID)
        {
            BulletinBLL bulletinBLL = new BulletinBLL();

            bulletinBLL.DeleteBulletin(nBulletinID);
        }