コード例 #1
0
        public void InsertCustomerGroupEdit(CustomerGroupEditViewModel model)
        {
            var item = Mapper.Map <Customer_Groups>(model);

            m_ContentContext.Customer_Groups.Add(item);
            m_ContentContext.SaveChanges();
        }
コード例 #2
0
        public ActionResult EditGroup(CustomerGroupEditViewModel model)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    m_customerWorker.UpdateManagerCustomerGroupEdit(model);
                    return(RedirectToAction("Groups"));
                }
                catch (Exception ex)
                {
                    ModelState.AddModelError("General", ex.Message);
                }
            }
            List <SelectListItem> priceIndexes = new List <SelectListItem>();

            for (int i = 1; i <= 5; i++)
            {
                priceIndexes.Add(new SelectListItem {
                    Text = i.ToString() + ". Fiyat", Value = i.ToString()
                });
            }
            ViewBag.PriceIndex = priceIndexes;
            this.StatusList(model.Status);
            return(View(model));
        }
コード例 #3
0
        public void UpdateManagerCustomerGroupEdit(CustomerGroupEditViewModel model)
        {
            var query = from g in m_ContentContext.Customer_Groups
                        where g.Id == model.Id
                        select g;
            var item = query.FirstOrDefault();

            Mapper.Map(model, item);
            m_ContentContext.SaveChanges();
        }
コード例 #4
0
        //GET: Admin/CustomerManager/CreateGroup
        public ActionResult CreateGroup()
        {
            List <SelectListItem> priceIndexes = new List <SelectListItem>();

            for (int i = 1; i <= 5; i++)
            {
                priceIndexes.Add(new SelectListItem {
                    Text = i.ToString() + ". Fiyat", Value = i.ToString()
                });
            }
            ViewBag.PriceIndex = priceIndexes;
            var model = new CustomerGroupEditViewModel {
                Status = 1
            };

            this.StatusList(model.Status);
            return(View(model));
        }