コード例 #1
0
        public ActionResult Create(Sectores model, int? id)
        {
            try
              {

            SectoresService.Create(model);

            if (id != null)
              ViewData["IdCentro"] = id;

            return RedirectToAction("Index", "Sectores", id);

              }
              catch (Exception ex)
              {
            TempData["ErrorMessage"] = ex.Message;
            return View(model);
              }
        }
コード例 #2
0
        public ActionResult Edit(Sectores model)
        {
            try
              {

              SectoresService.Edit(model);
              return RedirectToAction("Index", new { id = model.Id_empresa });

              }
              catch (Exception ex)
              {
            TempData["ErrorMessage"] = ex.Message;
            return View(model);
              }
        }
コード例 #3
0
 /// <summary>
 /// Create a new Sectores object.
 /// </summary>
 /// <param name="id_sector">Initial value of the Id_sector property.</param>
 public static Sectores CreateSectores(global::System.Int32 id_sector)
 {
     Sectores sectores = new Sectores();
     sectores.Id_sector = id_sector;
     return sectores;
 }
コード例 #4
0
        public ActionResult Index(Sectores model)
        {
            if (!BioTecnal.Models.ApplicationModelRepositoy.validateOptionByRole(User.Identity.Name, "Sectores"))
              {
            TempData["ErrorMessage"] = string.Format("Acceso denegado a {0}", "Sectores");
            return RedirectToAction("Error", "Shared");
              }
              string user = this.User.Identity.Name;

              return PartialView("_Index", SectoresService.GetAllSectores(user));
        }
コード例 #5
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Sectores EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToSectores(Sectores sectores)
 {
     base.AddObject("Sectores", sectores);
 }