Example #1
0
        public ActionResult <ShreniTaha> Create()
        {
            ShreniTaha value = new ShreniTaha();

            ViewBag.Type = new List <SelectListItem> {
                new SelectListItem {
                    Text = "Government", Value = "Government"
                },
                new SelectListItem {
                    Text = "Non-Government", Value = "Non-Government"
                }
            };
            return(View());
        }
Example #2
0
        public async Task <ActionResult <ShreniTaha> > Edit(string id, ShreniTaha value)
        {
            ViewBag.Type = new List <SelectListItem> {
                new SelectListItem {
                    Text = "Government", Value = "Government"
                },
                new SelectListItem {
                    Text = "Non-Government", Value = "Non-Government"
                }
            };
            // var product = new Product(value.Id);
            value.Id = ObjectId.Parse(id);
            _ShreniTaha.Update(value, id);

            await _uow.Commit();

            return(RedirectToAction("Index"));
        }
Example #3
0
        public async Task <ActionResult <ShreniTaha> > Create(ShreniTaha value)
        {
            ViewBag.Type = new List <SelectListItem> {
                new SelectListItem {
                    Text = "Government", Value = "Government"
                },
                new SelectListItem {
                    Text = "Non-Government", Value = "Non-Government"
                }
            };
            //ShreniTaha obj = new ShreniTaha(value);
            _ShreniTaha.Add(value);

            // it will be null
            //var testShreniTaha = await _ShreniTaha.GetById(value.);

            // If everything is ok then:
            await _uow.Commit();

            // The product will be added only after commit
            // testProduct = await _productRepository.GetById(product.Id);

            return(RedirectToAction("Index"));
        }