public PartialViewResult SAPOPList(string Search)
        {
            List <SAPOP> sapop = new List <SAPOP>();

            sapop = SAPOP.SAPOPList(Search);
            return(PartialView(sapop));
        }
        public ActionResult List(string Search)
        {
            SAPOPImportParametr SAPOPlist = new SAPOPImportParametr();

            if (Search == null)
            {
                Search = "";
            }
            SAPOPlist.Search    = Search;
            SAPOPlist.ListSAPOP = SAPOP.SAPOPList(Search);
            return(View(SAPOPlist));
        }
        public ActionResult GenerateOPfromSAP(string kodOP)
        {
            SAPOP sapOP = new SAPOP();

            sapOP = SAPOP.GetSAPOPByCode(kodOP);
            bool jazyk   = Jazyk.ValidateValue(sapOP.JazykId);
            bool region  = Region.ValidateValue(sapOP.RegionId);
            bool success = Zakaznik.CreateFromSAPdata(sapOP);

            if (success == true)
            {
                ViewBag.Result = "Import proběhl OK";
            }
            else
            {
                StringBuilder result = new StringBuilder();
                result.Append("Import neproběhl:");
                if (jazyk == false)
                {
                    result.Append("Jazyk tiskové šablony nastavený na kartě obchodního partnera v SAP není nastaven v Servisním software. ");
                }
                if (region == false)
                {
                    result.Append("Region nastavený na kartě obchodního partnera v SAP není nastaven v Servisním software. ");
                }
                ViewBag.Result = result.ToString();
            }

            SAPOPImportParametr SAPOPlist = new SAPOPImportParametr();
            string Search = "";

            if (Search == null)
            {
                Search = "";
            }
            SAPOPlist.Search    = Search;
            SAPOPlist.ListSAPOP = SAPOP.SAPOPList(Search);
            return(View("List", SAPOPlist));
        }