using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Threading.Tasks;
using Foresight;

namespace IronIntel.Contractor.FilterQ
{
    public class MachineTasksNotificationInfo
    {
        public string TaskID { get; set; }
        public string MachineID { get; set; }
        public string CurrentJob { get; set; }
        public string JobContact { get; set; }
        public string JobContactNumber { get; set; }
        public string JobAddress1 { get; set; }
        public string JobAddress2 { get; set; }
        public string JobAddressCity { get; set; }
        public string JobAddressState { get; set; }
        public string JobAddressZip { get; set; }
        public string OrgMachineCode { get; set; }
        public string ManufactuerMake { get; set; }
        public string Model { get; set; }
        public string SN { get; set; }
        public double CumulativeHours { get; set; }
        public int MachineTaskHourCheck { get; set; }
        public double DiffToService { get; set; }
        public DateTime ESTServiceNeededBy { get; set; }
        public DateTime ESTShopDate { get; set; }
        public string UPSTrackingNumber { get; set; }
        public bool RequestJREToService { get; set; }
        public bool Approved { get; set; }
        public string Priority { get; set; }
        public string CustomerPO { get; set; }
        public string CustomerWO { get; set; }
        public string AlternateAddress1 { get; set; }
        public string AlternateAddress2 { get; set; }
        public string AlternateAddressCity { get; set; }
        public string AlternateAddressState { get; set; }
        public string AlternateAddressZip { get; set; }
        public string ShipNotes { get; set; }
        public string OrganizationName { get; set; }

        public bool TaskComplete { get; set; }
        public double TaskCompletedHours { get; set; }

        public string AltJob { get; set; }
        public string AltJobSiteContact { get; set; }

        public override string ToString()
        {
            XmlDocument doc = XmlHelper.CreateXmlDocument();
            XmlHelper.AppendChildNode(doc.DocumentElement, "TaskID", TaskID);
            XmlHelper.AppendChildNode(doc.DocumentElement, "MachineID", MachineID);
            XmlHelper.AppendChildNode(doc.DocumentElement, "CurrentJob", CurrentJob);
            XmlHelper.AppendChildNode(doc.DocumentElement, "JobContact", JobContact);
            XmlHelper.AppendChildNode(doc.DocumentElement, "JobContactNumber", JobContactNumber);
            XmlHelper.AppendChildNode(doc.DocumentElement, "JobAddress1", JobAddress1);
            XmlHelper.AppendChildNode(doc.DocumentElement, "JobAddress2", JobAddress2);
            XmlHelper.AppendChildNode(doc.DocumentElement, "JobAddressCity", JobAddressCity);
            XmlHelper.AppendChildNode(doc.DocumentElement, "JobAddressState", JobAddressState);
            XmlHelper.AppendChildNode(doc.DocumentElement, "JobAddressZip", JobAddressZip);
            XmlHelper.AppendChildNode(doc.DocumentElement, "OrgMachineCode", OrgMachineCode);
            XmlHelper.AppendChildNode(doc.DocumentElement, "ManufactuerMake", ManufactuerMake);
            XmlHelper.AppendChildNode(doc.DocumentElement, "Model", Model);
            XmlHelper.AppendChildNode(doc.DocumentElement, "SN", SN);
            XmlHelper.AppendChildNode(doc.DocumentElement, "CumulativeHours", CumulativeHours.ToString());
            XmlHelper.AppendChildNode(doc.DocumentElement, "MachineTaskHourCheck", MachineTaskHourCheck.ToString());
            XmlHelper.AppendChildNode(doc.DocumentElement, "DiffToService", DiffToService.ToString());
            XmlHelper.AppendChildNode(doc.DocumentElement, "ESTServiceNeededBy", ESTServiceNeededBy.ToString());
            XmlHelper.AppendChildNode(doc.DocumentElement, "ESTShopDate", ESTShopDate.ToString());
            XmlHelper.AppendChildNode(doc.DocumentElement, "UPSTrackingNumber", UPSTrackingNumber);
            XmlHelper.AppendChildNode(doc.DocumentElement, "RequestJREToService", RequestJREToService ? "True" : "False");
            XmlHelper.AppendChildNode(doc.DocumentElement, "Approved", Approved ? "True" : "False");
            XmlHelper.AppendChildNode(doc.DocumentElement, "Priority", Priority);
            XmlHelper.AppendChildNode(doc.DocumentElement, "CustomerPO", CustomerPO);
            XmlHelper.AppendChildNode(doc.DocumentElement, "CustomerWO", CustomerWO);
            XmlHelper.AppendChildNode(doc.DocumentElement, "AlternateAddress1", AlternateAddress1);
            XmlHelper.AppendChildNode(doc.DocumentElement, "AlternateAddress2", AlternateAddress2);
            XmlHelper.AppendChildNode(doc.DocumentElement, "AlternateAddressCity", AlternateAddressCity);
            XmlHelper.AppendChildNode(doc.DocumentElement, "AlternateAddressState", AlternateAddressState);
            XmlHelper.AppendChildNode(doc.DocumentElement, "AlternateAddressZip", AlternateAddressZip);
            XmlHelper.AppendChildNode(doc.DocumentElement, "ShipNotes", ShipNotes);
            XmlHelper.AppendChildNode(doc.DocumentElement, "OrganizationName", OrganizationName);
            XmlHelper.AppendChildNode(doc.DocumentElement, "TaskComplete", TaskComplete ? "True" : "False");
            XmlHelper.AppendChildNode(doc.DocumentElement, "TaskCompletedHours", TaskCompletedHours.ToString());
            XmlHelper.AppendChildNode(doc.DocumentElement, "AltJob", AltJob);
            XmlHelper.AppendChildNode(doc.DocumentElement, "AltJobSiteContact", AltJobSiteContact);
            return doc.InnerXml;
        }


    }
}
