Example #1
0
        public COHeaderViewModel GetCOTourInfoHeader(ref NewQuoteViewModel model, string token)
        {
            CostingGetReq objCostingRequest = new CostingGetReq()
            {
                QRFID = model.QRFID
            };
            CostingGetRes        objCostingResponse = coProviders.GetCostingDetailsByQRFID(objCostingRequest, token).Result;
            CostingGetProperties objResult          = objCostingResponse.CostingGetProperties;

            if (objResult != null)
            {
                model.COHeaderViewModel.QRFID                  = objResult.QRFID;
                model.COHeaderViewModel.AgentID                = objResult.AgentInfo.AgentID;
                model.COHeaderViewModel.AgentName              = objResult.AgentInfo.AgentName;
                model.COHeaderViewModel.TourCode               = objResult.AgentProductInfo.TourCode;
                model.COHeaderViewModel.TourName               = objResult.AgentProductInfo.TourName;
                model.COHeaderViewModel.NoOfNights             = Convert.ToInt32(objResult.AgentProductInfo.Duration);
                model.COHeaderViewModel.NoOfDays               = Convert.ToInt32(objResult.AgentProductInfo.Duration) + 1;
                model.COHeaderViewModel.SalesPerson            = objResult.SalesOfficer;
                model.COHeaderViewModel.ContactPersonID        = objResult.AgentInfo.ContactPersonID;
                model.COHeaderViewModel.ContactPerson          = objResult.AgentInfo.ContactPerson;
                model.COHeaderViewModel.EmailAddress           = objResult.AgentInfo.EmailAddress;
                model.COHeaderViewModel.MobileNo               = objResult.AgentInfo.MobileNo;
                model.COHeaderViewModel.Destination            = objResult.AgentProductInfo.Destination;
                model.COHeaderViewModel.TravelDate             = objResult.DepartureDates.Count > 0 ? objResult.DepartureDates[0].Date : null;
                model.COHeaderViewModel.Version                = objResult.VersionId;
                model.COHeaderViewModel.Pax                    = objResult.AgentPassengerInfo.Where(a => a.Type == "ADULT").Select(b => b.count).FirstOrDefault();
                model.COHeaderViewModel.CostingOfficer         = objResult.CostingOfficer;
                model.COHeaderViewModel.ProductAccountant      = objResult.ProductAccountant;
                model.COHeaderViewModel.ValidForTravel         = objResult.ValidForTravel;
                model.COHeaderViewModel.ValidForAcceptance     = objResult.ValidForAcceptance;
                model.mdlMenuViewModel.EnquiryPipeline         = objCostingResponse.EnquiryPipeline;
                model.COHeaderViewModel.IsLinkedQRFsExist      = objCostingResponse.IsLinkedQRFsExist;
                model.COHeaderViewModel.QRFPriceID             = objResult.QRFPriceID;
                model.COHeaderViewModel.FollowUpCostingOfficer = objResult.FollowUpCostingOfficer != null ? (Convert.ToDateTime(objResult.FollowUpCostingOfficer)).ToString("dd/MMM/yyyy").Replace('-', '/') : "";
                model.COHeaderViewModel.WithClient             = objResult.FollowUpWithClient != null ? (Convert.ToDateTime(objResult.FollowUpWithClient)).ToString("dd/MMM/yyyy").Replace('-', '/') : "";
                model.COHeaderViewModel.SalesPersonMobile      = objResult.SalesOfficerMobile;
            }
            else
            {
                model.COHeaderViewModel.QRFID              = "";
                model.COHeaderViewModel.AgentName          = "";
                model.COHeaderViewModel.TourCode           = "";
                model.COHeaderViewModel.TourName           = "";
                model.COHeaderViewModel.NoOfNights         = 0;
                model.COHeaderViewModel.NoOfDays           = 0;
                model.COHeaderViewModel.SalesPerson        = "";
                model.COHeaderViewModel.ContactPerson      = "";
                model.COHeaderViewModel.Destination        = "";
                model.COHeaderViewModel.TravelDate         = DateTime.MinValue;
                model.COHeaderViewModel.Version            = 0;
                model.COHeaderViewModel.Pax                = 0;
                model.COHeaderViewModel.CostingOfficer     = "";
                model.COHeaderViewModel.ValidForTravel     = "";
                model.COHeaderViewModel.ValidForAcceptance = "";
                model.COHeaderViewModel.IsLinkedQRFsExist  = false;
                model.COHeaderViewModel.QRFPriceID         = "";
            }

            return(model.COHeaderViewModel);
        }