当前位置: 首页>>代码示例>>C#>>正文


C# EventManager.GetEvent方法代码示例

本文整理汇总了C#中EventManager.GetEvent方法的典型用法代码示例。如果您正苦于以下问题:C# EventManager.GetEvent方法的具体用法?C# EventManager.GetEvent怎么用?C# EventManager.GetEvent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EventManager的用法示例。


在下文中一共展示了EventManager.GetEvent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: btnSave_Click

    protected void btnSave_Click(object sender, EventArgs e)
    {
        //
        //verify if exists selected event type 
        //
        if (!(rbtAlert.Checked || rbtInformation.Checked || rbtSugestion.Checked || rbtError.Checked))
        {
            ShowError(Resources.Exception.UnselectedEventType);
            return;
        }

        EventManager eventManager = new EventManager(this);
        Vivina.Erp.DataClasses.Event ev = new Vivina.Erp.DataClasses.Event();
        Vivina.Erp.DataClasses.Event original_ev = new Vivina.Erp.DataClasses.Event();

        if (Page.ViewState["EventId"] != null)
        {
            original_ev = eventManager.GetEvent(Convert.ToInt32(Page.ViewState["EventId"]));
            ev.CopyPropertiesFrom(original_ev);
        }

       // ev.CompanyId = Company.CompanyId;
        ev.Name = txtName.Text;
        ev.Message = txtMessage.Value;
        ev.ApplicationId = Application.ApplicationId;
        ev.Rating = rtnPriority.CurrentRating;
        //if (!String.IsNullOrEmpty(cboTechnicalUser.SelectedValue))
        //    ev.TechnicalUserId = Convert.ToInt32(cboTechnicalUser.SelectedValue);
        if (!String.IsNullOrEmpty(cboEventStatus.SelectedValue))
            ev.EventStatusId = Convert.ToInt32(cboEventStatus.SelectedValue);

        //set event type
        if (rbtAlert.Checked)
            ev.EventType = (Int32)InfoControl.Web.Auditing.EventType.Warning;
        if (rbtInformation.Checked)
            ev.EventType = (Int32)InfoControl.Web.Auditing.EventType.Information;
        if (rbtSugestion.Checked)
            ev.EventType = (Int32)InfoControl.Web.Auditing.EventType.Sugestion;



        //verify if is update or insert
        if (Page.ViewState["EventId"] != null)
            eventManager.Update(original_ev, ev);
        else
        {
            //where insert mode set creator's ID
            ev.UserId = User.Identity.UserId;
            eventManager.Insert(ev);
        }

        if (Company.CompanyId == HostCompany.CompanyId)
            Server.Transfer("EventViewer.aspx");
        else
            Server.Transfer("../Site/1/WishList.aspx");
    }
开发者ID:sidneylimafilho,项目名称:InfoControl,代码行数:56,代码来源:EventAdd.aspx.cs

示例2: loadEvent

    private void loadEvent(int eventId)
    {
        EventManager eventManager = new EventManager(this);
        Event eventEntity = new Event();

        eventEntity = eventManager.GetEvent(eventId);
        
        Comments.SubjectId = eventId;
        Comments.Visible = true; 
        if (Convert.ToInt32(eventEntity.EventStatusId) == (Int32)InfoControl.Web.Auditing.EventType.Error)
        {
            tblMessage.Visible = false;
            tblName.Visible = false;
            dvException.Visible = true;
            rbtAlert.Enabled = rbtError.Enabled = rbtInformation.Enabled = rbtSugestion.Enabled = false;
        }
        else
            rbtAlert.Enabled = rbtError.Enabled = rbtInformation.Enabled = rbtSugestion.Enabled = true;

        tblProcess.Visible = tblPriority.Visible = Company.CompanyId == HostCompany.CompanyId;

        txtName.Text = eventEntity.Name;
        ltrErrorMessage.Text = eventEntity.Message;

        cboEventStatus.SelectedValue = Convert.ToString(eventEntity.EventStatusId);
        rtnPriority.CurrentRating = Convert.ToInt32(eventEntity.Rating);

  
        lnkOpenModal.NavigateUrl = "javascript:void(0);";
        

        ltrCurrentDate.Text = Convert.ToString(eventEntity.CurrentDate);
        ltrPath.Text = eventEntity.Path;
        txtMessage.Value = eventEntity.Message;
        ltrStackTrace.Text = eventEntity.StackTrace;
        ltrUserName.Text = eventEntity.User != null ? eventEntity.User.UserName : String.Empty;

        if (Convert.ToInt32(eventEntity.EventType) == (Int32)InfoControl.Web.Auditing.EventType.Warning)
            rbtAlert.Checked = true;
        if (Convert.ToInt32(eventEntity.EventType) == (Int32)InfoControl.Web.Auditing.EventType.Information)
            rbtInformation.Checked = true;
        if (Convert.ToInt32(eventEntity.EventType) == (Int32)InfoControl.Web.Auditing.EventType.Sugestion)
            rbtSugestion.Checked = true;
        if (Convert.ToInt32(eventEntity.EventType) == (Int32)InfoControl.Web.Auditing.EventType.Error)
            rbtError.Checked = true;
    }
开发者ID:sidneylimafilho,项目名称:InfoControl,代码行数:46,代码来源:EventAdd.aspx.cs

示例3: DeleteEvent

 public static void DeleteEvent(int eventId, int userId)
 {
     using (EventManager manager = new EventManager(null))
     {
         manager.ResolveEvent(manager.GetEvent(eventId));
     }
 }
开发者ID:sidneylimafilho,项目名称:InfoControl,代码行数:7,代码来源:EventViewer.aspx.cs


注:本文中的EventManager.GetEvent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。