Exemplo n.º 1
0
        public ActionResult ObjednavkaPotvrzeni(ObjednavkaViewModel data, FormCollection form)
        {
            var _sluzba = form["sluzba"];

            if (Devmasters.TextUtil.IsNumeric(_sluzba)
                &&
                !Enum.IsDefined(typeof(HlidacStatu.Lib.Data.InvoiceItems.ShopItem), Convert.ToInt32(_sluzba))
                )
            {
                return(Redirect("/Cenik"));
            }

            int sluzba = Convert.ToInt32(_sluzba);

            var inv = HlidacStatu.Lib.Data.Invoices.CreateNew(
                (HlidacStatu.Lib.Data.InvoiceItems.ShopItem)sluzba,
                data.Adresa,
                data.Mesto, data.JmenoFirmy, data.ICO, data.JmenoOsoby, data.DIC, data.PSC,
                this.User.Identity.GetUserId(), this.User.Identity.GetUserName(),
                true

                );

            return(View(sluzba));
        }
Exemplo n.º 2
0
        public ActionResult Objednavka2(FormCollection form)
        {
            var _sluzba = form["sluzba"];

            if (Devmasters.TextUtil.IsNumeric(_sluzba)
                &&
                !Enum.IsDefined(typeof(HlidacStatu.Lib.Data.InvoiceItems.ShopItem), Convert.ToInt32(_sluzba))
                )
            {
                return(Redirect("/Cenik"));
            }

            int sluzba = Convert.ToInt32(form["sluzba"]);

            HlidacStatu.Lib.Data.InvoiceItems.ShopItem sluzbaN = (HlidacStatu.Lib.Data.InvoiceItems.ShopItem)sluzba;

            ViewBag.Sluzba = sluzba;
            ViewBag.ICO    = form["ICO"];
            HlidacStatu.Lib.Data.External.Merk.CoreCompanyStructure f = null;
            if (!string.IsNullOrEmpty(form["ICO"]))
            {
                f = HlidacStatu.Lib.Data.External.Merk.FromIcoFull(form["ICO"]);
            }

            var obj = new ObjednavkaViewModel();



            if (f != null)
            {
                obj.ICO        = HlidacStatu.Util.ParseTools.MerkIcoToICO(f.regno.ToString());
                obj.JmenoFirmy = f.name;
                obj.DIC        = f.vatno;
                obj.Adresa     = f.address.street + " " + f.address.number_descriptive;
                obj.Mesto      = f.address.municipality;
                obj.PSC        = f.address.postal_code.ToString();
            }

            return(View(obj));
        }