Пример #1
0
    public void PostionShow(string command, decimal Id)
    {
        try
        {
            var mp1 = dc.Moveplan.First(p => p.Id == Id);
            if (mp1.Movestate != "已走动")
            {
                Ext.Msg.Alert("提示", "尚未走动,不能查看").Show();
                return;
            }
            if (mp1.Movestarttime == null)
            {
                Ext.Msg.Alert("提示", "手动闭合计划,不能查看").Show();
                return;
            }

            string historysql = string.Format("SELECT short_name, stateflag,person_name, entertime_mine, outtime_mine, trackblock, station_mark FROM v_jykj_history where remark2='{0}' and entertime_mine>='{1}' and entertime_mine<='{2}' order by entertime_mine desc;",
                                              mp1.Personid.Trim().PadLeft(7, '0'),
                                              mp1.Movestarttime.Value.ToString("yyyy-MM-dd") + " 00:00:00",
                                              mp1.Movestarttime.Value.ToString("yyyy-MM-dd") + " 23:59:59");
            PostGreSQLHelper pgh = new PostGreSQLHelper();

            string    msg       = "<B><font color=\"orange\">" + mp1.Movestarttime.Value.ToString("yyyy年MM月dd日") + "下井信息</font></B><HR>";
            DataTable dthistory = pgh.ExecuteQuery(historysql).Tables[0];
            if (dthistory.Rows.Count > 0)
            {
                msg += "历史状态:已出井<p>";
                msg += "入井时间:" + dthistory.Rows[0]["entertime_mine"].ToString() + "<p>";
                msg += "出井时间:" + dthistory.Rows[0]["outtime_mine"].ToString() + "<p>";
                msg += "轨迹信息:<p>";
                if (dthistory.Rows[0]["station_mark"].ToString().Trim() == "")
                {
                    msg += "无<p>";
                }
                else
                {
                    string[] group = dthistory.Rows[0]["trackblock"].ToString().Trim().Split(',');
                    foreach (var r in group)
                    {
                        string[] row = r.Split('&');
                        msg += row[1] + "到达" + pgh.GetPointNameNote(row[0]) + "<p>";
                    }
                    //msg += dthistory.Rows[0]["station_mark"].ToString().Trim().Replace(",", "<p>").Replace("*", "到达时间:");
                }
            }
            else
            {
                msg += "无";
            }

            SearchBLWindow.Html = msg;
            //SearchBLStore.DataSource = pgh.ExecuteQuery(historysql).Tables[0];
            //SearchBLStore.DataBind();
            SearchBLWindow.Show();
        }
        catch
        {
            Ext.Msg.Alert("出错提醒", "查询超时或没有信息!").Show();
        }
    }
Пример #2
0
    protected void SearchBLDblClick(object sender, AjaxEventArgs e)
    {
        RowSelectionModel sm = gpSearchBL.SelectionModel.Primary as RowSelectionModel;

        if (sm.SelectedRows.Count > 0)
        {
            //var yh = from hd in dc.Gethazardusing
            //         where hd.HNumber == sm.SelectedRow.RecordID && hd.Deptnumber == SessionBox.GetUserSession().DeptNumber
            //         select new
            //         {
            //             yhNumber = hd.HNumber,
            //             yhContent = hd.SwBm
            //         };
            //修改多列显示
            var yh = from hd in dc.Gethazardusing
                     where hd.HNumber == sm.SelectedRow.RecordID && hd.Deptnumber == SessionBox.GetUserSession().DeptNumber
                     select new
            {
                yhNumber  = hd.HNumber,
                yhContent = hd.HBm,
                hd.Gzrwname,
                hd.Gxname
            };
            yhStore.DataSource = yh;
            yhStore.DataBind();
            cbbSWcontent.SelectedItem.Value = sm.SelectedRow.RecordID;
            SearchBLWindow.Hide();
            Ext.DoScript("#{cbbSWcontent}.triggers[0].show();");
            SelectLoad();
        }
    }