本文整理汇总了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");
}
示例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;
}
示例3: DeleteEvent
public static void DeleteEvent(int eventId, int userId)
{
using (EventManager manager = new EventManager(null))
{
manager.ResolveEvent(manager.GetEvent(eventId));
}
}