Exemple #1
0
        public App_ScheduledAppointment(JT_TechnicianScheduleDetail scheduleDetail, SO_SalesOrderHeader salesOrderHeader)
        {
            _salesOrderNumber = salesOrderHeader.SalesOrderNo; //salesOrderHeader.SalesOrderNo;
            _workTicketNumber = scheduleDetail.WTNumber;
            _workTicketStep   = scheduleDetail.WTStep;
            _scheduleDate     = scheduleDetail.ScheduleDate;
            _startTime        = scheduleDetail.StartTime;
            _actualStartTime  = string.Empty;
            _isCurrent        = scheduleDetail.IsCurrent;

            //get scheduled end time from number of hours scheduled
            string sTime = _startTime;

            if (sTime.Length == 4)
            {
                sTime = string.Format("{0}:{1}", sTime.Substring(0, 2), sTime.Substring(2, 2));
            }
            else if (sTime.Length == 3)
            {
                sTime = string.Format("0{0}:{1}", sTime.Substring(0, 1), sTime.Substring(1, 2));
            }
            //if (int.Parse(sTime.Substring(0, 2)) >= 12) { sTime += " PM"; }
            //else { sTime += " AM"; }
            TimeSpan EndTime = TimeSpan.Parse(sTime);

            EndTime  = EndTime + TimeSpan.FromHours((double)scheduleDetail.HoursScheduled);
            _endTime = EndTime.ToString(@"hhmm");

            // Get ticket customer phone
            _phone = "";
            if (salesOrderHeader.CustomerNo != null && salesOrderHeader.CustomerNo.Length > 0)
            {
                AR_Customer cust = App.Database.GetCustomer(salesOrderHeader.CustomerNo);
                if (cust.TelephoneNo != null && cust.TelephoneNo.Length > 0)
                {
                    _phone = cust.TelephoneNo;
                    if (cust.TelephoneExt != null && cust.TelephoneExt.Length > 0)
                    {
                        _phone += " ext. " + cust.TelephoneExt;
                    }
                }
            }

            if ((salesOrderHeader.ShipToCode != null) && (salesOrderHeader.ShipToCode.Length > 0))
            {
                _name     = salesOrderHeader.ConfirmTo;
                _location = salesOrderHeader.ShipToCity + ", " + salesOrderHeader.ShipToState;
            }
            else
            {
                _name     = salesOrderHeader.BillToName;
                _location = salesOrderHeader.BillToCity + ", " + salesOrderHeader.BillToState;
            }
        }
Exemple #2
0
        public App_ScheduledAppointment(JT_TechnicianScheduleDetail scheduleDetail, SO_SalesOrderHeader salesOrderHeader)
        {
            // puke
            _salesOrderNumber = salesOrderHeader.SalesOrderNo;
            _workTicketNumber = scheduleDetail.WTNumber;
            _workTicketStep   = scheduleDetail.WTStep;
            _scheduleDate     = scheduleDetail.ScheduleDate;
            _startTime        = scheduleDetail.StartTime;
            _actualStartTime  = string.Empty;
            _isCurrent        = scheduleDetail.IsCurrent;

            // Get ticket customer phone
            _phone = "";
            if (salesOrderHeader.CustomerNo != null && salesOrderHeader.CustomerNo.Length > 0)
            {
                AR_Customer cust = App.Database.GetCustomer(salesOrderHeader.CustomerNo);
                if (cust.TelephoneNo != null && cust.TelephoneNo.Length > 0)
                {
                    _phone = cust.TelephoneNo;
                    if (cust.TelephoneExt != null && cust.TelephoneExt.Length > 0)
                    {
                        _phone += " ext. " + cust.TelephoneExt;
                    }
                }
            }

            if ((salesOrderHeader.ShipToCode != null) && (salesOrderHeader.ShipToCode.Length > 0))
            {
                _name     = salesOrderHeader.ConfirmTo;
                _location = salesOrderHeader.ShipToCity + ", " + salesOrderHeader.ShipToState;
            }
            else
            {
                _name     = salesOrderHeader.BillToName;
                _location = salesOrderHeader.BillToCity + ", " + salesOrderHeader.BillToState;
            }
        }