Ejemplo n.º 1
0
        public ActionResult JsonToDServIndType(HttpPostedFileBase file)
        {
            string status;

            try
            {
                if (file != null && file.ContentLength > 0)
                {
                    var fileName = Path.GetFileName(file.FileName);
                    file.SaveAs(Path.Combine(directory, fileName));
                }
                JsonManager <ServiceIndustryType> jman      = new JsonManager <ServiceIndustryType>();
                List <ServiceIndustryType>        customers = jman.ReadFile(directory, file.FileName);

                foreach (ServiceIndustryType c in customers)
                {
                    _servIndTypeManager.Create(c);
                }
                status = "Success";
            }
            catch (Exception e)
            {
                status = e.Message;
            }
            return(RedirectToAction("Index", new { statusMesage = status }));
        }
 public ActionResult CreatePost(ServiceIndustryType serviceIndustryType)
 {
     serviceIndustryType.ServiceIndustryTypeId = Guid.NewGuid().ToString();
     _servTypeManager.Create(serviceIndustryType);
     return(RedirectToAction("Index"));
 }