public void ProcessRequest(HttpContext context)
 {
     context.Response.ContentType = "text/plain";
     NoticeInfoManager manager = new NoticeInfoManager();
     int pageNum = int.Parse(context.Request.QueryString.Get("pagenum"));
     int pagesize = int.Parse(context.Request.QueryString.Get("pagesize"));
     int recordCount = 0;
     WhereClip where = null;
     DataTable dt = manager.GetDataTable(pageNum + 1, pagesize, where, " CODE ", ref pagesize, ref recordCount);
     //manager.GetDataTable();
     string result = JsonConvert.Convert2Json(dt);
     context.Response.Write("{\"total\":\"" + recordCount.ToString() + "\",\"rows\":" + result + "}");
     context.Response.End();
 }
Beispiel #2
0
        private void LoadData(string ID)
        {
            NoticeInfo nt = new NoticeInfoManager().GetItemById(new Guid(ID));

            txtID.Value = nt.ID.ToString();
            txtCODE.Value = nt.CODE;
            txtCONTENT.Value = nt.CONTENT.ToString();
            txtISTOP.Checked = nt.ISTOP.Value;
            txtISUSED.Checked = nt.ISTOP.Value;
            hidPUBDATE.Value = nt.PUBDATE;
            txtPUBUSER.Value = nt.PUBUSER;
            txtSOURCE.Value = nt.SOURCE;
            txtTITLE.Value = nt.TITLE;
        }
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            HttpRequest rp = context.Request;
            string msg = string.Empty;
            try
            {

                if (string.IsNullOrEmpty(rp["ID"]))
                {
                    msg = "请选择要删除的数据!";
                }
                else
                {
                    int i = new NoticeInfoManager().DelateById(new Guid(rp["ID"]));
                    if (i > 0)
                    {
                        context.Response.Write("{\"success\":\"true\"}");
                    }
                    else
                    {
                        context.Response.Write("{\"success\":\"true\"}");
                        msg = "删除失败!";

                    }

                }
            }
            catch (Exception ex)
            {
                msg = ex.Message;

            }
            if (!string.IsNullOrEmpty(msg))
            {
                byte[] bytes = Encoding.UTF8.GetBytes(msg.Replace("\r\n", "<br/>"));
                string encode = Convert.ToBase64String(bytes);
                context.Response.Write("{\"success\":\"false\",\"msg\":\"" + encode + "\"}");
            }
            context.Response.End();
        }
Beispiel #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string desc_tmpl = "信息来源:{0}&nbsp;&nbsp;&nbsp;&nbsp;发稿作者:{1}&nbsp;&nbsp;&nbsp;&nbsp;发布时间:{2}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
            if (!IsPostBack)
            {

                NoticeInfo nr = new NoticeInfo();
                NoticeInfoManager nrMgr = new NoticeInfoManager();
                string id = Request.QueryString.Get("id");
                if (!string.IsNullOrEmpty(id))
                {
                    nr = nrMgr.GetItemById(new Guid(id));
                    if (nr != null)
                    {
                        news_title.InnerHtml = nr.TITLE;
                        news_desc.InnerHtml = string.Format(desc_tmpl, nr.SOURCE, nr.PUBUSER, nr.PUBDATE);
                        news_content.InnerHtml = nr.CONTENT;
                    }

                }
            }
        }
Beispiel #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string tmpl =
            @"
            <tr>
                <td height='25' align='left' valign='middle' >
                    &nbsp;
                    <img src='css/images/biao.gif' />
                    <a href='{0}' target='_blank'  title='标题:中央下达的重要文件请各小组查看'>{1}</a>
                    <font class='red'>★</font>
                    &nbsp;&nbsp;
                </td>
            </tr>";

            string wrtmpl = @"
            <tr>
                <td width='65' height='28' align='center' valign='middle' >
                    <div class='book_kk' style='width:55px;'>√{0}</div>
                </td>
                <td align='left' valign='middle' >
                    {1}:
                    <a href='indexworkinfo.aspx?id={6}' target='_blank'>
                    {2}
                    </a>
                </td>
                <td width='100' align='center' valign='middle' >{3}</td>
                <td width='140' align='center' valign='middle' >{4}</td>
                <td width='120' align='left' valign='middle' >{5}</td>
            </tr>";

            string sbtmpl = @"
            <tr>
                <td height='30' align='center' bgcolor='#FFFFFF' class='zx'>{0}</td>
                <td align='center' bgcolor='#FFFFFF' class='zx'>&nbsp;<font class='book_kk'>{1}</font><!--故障设备置顶--></td>
                <td align='center' bgcolor='#FFFFFF' class='zx'>{2}</td>
                <td align='center' bgcolor='#FFFFFF' class='zx'>{3}</td>
                <td align='center' bgcolor='#FFFFFF' class='zx'>共<span class='title12b'>{4}</span>次故障</td>
                <td align='center' bgcolor='#FFFFFF' class='zx'>共<span class='title12b'>{5}</span>次更换</td>
            </tr>";

            if (!IsPostBack)
            {

                #region 格式化新闻
                NoticeInfoManager ntMgr = new NoticeInfoManager();
                string result = "<table width='100%' border='0' align='center' cellpadding='0'  cellspacing='0'>";

                int count = 0;
                DataTable dt = ntMgr.GetDataTable(1, 5, "ISTOP", ref count, ref count);
                foreach (DataRow row in dt.Rows)
                {
                    result += string.Format(tmpl, "newsinfo.aspx?id=" + row["ID"].ToString(), row["TITLE"]);

                }
                result += "</table>";

                news_wrap.InnerHtml = result;
                #endregion

               // #region 格式化派工http://www.ycfarm.com/sbbx/images/top_b.gif
               // string worinfohtml = "<table width='100%' border='0' align='center' cellpadding='0' cellspacing='0'> ";
               // WorkInfoManager wkMgr = new WorkInfoManager();
               // WhereClip where = null;// WorkInfo._.Status != "完成";
               // if ( Session["AllDepart"] != null)
               // {
               //     List<AdministrativeRegions> list =  Session["AllDepart"] as List<AdministrativeRegions>;
               //     if (list != null && list.Count > 0)
               //     {
               //         string[] dparr = new string[list.Count];
               //         for (int j = 0; j < list.Count; j++)
               //         {
               //             dparr[j] = list[j].ID.ToString();
               //         }
               //         if (WhereClip.IsNullOrEmpty(where))
               //         {
               //             where = ShebeiInfo._.SocrceDepart.In(dparr);

               //         }
               //         else
               //         {
               //             where = where && ShebeiInfo._.SocrceDepart.In(dparr);
               //         }
               //     }
               // }
               // OrderByClip order = WorkInfo._.CreateDate.Desc;
               // DataTable dtwk = wkMgr.GetDataTable(1, 4, where, order, ref count, ref count);
               // // DataTable dtwk = wkMgr.GetDataTable();
               //int i = 0;
               // foreach (DataRow row in dtwk.Rows)
               // {
               //     i++;
               //     if (i > 4) break;
               //     string gzxx = row["GuZhangXx"].ToString();
               //     if (gzxx.Length > 10)
               //     {
               //         gzxx = gzxx.Substring(0, 10);
               //     }
               //     string clyj = row["ChuLiYijian"].ToString();
               //     if (clyj.Length > 10)
               //     {
               //         clyj = clyj.Substring(0, 10);
               //     }
               //     worinfohtml += string.Format(wrtmpl, row["Status"].ToString(), row["CreaterName"].ToString(), gzxx, row["CurrentUser"].ToString(), clyj, ((DateTime)row["CreateDate"]).ToString("yyyy-MM-dd"), row["ID"]);

               // }
               // worinfohtml += "</table>";
               // workinfo.InnerHtml = worinfohtml;
               // #endregion

            //                string sresult =
            //                @"<table width='100%' border='0' cellpadding='0' cellspacing='0' class='dx'>
            //                      <tbody><tr>
            //                        <td width='12%' height='25' align='center' bgcolor='#F8F8F8' class='zx'>编号</td>
            //                        <td width='14%' align='center' bgcolor='#F8F8F8' class='zx'>设备状态</td>
            //                        <td width='22%' align='center' bgcolor='#F8F8F8' class='zx'>设备名称</td>
            //                       <td width='16%' align='center' bgcolor='#F8F8F8' class='zx'>缩略图</td>
            //                        <td width='18%' align='center' bgcolor='#F8F8F8' class='zx'>故障统计</td>
            //                        <td width='18%' align='center' bgcolor='#F8F8F8' class='zx'>更换统计</td>
            //                      </tr>";
            //                ShebeiInfoManager sbMgr = new ShebeiInfoManager();
            //                DataTable dt_sb = sbMgr.GetWaiBuDataTable();

            //                int scount = 0;
            //                foreach (DataRow row in dt_sb.Rows)
            //                {
            //                    scount++;
            //                    if (scount > 10) break;
            //                    string img_html = string.Empty;
            //                    //OAManager.FileInfoManager flMgr = new FileInfoManager();
            //                    //DataTable dtimg = flMgr.GetDataTable(row["ID"].ToString());
            //                    //string img_html = string.Empty;
            //                    //if (dtimg.Rows.Count > 0)
            //                    //{
            //                    //    string src = dtimg.Rows[0]["FILEPATH"].ToString();
            //                    //    img_html = "<a href='" + src + "'><img src='" + src + "' width='50' height='40' alt='图标'></a>";
            //                    //}
            //                    //else
            //                    //{
            //                    //    img_html = "无缩略图";

            //                    //}

            //                    sresult += string.Format(sbtmpl, row["Code"].ToString(), row["State"].ToString(), "<a href='" + row["PATH"].ToString() + "' target='sbiframe'>" + row["Name"].ToString() + "</a>", img_html, row["GZTJ"].ToString(), row["GHTJ"].ToString());

            //                }
            //                sresult += "</tbody></table>";
            //                //sbinfo.InnerHtml = sresult;

            //                  dt_sb = sbMgr.GetNeiBuDataTable();
            //                sresult =
            //           @"<table width='100%' border='0' cellpadding='0' cellspacing='0' class='dx'>
            //                      <tbody><tr>
            //                        <td width='12%' height='25' align='center' bgcolor='#F8F8F8' class='zx'>编号</td>
            //                        <td width='14%' align='center' bgcolor='#F8F8F8' class='zx'>设备状态</td>
            //                        <td width='22%' align='center' bgcolor='#F8F8F8' class='zx'>设备名称</td>
            //                       <td width='16%' align='center' bgcolor='#F8F8F8' class='zx'>缩略图</td>
            //                        <td width='18%' align='center' bgcolor='#F8F8F8' class='zx'>故障统计</td>
            //                        <td width='18%' align='center' bgcolor='#F8F8F8' class='zx'>更换统计</td>
            //                      </tr>";
            //                  scount = 0;
            //                foreach (DataRow row in dt_sb.Rows)
            //                {
            //                    scount++;
            //                    if (scount > 10) break;
            //                    string img_html = string.Empty;
            //                    //OAManager.FileInfoManager flMgr = new FileInfoManager();
            //                    //DataTable dtimg = flMgr.GetDataTable(row["ID"].ToString());
            //                    //string img_html = string.Empty;
            //                    //if (dtimg.Rows.Count > 0)
            //                    //{
            //                    //    string src = dtimg.Rows[0]["FILEPATH"].ToString();
            //                    //    img_html = "<a href='" + src + "'><img src='" + src + "' width='50' height='40' alt='图标'></a>";
            //                    //}
            //                    //else
            //                    //{
            //                    //    img_html = "无缩略图";

            //                    //}

            //                    sresult += string.Format(sbtmpl, row["Code"].ToString(), row["State"].ToString(), "<a href='" + row["PATH"].ToString() + "' target='sbiframe'>" + row["Name"].ToString() + "</a>", img_html, row["GZTJ"].ToString(), row["GHTJ"].ToString());

            //                }
            //                sresult += "</tbody></table>";
            //                //sbnbinfo.InnerHtml = sresult;
            }
        }
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            HttpRequest rp = context.Request;
            string msg = string.Empty;
            try
            {

                if (string.IsNullOrEmpty(rp["txtID"]))
                {
                    entity.ID = Guid.NewGuid();
                }
                else
                {
                    entity.ID = new Guid(rp["txtID"]);
                    entity.RecordStatus = StatusType.update;
                }

                entity.CODE = rp["txtCODE"];

                entity.TITLE = rp["txtTITLE"];

                entity.SOURCE = rp["txtSOURCE"];

                entity.PUBDATE = rp["txtPUBDATE"];

                entity.CONTENT = rp["txtCONTENT"];

                entity.PUBUSER = rp["txtPUBUSER"];

                entity.NOTE = rp["txtNOTE"];

                entity.ISTOP = rp["txtISTOP"] == "on";

                entity.ISUSED = rp["txtISUSED"] == "on";

                //if (!string.IsNullOrEmpty(rp["txtParentId"]))//父ID传值参考
                //{
                //    entity.ParentId = new Guid(rp["txtParentId"]);
                //  }
                //  entity.IsEnable = rp["txtIsEnable"] == "on";//checkbox传值参考

                NoticeInfoManager manager = new NoticeInfoManager();
                // bool IsExit = manager.ExitCodeAndName(entity);//重复校验参考
                // if (IsExit)
                // {
                //     msg = "已存在相同编号或名称!";
                //  }
                //  else
                //  {
                manager.Save(entity);
                context.Response.Write("{\"success\":\"true\",\"ID\":\"" + entity.ID + "\"}");
                // }
            }
            catch (Exception ex)
            {
                msg = ex.Message;
            }
            if (!string.IsNullOrEmpty(msg))
            {
                byte[] bytes = Encoding.UTF8.GetBytes(msg.Replace("\r\n", "<br/>"));
                string encode = Convert.ToBase64String(bytes);
                context.Response.Write("{\"success\":\"false\",\"msg\":\"" + encode + "\"}");
            }
            context.Response.End();
        }
Beispiel #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["UserName"] != null)
            {
                hid.Value = Session["UserName"].ToString();
            }
            if (!IsPostBack)
            {
                NoticeInfoManager ntMgr = new NoticeInfoManager();
                down.InnerText = "主办单位:长清公安分局";
                string titlepix = "首页";
                switch (Request.FilePath.ToLower())
                {
                    case "/indexxjsb.aspx":
                        titlepix = "巡检设备";
                        break;
                    case "/indexkaoqin.aspx":
                        titlepix = "考勤统计";
                        break;
                    case "/indexpaigong.aspx":
                        titlepix = "派工统计";
                        break;
                    case "/indexXjsb.aspx":
                        titlepix = "巡检设备";
                        break;
                }
                ttt.Text = titlepix + "-长清公安分局运维综合管理系统";
                //NoticeInfo notice = ntMgr.GetTopText(true);
                //string s = "<a style='color:#FFFFFF; ' href='newsinfo.aspx?id={0}'>{1}</a>";

                //if (notice != null)
                //{
                //    hidZuiTopTongZhi.Value = string.Format(s, notice.ID, notice.TITLE);

                //}
                //NoticeInfo notice = ntMgr.GetTopText(false);
                //string s = "<a style='font-family:Microsoft YaHei;color:#FFFF00;font-size:24px;' href='newsinfo.aspx?id={0}'>{1}</a>";
                //if (notice != null)
                //{
                //    hidTopTongZhid.Value = string.Format(s, notice.ID, notice.TITLE);

                //}
                WorkInfoManager wkMgr = new WorkInfoManager();
                WhereClip where = WorkInfo._.Status == "制单";
                OrderByClip order = WorkInfo._.CreateDate.Desc;
                int count = 0;
                if ( Session["AllDepart"] != null)
                {
                    List<AdministrativeRegions> list =  Session["AllDepart"] as List<AdministrativeRegions>;
                    if (list != null && list.Count > 0)
                    {
                        string[] dparr = new string[list.Count];
                        for (int i = 0; i < list.Count; i++)
                        {
                            dparr[i] = list[i].ID.ToString();
                        }
                        if (WhereClip.IsNullOrEmpty(where))
                        {
                            where = ShebeiInfo._.SocrceDepart.In(dparr);

                        }
                        else
                        {
                            where = where && ShebeiInfo._.SocrceDepart.In(dparr);
                        }
                    }
                }
                DataTable dtwk = wkMgr.GetGzDataTable(1, 4, where, order, ref count, ref count);
                string s = "<a style='font-family:Microsoft YaHei;color:#FFFF00;font-size:24px;'  >{0}</a>";
                string msg = string.Empty;
                if (dtwk == null || dtwk.Rows.Count == 0)
                {
                    msg = "没有最新设备报修信息,所有报修设备信息都已派工";

                }
                else
                {
                    foreach (DataRow item in dtwk.Rows)
                    {
                        msg += item["Name"] + "(" + item["Code"] + "):" + item["Guzhang"];
                        msg += "   |   ";
                    }

                }
                hidTopTongZhid.Value =  string.Format(s, msg); ;

            }
        }