Example #1
0
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Jazyk jazyk = db.Jazyk.Find(id);

            if (jazyk == null)
            {
                return(HttpNotFound());
            }
            return(View(jazyk));
        }
Example #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            Jazyk jazyk = db.Jazyk.Find(id);

            try
            {
                db.Jazyk.Remove(jazyk);
                db.SaveChanges();
            }
            catch (SqlException e)
            {
                log.Error("Error number: " + e.Number + " - " + e.Message);
            }
            return(RedirectToAction("Index"));
        }
Example #3
0
 public ActionResult Edit([Bind(Include = "Id,NazevJazyku")] Jazyk jazyk)
 {
     if (ModelState.IsValid)
     {
         try
         {
             db.Entry(jazyk).State = EntityState.Modified;
             db.SaveChanges();
         }
         catch (SqlException e)
         {
             log.Error("Error number: " + e.Number + " - " + e.Message);
         }
         return(RedirectToAction("Index"));
     }
     return(View(jazyk));
 }
        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));
        }