예제 #1
0
        public void ToParse(string url)
        {
            try
            {
                ParserResult.ClearAll();
                TextDocument           = new FlowDocument();
                Searcher.FlagIsRuleRow = false;
                using (StreamReader document = new StreamReader(url, Encoding.Default))
                {
                    while (!document.EndOfStream)
                    {
                        string TextLine = document.ReadLine();
                        AnalysisOfTheRow(TextLine);

                        Paragraph paragraph = new Paragraph();
                        paragraph.Inlines.Add(new Bold(new Run(TextLine)));
                        TextDocument.Blocks.Add(paragraph);
                    }
                }

                GetDataEvent?.Invoke();
            }
            catch (Exception e)
            {
                if (e.Message == "No_Reles")
                {
                    MessageEvent?.Invoke("В тексте нет ни одного правила!");
                }
                else
                {
                    MessageEvent?.Invoke("Синтаксическая ошибка");
                }
            }
        }
예제 #2
0
        protected void gvItem_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            log4net.ILog logger = log4net.LogManager.GetLogger("File");
            try
            {
                if (e.NewPageIndex >= 0)
                {
                    gvItemTable.PageIndex = e.NewPageIndex;
                    AdminBLL ws = new AdminBLL();

                    GetDataEvent         _req  = new GetDataEvent();
                    GetDataEventResponse _resp = ws.GetEventData(_req);



                    int pageSize = ContextKeys.GRID_PAGE_SIZE;
                    gvItemTable.PageSize   = pageSize;
                    gvItemTable.DataSource = _resp.Eventid;

                    gvItemTable.DataBind();
                }
            }
            catch (System.Threading.ThreadAbortException)
            {
            }
            catch (Exception ex)
            {
                logger.Info(ex.Message);
            }
        }
예제 #3
0
        private void PopulatePageCntrls(String argsBGID)
        {
            Int32 iCount             = 0;
            GetDataEventResponse ret = null;

            log4net.ILog logger = log4net.LogManager.GetLogger("File");
            try
            {
                DateTime     dt;
                AdminBLL     objAdminBLL = new AdminBLL();
                GetDataEvent objGetBillingTableRequest = new GetDataEvent();

                objGetBillingTableRequest.Event_ID = argsBGID.ToString();

                objGetBillingTableRequest.WhereClause = " where Event_ID='" + argsBGID.ToString() + "'";
                ret = objAdminBLL.GetEventData(objGetBillingTableRequest);

                hdnBTID.Value   = ret.Eventid[iCount].Event_ID.ToString();
                txtEventID.Text = ret.Eventid[iCount].Event_ID.ToString();

                if (ret.Eventid[iCount].Date_From != null)
                {
                    txtFromDateUpdate.Text = ret.Eventid[iCount].Date_From.Value.ToString("MM/dd/yyyy");//"ToString().ToString(dtfi);
                }

                if (ret.Eventid[iCount].Date_to != null)
                {
                    ToDateUpdate.Text = ret.Eventid[iCount].Date_to.Value.ToString("MM/dd/yyyy");
                }

                ddlEventTypeUpdate.Text = ret.Eventid[iCount].Event_Type.ToString();

                dt = Convert.ToDateTime(ret.Eventid[iCount].Start_time);
                TimeSelector3.Date = dt;

                dt = Convert.ToDateTime(ret.Eventid[iCount].End_time);
                TimeSelector4.Date = dt;

                //RadTimePicker4.SelectedDate = dt;

                // txtpersonincharge.Text = ret.Eventid[iCount].Person_incharg.ToString();
                txtspecialreqUpdate.Text   = ret.Eventid[iCount].Special_Requirment.ToString();
                txtgaurdreqUpdate.Text     = ret.Eventid[iCount].Guard_Requirment.ToString();
                txtdutygaurdUpdate.Text    = ret.Eventid[iCount].Special_Duty.ToString();
                txtNameUpdate.Text         = ret.Eventid[iCount].Incharg_Name.ToString();
                txtNricNoUpdate.Text       = ret.Eventid[iCount].Incharg_NricNo.ToString();
                txtPositionUpdate.Text     = ret.Eventid[iCount].Incharg_position.ToString();
                txtContactUpdate.Text      = ret.Eventid[iCount].Incharg_ContactNo.ToString();
                txtSupireorNameUpdate.Text = ret.Eventid[iCount].Superior_Name.ToString();

                //string location = GetLocationNameById(ret.Eventid[iCount].Location_id.ToString());
                // drlLocationUpdate = location;
                drlLocationUpdate.SelectedValue = ret.Eventid[iCount].Location_id.ToString();
            }
            catch (Exception ex)
            {
                logger.Info(ex.Message);
            }
        }
예제 #4
0
        private void BindGridWithFilter()
        {
            log4net.ILog logger = log4net.LogManager.GetLogger("File");
            try
            {
                AdminBLL     ws     = new AdminBLL();
                GetDataEvent objReq = new GetDataEvent();
                getLocationIDByName(drlLocation.Text.Trim());
                string WhereClause = ReturnWhere();

                if (!string.IsNullOrEmpty(txtpersonincharg.Text))
                {
                    objReq.Event_ID = txtpersonincharg.Text;
                }
                if (!string.IsNullOrEmpty(txtdatefrom.Text))
                {
                    if (string.IsNullOrEmpty(txtdateto.Text))
                    {
                        objReq.Date_From = txtdatefrom.Text;
                    }
                }
                if (!string.IsNullOrEmpty(txtdateto.Text))
                {
                    if (!string.IsNullOrEmpty(txtdatefrom.Text))
                    {
                        objReq.Date_From = txtdatefrom.Text;
                        objReq.Date_From = txtdateto.Text;
                    }
                }
                if (!string.IsNullOrEmpty(drlLocation.SelectedValue))
                {
                    objReq.Location_id = drlLocation.Text;
                }
                if (!string.IsNullOrEmpty(ddlEventType.Text))
                {
                    objReq.Event_Type = ddlEventType.Text;
                }
                if (!string.IsNullOrEmpty(WhereClause))
                {
                    objReq.WhereClause = WhereClause;
                }

                GetDataEventResponse ret = ws.GetEventData(objReq);
                int pageSize             = ContextKeys.GRID_PAGE_SIZE;
                gvNewEventSearch.PageSize   = pageSize;
                gvNewEventSearch.DataSource = ret.Eventid;
                gvNewEventSearch.DataBind();
            }
            catch (Exception ex)
            {
                logger.Info(ex.Message);
            }
        }
예제 #5
0
        public override void FrameUpdate(PipelineCamera cam, ref PipelineCommandData data)
        {
            int2         res       = int2(cam.cam.pixelWidth, cam.cam.pixelHeight);
            int2         originRes = int2(cam.cam.pixelWidth, cam.cam.pixelHeight);
            GetDataEvent evt       = new GetDataEvent
            {
                res = res
            };
            AOHistoryData historyData = IPerCameraData.GetProperty <AOHistoryData, GetDataEvent>(cam, evt);

            UpdateVariable_SSAO(historyData, cam, ref data, res, originRes);
            RenderSSAO(historyData, cam, ref data, res, originRes);
        }
예제 #6
0
 public GetDataEventResponse GetEventData(GetDataEvent objGetNewEventRequest)
 {
     try
     {
         AdminDAL             objAdminDAL = new AdminDAL();
         GetDataEventResponse ret         = new GetDataEventResponse();
         List <eventAdmin>    lst         = objAdminDAL.GetEventData(objGetNewEventRequest);
         ret.Eventid = lst;
         return(ret);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #7
0
        private void BindGrid()
        {
            log4net.ILog logger = log4net.LogManager.GetLogger("File");
            try
            {
                AdminBLL             ws    = new AdminBLL();
                GetDataEvent         _req  = new GetDataEvent();
                GetDataEventResponse _resp = ws.GetEventData(_req);

                gvNewEventSearch.DataSource = _resp.Eventid;
                gvNewEventSearch.DataBind();
            }
            catch (Exception ex)
            {
                logger.Info(ex.Message);
            }
        }
예제 #8
0
        private void PopulatePageCntrls(String argsBGID)
        {
            Int32 iCount             = 0;
            GetDataEventResponse ret = null;

            log4net.ILog logger = log4net.LogManager.GetLogger("File");
            try
            {
                DateTime     dt;
                AdminBLL     objAdminBLL = new AdminBLL();
                GetDataEvent objGetBillingTableRequest = new GetDataEvent();
                objGetBillingTableRequest.Event_ID = argsBGID.ToString();

                objGetBillingTableRequest.WhereClause = " where Event_ID ='" + argsBGID.ToString() + "'";
                ret = objAdminBLL.GetEventData(objGetBillingTableRequest);

                // hdnBTID.Value = ret.Eventid[iCount].Event_ID.ToString();

                txtEventID.Text     = ret.Eventid[iCount].Event_ID.ToString();
                txtEventdate.Text   = ret.Eventid[iCount].Date_From.ToString();
                txtEventDateTo.Text = ret.Eventid[iCount].Date_to.ToString();

                txtLocation.Text  = getLocationNameById(ret.Eventid[iCount].Location_id.ToString());
                txteventtype.Text = ret.Eventid[iCount].Event_Type.ToString();

                txtpersonNRIC.Text = ret.Eventid[iCount].Incharg_NricNo.ToString();
                txtEnterName.Text  = ret.Eventid[iCount].Incharg_Name.ToString();
                txtContactNo.Text  = ret.Eventid[iCount].Incharg_ContactNo.ToString();
                txtCreatedBy.Text  = ret.Eventid[iCount].Superior_Name.ToString();

                txtdutygaurd.Text  = ret.Eventid[iCount].Special_Requirment.ToString();
                txtEnterName.Text  = ret.Eventid[iCount].Incharg_Name.ToString();
                txtpersonNRIC.Text = ret.Eventid[iCount].Incharg_NricNo.ToString();

                txtEventstartTime.Text = ret.Eventid[iCount].Start_time.ToString();
                txtEventEndTime.Text   = ret.Eventid[iCount].End_time.ToString();
                txtPosition.Text       = ret.Eventid[iCount].Incharg_position.ToString();
            }
            catch (Exception ex)
            {
                logger.Info(ex.Message);
            }
        }
예제 #9
0
        private void BindGrid()
        {
            log4net.ILog logger = log4net.LogManager.GetLogger("File");
            try
            {
                AdminBLL ws = new AdminBLL();

                GetDataEvent         _req  = new GetDataEvent();
                GetDataEventResponse _resp = ws.GetEventData(_req);

                int pageSize = ContextKeys.GRID_PAGE_SIZE;
                gvItemTable.PageSize   = pageSize;
                gvItemTable.DataSource = _resp.Eventid;
                if (_resp.Eventid.Count == 0)
                {
                }
                gvItemTable.DataBind();
            }
            catch (Exception ex)
            {
                logger.Info(ex.Message);
            }
        }
예제 #10
0
 /// <summary>
 ///     实时的加载数据函数
 /// </summary>
 /// <returns></returns>
 public void GetData()
 {
     try
     {
         IsUpdatingData = true;
         var data = GetDataEvent.Invoke(SearchFilter, PageSize, PageNum) as List <Student>;
         if (data != null)
         {
             DataList.AddRange(data);
         }
         if (_currentWorker == null)                 //防止数据导出时,界面字段有排序,频繁绘制grid时数据源变化引起空异常
         {
             _grid.RefreshDataSource();
         }
     }
     catch (Exception ex)
     {
         MsgBox.ShowError(ex);
     }
     finally
     {
         IsUpdatingData = false;
     }
 }
예제 #11
0
 public void ToParseFromTextRedactor(string text)
 {
     try
     {
         ParserResult.ClearAll();
         TextDocument = null;
         string CurrentText = text;
         int    NumberN;
         while (CurrentText.Length > 0)
         {
             if (CurrentText.Contains('\n'))
             {
                 NumberN = CurrentText.IndexOf('\n');
                 AnalysisOfTheRow(CurrentText.Substring(0, NumberN));
                 CurrentText = CurrentText.Substring(NumberN + 1);
             }
             else
             {
                 AnalysisOfTheRow(CurrentText);
                 CurrentText = "";
             }
         }
         GetDataEvent?.Invoke();
     }
     catch (Exception e)
     {
         if (e.Message == "No_Reles")
         {
             MessageEvent?.Invoke("В тексте нет ни одного правила!");
         }
         else
         {
             MessageEvent?.Invoke("Синтаксическая ошибка");
         }
     }
 }
예제 #12
0
 /// <summary>
 /// 初始化一个<see cref="ImportExcelProcess{T}"/>类型的实例
 /// </summary>
 /// <param name="config">导入配置</param>
 /// <param name="func">获取数据方法</param>
 public ImportExcelProcess(ImportConfig <T> config, GetDataEvent <T> func)
 {
     this.Config      = config;
     this.GetDataFunc = func;
 }
예제 #13
0
        private void BindGridWithFilter()
        {
            log4net.ILog logger = log4net.LogManager.GetLogger("File");
            try
            {
                AdminBLL     ws     = new AdminBLL();
                GetDataEvent objReq = new GetDataEvent();
                //getLocationIDByName(ddllocation.SelectedValue.Trim());
                getLocationIDByName1(ddllocation.Text.Trim());
                string WhereClause = ReturnWhere();

                if (!string.IsNullOrEmpty(DropDownList2.Text))
                {
                    objReq.Event_Type = DropDownList2.Text;
                }
                if (!string.IsNullOrEmpty(txtpersonincharg.Text))
                {
                    objReq.Incharg_Name = txtpersonincharg.Text;
                }
                if (!string.IsNullOrEmpty(txtdatefrom.Text))
                {
                    if (string.IsNullOrEmpty(txtdateto.Text))
                    {
                        objReq.Date_From = txtdatefrom.Text;
                    }
                }
                if (!string.IsNullOrEmpty(txtdateto.Text))
                {
                    if (!string.IsNullOrEmpty(txtdatefrom.Text))
                    {
                        objReq.Date_From = txtdatefrom.Text;
                        objReq.Date_From = txtdateto.Text;
                    }
                }

                //WhereClause by jitendra
                //if (Request.QueryString["Past"] != null)
                //{
                //    WhereClause = WhereClause + " where Date_From  <='" + DateTime.Now.ToShortDateString() + "'";
                //}
                //else
                //{
                //    WhereClause = WhereClause + " where Date_From  >='" + DateTime.Now.ToShortDateString() + "'";
                //}
                //

                if (!string.IsNullOrEmpty(WhereClause))
                {
                    objReq.WhereClause = WhereClause;
                }
                GetDataEventResponse ret = ws.GetEventData(objReq);


                int pageSize = ContextKeys.GRID_PAGE_SIZE;
                //gvItemTable.PageSize = pageSize;
                //gvItemTable.DataSource = ret.Eventid;
                //if (ret.Eventid.Count == 0)
                //{
                //  // event2.Visible = false;
                //}
                //gvItemTable.DataBind();

                //gvItemTable.PageSize = pageSize;
                gvItemTable1.DataSource = ret.Eventid;
                gvItemTable1.DataBind();

                // event2.Text = ret.Eventid.Count.ToString();
            }
            catch (Exception ex)
            {
                logger.Info(ex.Message);
            }
        }