public ActionResult Restituie() { string titlu = Request["titlu"]; string autor = Request["autor"]; string id = Request["id"]; string an = Request["an"]; string nr = Request["nr"]; string gent = Request["gent"]; string genc = Request["genc"]; string st1 = Request["st1"]; string st2 = Request["st2"]; Gen_tip Gent = (Gen_tip)Enum.Parse(typeof(Gen_tip), gent); Gen_continut Genc = (Gen_continut)Enum.Parse(typeof(Gen_tip), gent); Carte c = new Carte(new Text(id), new ISSN(nr), new Text(titlu), new Text(autor), new Text(an), Gent, Genc, new Utilizator()); c.stare1 = (Stare)Enum.Parse(typeof(Stare), st1); c.stare2 = (Stare)Enum.Parse(typeof(Stare), st2); var cmdRestituie = new ComandaRestituire(); cmdRestituie.carte = c; MagistralaComenzi.Instanta.Value.Trimite(cmdRestituie); Receiver recv = new Receiver(); string msg = recv.Citeste(); ViewBag.EvenimentMsg = msg; return(View("VEventMsg")); }
public ActionResult Cumpara() { //if () // ViewBag.Message = "Autentif."; // return View("VInreg"); //else string titlu = Request["titlu"]; string autor = Request["autor"]; string id = Request["id"]; string an = Request["an"]; string nr = Request["nr"]; string gent = Request["gent"]; string genc = Request["genc"]; string st1 = Request["st1"]; string st2 = Request["st2"]; Gen_tip Gent = (Gen_tip)Enum.Parse(typeof(Gen_tip), gent); Gen_continut Genc = (Gen_continut)Enum.Parse(typeof(Gen_tip), gent); Carte c = new Carte(new Text(id), new ISSN(nr), new Text(titlu), new Text(autor), new Text(an), Gent, Genc, new Utilizator()); c.stare1 = (Stare)Enum.Parse(typeof(Stare), st1); c.stare2 = (Stare)Enum.Parse(typeof(Stare), st2); var cmdCumpar = new ComandaCumparare(); cmdCumpar.carte = c; MagistralaComenzi.Instanta.Value.Trimite(cmdCumpar); Receiver recv = new Receiver(); string msg = recv.Citeste(); ViewBag.EvenimentMsg = msg; // ViewBag.stare1 = c.stare1; return(View("VEventMsg")); }
public ActionResult Adaugare(MCarte carte) { List <SelectListItem> listItems = new List <SelectListItem>(); List <SelectListItem> listItems2 = new List <SelectListItem>(); foreach (Gen_tip gen in Enum.GetValues(typeof(Gen_tip))) { SelectListItem _sli = new SelectListItem() { Text = gen.ToString() }; listItems.Add(_sli); } foreach (Gen_continut gen in Enum.GetValues(typeof(Gen_continut))) { SelectListItem _sli = new SelectListItem() { Text = gen.ToString() }; listItems2.Add(_sli); } ViewBag.GenTOpt = listItems; ViewBag.GenCOpt = listItems2; if (carte.Id == null) { return(View("VAdaugareCarte")); } else { Carte c = new Carte(new Text(carte.Id), new ISSN(carte.Nr), new Text(carte.titlu), new Text(carte.autor), new Text(carte.an), carte.gent, carte.genc, new Utilizator()); var cmdAdauga = new ComandaAdaugare(); cmdAdauga.carte = c; MagistralaComenzi.Instanta.Value.Trimite(cmdAdauga); Receiver recv = new Receiver(); string msg = recv.Citeste(); ViewBag.EvenimentMsg = msg; return(View("VAdaugareCarte")); } }