public DeleteIzvodjac()
 {
     _izvodjac = new IzvodjacDTO();
     _load     = new LoadDTO();
     _engine   = new Engine();
     _read     = new ReadIzvodjac();
 }
Esempio n. 2
0
 public UpdateAlbum()
 {
     _album  = new AlbumDTO();
     _load   = new LoadDTO();
     _engine = new Engine();
     _read   = new ReadAlbum();
 }
 public UpdateFonogram()
 {
     _fonogram = new FonogramDTO();
     _load     = new LoadDTO();
     _engine   = new Engine();
     _read     = new ReadFonogram();
 }
Esempio n. 4
0
 void Play()
 {
     LoadDTO_OBJ = GameObject.FindGameObjectWithTag("LoadDTO");
     loadDTO     = LoadDTO_OBJ.GetComponent <LoadDTO>();
     touch_Manager.Set_swipe_distance(loadDTO.Get_Swipe_distance());
     music_Load.To_be_load(loadDTO.Get_filesName());
     Destroy(LoadDTO_OBJ);
 }
Esempio n. 5
0
        public static LoadDB Cast(LoadDTO load)
        {
            var newObject = new LoadDB()
            {
                IdLoad                = load.IdLoad,
                Shipments             = Cast(load.Shipments),
                StopsLoad             = load.StopsLoad,
                TotalDistanceLoad     = load.TotalDistanceLoad,
                TruckLoad             = load.TruckLoad,
                QuantityShipmentsLoad = load.QuantityShipmentsLoad,
                TotalCostLoad         = load.TotalCostLoad
            };

            return(newObject);
        }
Esempio n. 6
0
    void Load()
    {
        LoadDTO_OBJ = GameObject.FindGameObjectWithTag("LoadDTO");
        loadDTO     = LoadDTO_OBJ.GetComponent <LoadDTO>();
        string filepath;

        filepath = file_load.Filepath_decide(0, loadDTO.Get_filesName(), loadDTO.Get_filesName() + ".pxbp");
        string[] pxbp = file_load.Load_file(filepath);
        if (pxbp != null)
        {
            pxbp_Load.To_be_load(pxbp);
            Score_load.Main_Load_score(loadDTO.Get_HS(), loadDTO.Get_startOffset(), loadDTO.Get_perfectOffset(), loadDTO.Get_filesName(), loadDTO.Get_Swipe_distance());
            if (Debug_not_scene_change == false)
            {
                SceneManager.LoadScene("Play");
            }
        }
    }
Esempio n. 7
0
    void To_be_load()
    {
        LoadDTO_OBJ = GameObject.FindGameObjectWithTag("LoadDTO");
        loadDTO     = LoadDTO_OBJ.GetComponent <LoadDTO>();
        string filepath;

        filepath = File_load.Filepath_decide(0, loadDTO.Get_filesName(), loadDTO.Get_filesName() + ".pxbp");
        pxbp     = File_load.Load_file(filepath);
        if (pxbp != null)
        {
            pxbp_Load.Load_json(pxbp[0]);
            pxbp_Load.Insert_Header();
            pxbp_Load.Insert_BPM_List();
            pxbp_Load.Insert_notes_List();
            Score_load.Main_Load_score(loadDTO.Get_HS(), loadDTO.Get_startOffset(), loadDTO.Get_perfectOffset(), loadDTO.Get_filesName());
            Destroy(LoadDTO_OBJ);
            UnityEngine.SceneManagement.SceneManager.LoadScene("Play");
        }
    }
Esempio n. 8
0
        public static IList <LoadDTO> Cast(IEnumerable <LoadDB> loads)
        {
            var loadList = new List <LoadDTO>();

            foreach (var load in loads)
            {
                var cast = new LoadDTO()
                {
                    IdLoad                = load.IdLoad,
                    Shipments             = Cast(load.Shipments),
                    StopsLoad             = load.StopsLoad,
                    TotalDistanceLoad     = load.TotalDistanceLoad,
                    TruckLoad             = load.TruckLoad,
                    QuantityShipmentsLoad = load.QuantityShipmentsLoad,
                    TotalCostLoad         = load.TotalCostLoad
                };
                loadList.Add(cast);
            }

            return(loadList);
        }
Esempio n. 9
0
        private LoadDTO GetLoadDTOFromLine(string line, int rowIndex)
        {
            try
            {
                var lineSegments          = line.Split("|");
                var batchTPCode           = lineSegments[0];
                var clientTPCode          = lineSegments[1];
                var clientName            = lineSegments[2];
                var clientEmail           = lineSegments[3];
                var contractDate          = DateTime.ParseExact(lineSegments[4], DateTimeFormats.DateFormat, System.Globalization.CultureInfo.InvariantCulture);
                var chasisNumber          = lineSegments[5];
                var invoiceDocumentNumber = lineSegments[6];
                var invoiceDate           = DateTime.ParseExact(lineSegments[7], DateTimeFormats.DateFormat, System.Globalization.CultureInfo.InvariantCulture);
                var batchAmount           = double.Parse(lineSegments[8]);
                var batchCurrency         = lineSegments[9];
                var contactName           = lineSegments[10];
                var contractType          = lineSegments[11] == "A" ? TPContractType.Addendum : TPContractType.Contract;
                var contractNumber        = lineSegments[12];
                var clientRuc             = lineSegments[13];
                var contactPhone          = lineSegments[14];
                var contactEmail          = lineSegments[15];
                var contactDocumentNumber = lineSegments[16];
                var dealerCode            = lineSegments[17];
                var dealerName            = lineSegments[18];
                var businessCode          = lineSegments[19];
                var businessDescription   = lineSegments[20];
                var cardTypeCode          = lineSegments[21];
                var cardTypeDescription   = lineSegments[22];
                var clientAddress         = "Mi direccion 1234";
                var clientPhone           = "987654321";
                var contactLastName       = "Apellidos";

                var client = new ClientDTO()
                {
                    Ruc     = clientRuc,
                    Address = clientAddress,
                    Email   = clientEmail,
                    Name    = clientName,
                    Phone   = clientPhone,
                    TPCode  = clientTPCode
                };

                var contact = new ContactDTO()
                {
                    FirstName      = contactName,
                    LastName       = contactLastName,
                    Phone          = contactPhone,
                    Email          = contactEmail,
                    DocumentType   = DocumentType.DNI,
                    DocumentNumber = contactDocumentNumber,
                };

                var cardType = _cardTypeRepository.Filter(ct => ct.TPCode == cardTypeCode).FirstOrDefault();

                if (cardType == null)
                {
                    throw new InvalidOperationException(_resources.GetStringResource(LocalizationKeys.Application.exception_InvalidCardTypeCode));
                }

                var card = new CardDTO()
                {
                    CardTypeId = cardType.Id,
                    TPCode     = batchTPCode,
                };

                var batch = new BatchDTO()
                {
                    Amount              = new MoneyDTO((Currency)Enum.Parse(typeof(Currency), batchCurrency), batchAmount),
                    TPContractDate      = contractDate,
                    TPChasis            = chasisNumber,
                    TPInvoiceDate       = invoiceDate,
                    TPInvoiceCode       = invoiceDocumentNumber,
                    TPContractType      = contractType,
                    TPContractNumber    = contractNumber,
                    DealerCode          = dealerCode,
                    DealerName          = dealerName,
                    BusinessCode        = businessCode,
                    BusinessDescription = businessDescription
                };

                var load = new LoadDTO()
                {
                    Batch    = batch,
                    Card     = card,
                    Client   = client,
                    Contact  = contact,
                    RowIndex = rowIndex
                };

                return(load);
            }
            catch (Exception e)
            {
                return(new LoadDTO()
                {
                    ErrorMessage = e.Message,
                    RowIndex = rowIndex
                });
            }
        }
Esempio n. 10
0
 public async void DeleteSelectedItem(LoadDTO loadDTO)
 {
     loadDTO.Id = (Convert.ToInt32(loadDTO.Id) - 1).ToString();
     await client.DeleteAsync("TeachersLoad/" + loadDTO.Id);
 }
Esempio n. 11
0
        public MemoryStream LoadOfferPdf(LoadDTO loadDTO)
        {
            var ms  = new MemoryStream();
            var doc = this.DefaultPdfDoc(ms);



            var tblNaglowek = this.HederCompanyGen(loadDTO.Sell.Principal, "Zleceniodawca", loadDTO.Sell.Selling_info.Company, "Zleceniobiorca/Przewoźnik", $"Zlecenie przewozowe nr {loadDTO.LoadNo}");

            var tblRoutes = new Table(UnitValue.CreatePercentArray(new float[] { 2, 2, 2, 2, 1, 1, 2, 2 })); //8 cols


            int   routeIdx      = 1;
            float routeFontSize = 8f;

            foreach (var route in loadDTO.Buy.Routes)
            {
                var palletsCount = route.Pallets.Count;

                tblRoutes.AddCell(FakCell($"{routeIdx}) {route.Loading_type}", null, routeFontSize * 1f, TextAlignment.LEFT, 1 + palletsCount, 1));
                tblRoutes.AddCell(FakCell($"{route.Loading_date.ToShortDateString()} {route.Loading_date.ToShortTimeString()}", null, routeFontSize, TextAlignment.LEFT, 1, 1));
                tblRoutes.AddCell(FakCell(route.Address.AddressCombined, null, routeFontSize, TextAlignment.LEFT, 1, 2));
                //pallets count>0 1st row
                if (route.Pallets.Count > 0)
                {
                    tblRoutes.AddCell(FakCell("Typ palety", null, routeFontSize * 0.5f, TextAlignment.CENTER, 1, 1).SetFontColor(ColorConstants.GRAY));
                    tblRoutes.AddCell(FakCell("Ilość", null, routeFontSize * 0.5f, TextAlignment.CENTER, 1, 1).SetFontColor(ColorConstants.GRAY));
                    tblRoutes.AddCell(FakCell("Info", null, routeFontSize * 0.5f, TextAlignment.CENTER, 1, 2).SetFontColor(ColorConstants.GRAY));
                }
                else
                {
                    //tblNaglowek.AddCell(PustaCell(1, 3));
                    tblRoutes.AddCell(FakCell(route.Info, null, routeFontSize * 0.8f, TextAlignment.LEFT, 1, 5));
                }


                //pallets count>0 2nd row
                if (route.Pallets.Count > 0)
                {
                    int palletIdx = 0;
                    foreach (var pallet in route.Pallets)
                    {
                        List <string> routeInfoArr = new List <string>();
                        string        rInfo;
                        string        routeInfo;

                        if (!string.IsNullOrWhiteSpace(pallet.Info))
                        {
                            routeInfoArr.Add(pallet.Info);
                        }
                        if (pallet.Type.Value == "other")
                        {
                            routeInfoArr.Add(pallet.Dimmension);
                        }
                        if (pallet.Type.Value == "other" && pallet.Is_exchangeable.HasValue && pallet.Is_exchangeable.Value)
                        {
                            routeInfoArr.Add("wymienialna");
                        }
                        if (pallet.Type.Value == "other" && pallet.Is_stackable.HasValue && pallet.Is_stackable.Value)
                        {
                            routeInfoArr.Add("piętrowalna");
                        }
                        rInfo     = string.Join(", ", routeInfoArr);
                        routeInfo = palletIdx == 0 ? route.Info : null;

                        tblRoutes.AddCell(FakCell(routeInfo, null, routeFontSize * 0.8f, TextAlignment.LEFT, 1, 3));
                        tblRoutes.AddCell(FakCell(pallet.Type.Value, null, routeFontSize * 0.8f, TextAlignment.CENTER, 1, 1));
                        tblRoutes.AddCell(FakCell(pallet.Amount.ToString(), null, routeFontSize * 0.8f, TextAlignment.CENTER, 1, 1));
                        tblRoutes.AddCell(FakCell(rInfo, null, routeFontSize * 0.8f, TextAlignment.CENTER, 1, 2));

                        palletIdx++;
                    }
                }

                routeIdx++;
                tblRoutes.AddCell(EmptyCell(1, 8).SetBorderTop(new SolidBorder(ColorConstants.LIGHT_GRAY, 1, 0.5f)));
            }

            var           extraInfo = loadDTO.Buy.Load_info.ExtraInfo;
            List <string> infoArr   = new List <string>();

            infoArr.Add(extraInfo.Required_truck_body.ViewValue);
            if (extraInfo.Is_for_clearence.HasValue && extraInfo.Is_for_clearence.Value)
            {
                infoArr.Add("do oclenia (for clearence)");
            }
            if (extraInfo.Is_ltl.HasValue && extraInfo.Is_ltl.Value)
            {
                infoArr.Add("doładunek (LTL)");
            }
            if (extraInfo.Is_lift_required.HasValue && extraInfo.Is_lift_required.Value)
            {
                infoArr.Add("wymagana winda (lift)");
            }
            if (extraInfo.Is_tir_cable_required.HasValue && extraInfo.Is_tir_cable_required.Value)
            {
                infoArr.Add("wymagana linka celna (tir cable)");
            }
            if (extraInfo.Is_tracking_system_required.HasValue && extraInfo.Is_tracking_system_required.Value)
            {
                infoArr.Add("wymagany GPS");
            }
            if (extraInfo.Is_truck_crane_required.HasValue && extraInfo.Is_truck_crane_required.Value)
            {
                infoArr.Add("gotowy do załadunku (truck crane)");
            }
            if (extraInfo.Required_adr_classes.Count > 0)
            {
                var adr = extraInfo.Required_adr_classes.Select(s => s.ViewValue.Trim().ToLower()).ToList();
                infoArr.Add($"ADR:  ({string.Join(", ", adr)})");
            }
            if (extraInfo.Type_of_load != null)
            {
                infoArr.Add(extraInfo.Type_of_load.ViewValue);
            }
            var loadInfo = loadDTO.Buy.Load_info;

            if (loadInfo.Load_height.HasValue && loadInfo.Load_length.HasValue && loadInfo.Load_volume.HasValue)
            {
                infoArr.Add($"Wymiary ładunku: wys/dł/obj/ciężar ({loadInfo.Load_height.Value}/{loadInfo.Load_length.Value}/{loadInfo.Load_volume.Value}/{loadInfo.Load_weight})");
            }



            float  headerFontSize = 8f;
            string wartosc        = loadDTO.Sell.Selling_info.Price.Price.ToString("0.00");

            doc.Add(tblNaglowek);
            doc.Add(HeaderCell($"Stawka frachtowa: {wartosc} {loadDTO.Sell.Selling_info.Price.Currency.Name}, termin płatności: {loadDTO.Sell.Selling_info.PaymentTerms.PaymentDays.Value} dni, ALL-IN", headerFontSize));

            doc.Add(HeaderCell("Kontakt", headerFontSize));
            doc.Add(FakCell($"PO ZAŁADUNKU I ROZŁADUNKU PROSZĘ O SMS NA NR {loadDTO.Sell.ContactPersonsList.FirstOrDefault().Telephone} !!!! Przewoźnik ma obowiązek udzielania informacji o aktualnym położeniu samochodu,  brak tych informacji spowoduje obniżenie frachtu o 50 euro ! Kierowca ma obowiązek zweryfikować towar podczas załadunku pod względem jakościowym i ilościowym, a wszystkie zastrzeżenia co do jego jakości muszą być wpisane w dokument CMR. ", null, 6f, TextAlignment.LEFT, 1, 1));
            foreach (var contactPerson in loadDTO.Sell.ContactPersonsList.ToList())
            {
                doc.Add(FakCell(contactPerson.CompanyEmployeeInfo, null, routeFontSize, TextAlignment.LEFT, 1, 1));
            }

            doc.Add(HeaderCell("Trasa:", headerFontSize));
            doc.Add(tblRoutes);
            doc.Add(HeaderCell("Info", headerFontSize));
            doc.Add(FakCell($"[{string.Join(", ", infoArr)}]", "extra info", routeFontSize, TextAlignment.LEFT, 1, 1));

            //regulamin
            int   regIdx      = 1;
            float regFontSize = 6f;

            doc.Add(HeaderCell("Ogólne warunki zlecenia", headerFontSize));
            foreach (var reg in this.Regulamin())
            {
                doc.Add(FakCell(reg, $"{ regIdx})", regFontSize, TextAlignment.LEFT, 1, 1));
                regIdx++;
            }



            doc.Close();
            return(ms);
        }
Esempio n. 12
0
 public async Task AddLoad([FromBody] LoadDTO Load)
 {
     var load = _mapper.Map <LoadDTO, Load>(Load);
     await _LoadService.AddLoad(load);
 }