Ejemplo n.º 1
0
        // GET: Partners
        public ActionResult Index()
        {
            var partnersVM = new List <Partner>();

            foreach (var partner in partnersRepositories.GetAll())
            {
                var partnerVM = PartnerMap.PartnerToPartnerVM(partner);
            }

            return(View(partnersVM));
        }
Ejemplo n.º 2
0
        public ActionResult Edit([Bind(Include = "PartnerId,Name,Phone,Card")] PartnerVM partnerVM)
        {
            var partner = PartnerMap.PartnerVMToPartner(partnerVM);

            if (ModelState.IsValid)
            {
                partnersRepositories.Edit(partner);
                return(RedirectToAction("Index"));
            }
            return(View(partner));
        }
Ejemplo n.º 3
0
        // GET: Partners/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Partner partner = partnersRepositories.GetById(id.Value);

            if (partner == null)
            {
                return(HttpNotFound());
            }

            var partnerVM = PartnerMap.PartnerToPartnerVM(partner);

            return(View(partnerVM));
        }