Ejemplo n.º 1
0
        private static void PosaljiFakturuKupcu(Firma sourceFirma, FirmaClient client, string v)
        {
            PrikaziSveFakture(sourceFirma, client, v);

            while (true)
            {
                Console.WriteLine("Unesite broj fakture koju zelite da posaljete kupcu (q za izlaz):");
                string id_string = Console.ReadLine();

                if (id_string == "q" || id_string == "Q")
                {
                    return;
                }

                try
                {
                    int     id   = Int32.Parse(id_string);
                    Faktura fakt = FakturaDB.GetFaktura(id);
                    if (fakt != null)
                    {
                        //client.SendCreatedInvoice(id);
                        client.PromeniStatusFakture(fakt.IDFakture, GlobalConst.STATUS_FAKTURE_POSLATA);
                        break;
                    }
                }catch (Exception e)
                {
                    Console.WriteLine("Pogresan unos. Probajte Ponovo! :)");
                }
            }
        }
Ejemplo n.º 2
0
        public static void NapraviNalogZaPrenos(Firma sourceFirma, FirmaClient client)
        {
            PrikaziSveFakture(sourceFirma, client, GlobalConst.STATUS_FAKTURE_POSLATA);

            while (true)
            {
                Console.WriteLine("Izaberi fakturu od koje hoces da napravis nalog za prenos(Q za izlaz):");
                string id_string = Console.ReadLine();
                if (id_string == "Q" || id_string == "q")
                {
                    return;
                }
                try
                {
                    int     id   = Int32.Parse(id_string);
                    Faktura fakt = FakturaDB.GetFaktura(id);
                    if (fakt != null)
                    {
                        while (true)
                        {
                            Console.WriteLine("Da li je hitno? (y/n):");
                            string odgovor = Console.ReadLine();
                            if (odgovor == "Q" || odgovor == "q")
                            {
                                return;
                            }
                            if (odgovor == "y" || odgovor == "Y" || odgovor == "n" || odgovor == "N")
                            {
                                bool hitno;
                                if (odgovor == "y" || odgovor == "Y")
                                {
                                    hitno = true;
                                }
                                else
                                {
                                    hitno = false;
                                }
                                NalogZaPlacanje nzp = generisiNZP(sourceFirma, hitno, fakt);

                                client.NapraviNalogZaPrenosK(nzp);

                                client.PromeniStatusFakture(fakt.IDFakture, GlobalConst.STATUS_FAKTURE_PLACENA);
                                break;
                            }
                        }

                        break;
                    }
                }
                catch (Exception e)
                {
                    //pass
                }
            }
        }
Ejemplo n.º 3
0
 public void PromeniStatusFakture(int idFakture, string status)
 {
     FakturaDB.PromeniStatusFakture(idFakture, status);
 }
Ejemplo n.º 4
0
 public List <Faktura> GetForCompanyAndStatus(XWS.Shared.Model.Firma firma, string status)
 {
     return(FakturaDB.GetInvoiceByStatusAndId(firma, status));
 }
Ejemplo n.º 5
0
 public void SendInvoiceProfile(Faktura sourceInvoice)
 {
     FakturaDB.MakeInvoiceProfile(sourceInvoice.IDFakture);
 }
Ejemplo n.º 6
0
 public void SendCreatedInvoice(int idFakture)
 {
     FakturaDB.SendInvoiceStatus(idFakture);
 }