コード例 #1
0
        public ActionResult Create(ServiceProviderTypeModel branch)
        {
            if (ModelState.IsValid)
            {
                var dbModel = Mapper.Map <ServiceProviderTypeModel, ServiceProviderType>(branch);
                InsuranceContext.ServiceProviderTypes.Insert(dbModel);
                return(RedirectToAction("Index"));
            }

            return(View());
        }
コード例 #2
0
        public ActionResult Edit(ServiceProviderTypeModel provider)
        {
            if (ModelState.IsValid)
            {
                var data = InsuranceContext.ServiceProviderTypes.Single(provider.Id);

                if (data != null)
                {
                    data.ProviderType = provider.ProviderType;

                    InsuranceContext.ServiceProviderTypes.Update(data);
                }


                return(RedirectToAction("Index"));
            }
            return(View());
        }