Exemplo n.º 1
0
 protected void odsEventsViewer_Deleting(object sender, ObjectDataSourceMethodEventArgs e)
 {
     Vivina.Erp.DataClasses.Event _event = new Vivina.Erp.DataClasses.Event();
     _event.EventId       = (Int32)e.InputParameters["EventId"];
     _event.EventType     = (Int32)e.InputParameters["EventType"];
     _event.Name          = (String)e.InputParameters["Name"];
     _event.Source        = (String)e.InputParameters["Source"];
     _event.Message       = (String)e.InputParameters["Message"];
     _event.Path          = (String)e.InputParameters["Path"];
     _event.StackTrace    = (String)e.InputParameters["StackTrace"];
     _event.RefererUrl    = (String)e.InputParameters["RefererUrl"];
     _event.HelpLink      = (String)e.InputParameters["HelpLink"];
     _event.TargetSite    = (String)e.InputParameters["TargetSite"];
     _event.CurrentDate   = (DateTime)e.InputParameters["CurrentDate"];
     _event.ExceptionCode = (String)e.InputParameters["ExceptionCode"];
     _event.ApplicationId = (Int32)e.InputParameters["ApplicationId"];
     _event.UserId        = (Int32)e.InputParameters["UserId"];
     //  _event.TechnicalUserId = (Int32?)e.InputParameters["TechnicalUserId"];
     //  _event.CompanyId = (Int32?)e.InputParameters["CompanyId"];
     _event.EventStatusId = (Int32?)e.InputParameters["EventStatusId"];
     _event.Version       = (String)e.InputParameters["Version"];
     _event.Module        = (String)e.InputParameters["Module"];
     e.InputParameters.Clear();
     e.InputParameters.Add("entity", _event);
     //e.InputParameters.Add("technicalUserId", User.Identity.UserId);
 }
Exemplo n.º 2
0
 /// <summary>
 /// This method inserts a new record in the table.
 /// Change this method to alter how records are inserted.
 /// </summary>
 /// <param name=entity>entity</param>
 public void Insert(Event entity)
 {
     entity.EventStatusId = EventStatus.Opened;
     entity.CurrentDate   = DateTime.Now;
     DbContext.Events.InsertOnSubmit(entity);
     DbContext.SubmitChanges();
 }
Exemplo n.º 3
0
 /// <summary>
 /// this method resolve(set isClosed) in event
 /// </summary>
 /// <param name="entity"></param>
 public void ResolveEvent(Event entity)
 {
     //entity = GetEvent(entity.EventId);
     //if (!entity.TechnicalUserId.HasValue)
     //    entity.TechnicalUserId = technicalUserId;
     entity.EventStatusId = EventStatus.Closed;
     DbContext.SubmitChanges();
 }
Exemplo n.º 4
0
    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");
    }
Exemplo n.º 5
0
 /// <summary>
 /// This method updates a record in the table.
 /// Change this method to alter how records are updated.
 /// </summary>
 /// <param name=original_entity>original_entity</param>
 /// <param name=entity>entity</param>
 public void Update(Event original_entity, Event entity)
 {
     original_entity.CopyPropertiesFrom(entity);
     DbContext.SubmitChanges();
 }
Exemplo n.º 6
0
 /// <summary>
 /// This method deletes a record in the table.
 /// Change this method to alter how records are deleted.
 /// </summary>
 /// <param name=entity>entity</param>
 public void Delete(Event entity)
 {
     DbContext.Events.Attach(entity);
     DbContext.Events.DeleteOnSubmit(entity);
     DbContext.SubmitChanges();
 }
 protected void odsEventsViewer_Deleting(object sender, ObjectDataSourceMethodEventArgs e)
 {
     Vivina.Erp.DataClasses.Event _event = new Vivina.Erp.DataClasses.Event();
     _event.EventId = (Int32)e.InputParameters["EventId"];
     _event.EventType = (Int32)e.InputParameters["EventType"];
     _event.Name = (String)e.InputParameters["Name"];
     _event.Source = (String)e.InputParameters["Source"];
     _event.Message = (String)e.InputParameters["Message"];
     _event.Path = (String)e.InputParameters["Path"];
     _event.StackTrace = (String)e.InputParameters["StackTrace"];
     _event.RefererUrl = (String)e.InputParameters["RefererUrl"];
     _event.HelpLink = (String)e.InputParameters["HelpLink"];
     _event.TargetSite = (String)e.InputParameters["TargetSite"];
     _event.CurrentDate = (DateTime)e.InputParameters["CurrentDate"];
     _event.ExceptionCode = (String)e.InputParameters["ExceptionCode"];
     _event.ApplicationId = (Int32)e.InputParameters["ApplicationId"];
     _event.UserId = (Int32)e.InputParameters["UserId"];
   //  _event.TechnicalUserId = (Int32?)e.InputParameters["TechnicalUserId"];
   //  _event.CompanyId = (Int32?)e.InputParameters["CompanyId"];
     _event.EventStatusId = (Int32?)e.InputParameters["EventStatusId"];
     _event.Version = (String)e.InputParameters["Version"];
     _event.Module = (String)e.InputParameters["Module"];
     e.InputParameters.Clear();
     e.InputParameters.Add("entity", _event);
     //e.InputParameters.Add("technicalUserId", User.Identity.UserId);
 }
Exemplo n.º 8
0
    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");
        }
    }