Exemplo n.º 1
0
        public static ISAT.Business.TicketHistory ConvertToTicketBusiness(TicketHistory m)
        {
            ISAT.Business.TicketHistory obj = ISAT.Business.TicketHistory.GetTicket(m.TicketNo);
            if (obj == null)
            {
                obj = ISAT.Business.TicketHistory.NewTicket();
            }

            obj.TicketNo          = m.TicketNo;
            obj.TicketSubject     = m.TicketSubject;
            obj.CallerPosistion   = m.CallerPosition;
            obj.Priority          = m.Priority;
            obj.TicketOwner       = m.TicketOwner;
            obj.TicketType        = m.TicketType;
            obj.TicketStatus      = m.TicketStatus;
            obj.TicketDescription = m.TicketDesc;
            obj.Solution          = Newtonsoft.Json.JsonConvert.SerializeObject(m.Solution);
            obj.Escalation        = m.Escalation;
            obj.CreatedBy         = m.CreatedBy;
            obj.CreatedDate       = m.CreatedDate;
            obj.UpdatedBy         = m.UpdatedBy;
            obj.UpdatedDate       = m.UpdatedDate;

            return(obj);
        }
Exemplo n.º 2
0
        public TicketHistory(ISAT.Business.TicketHistory ticket, ISAT.Business.Customer cust)
        {
            this.IdTicket      = ticket.idticket;
            this.TicketNo      = ticket.TicketNo;
            this.TicketSubject = ticket.TicketSubject;

            Customer newcust = new Customer()
            {
                IdCustomer  = cust.idCustomer,
                Custno      = cust.CustNo,
                FirstName   = cust.FirstName,
                LastName    = cust.LastName,
                Email       = cust.Email,
                CompanyName = cust.CompanyName,
                CreatedBy   = cust.CreatedBy,
                CreatedDate = cust.CreatedDate,
                UpdatedBy   = cust.UpdatedBy,
                UpdatedDate = cust.UpdatedDate
            };

            this.Requester      = newcust;
            this.CallerPosition = ticket.CallerPosistion;
            this.Priority       = ticket.Priority;
            this.TicketOwner    = ticket.TicketOwner;
            this.TicketType     = ticket.TicketType;
            this.TicketStatus   = ticket.TicketStatus;
            this.TicketDesc     = ticket.TicketDescription;

            this.Solution = Newtonsoft.Json.JsonConvert.DeserializeObject <List <TicketSolution> >(ticket.Solution);
            if (this.Solution == null)
            {
                this.Solution = new List <TicketSolution>();
            }
            this.Escalation  = ticket.Escalation;
            this.CreatedBy   = ticket.CreatedBy;
            this.CreatedDate = ticket.CreatedDate;
            this.UpdatedBy   = ticket.UpdatedBy;
            this.UpdatedDate = ticket.UpdatedDate;
        }