public ActionResult Novo()
        {
            ViewBag.TipoBanner = GetTypeBannerSelectListItem(new BannerService().GetTypeBannerSelectListItem(), null);
            ViewBag.Idiomas = new IdiomaService().GetAll();

            var Banner = new Banner { IsAtivo = true, DataInicio = DateTime.Now, DataFim = DateTime.Now };

            return View(Banner);
        }
        public JsonResult Editar(Banner model, List<Banner_Idioma> Banner_Idiomas)
        {
            foreach (var item in Banner_Idiomas) { model.Banner_Idioma.Add(item); }

            var startDateTime = Convert.ToDateTime(String.Format("{0} 00:00", model.DataInicio.ToShortDateString()));
            var endDateTime = Convert.ToDateTime(String.Format("{0} 23:59", model.DataFim.ToShortDateString()));

            model.DataInicio = startDateTime;
            model.DataFim = endDateTime;

            new BannerService().UpdateObject(model);

            return Json(new JsonRequestResult { ResultType = JsonRequestResultType.Success, Message = Constants._msgUpdateSuccess, ReturnUrl = Url.Content("~/Admin/Banner/") }, JsonRequestBehavior.AllowGet);
        }
        public ActionResult Novo(Banner model, List<Banner_Idioma> Banner_Idiomas)
        {
            foreach (var item in Banner_Idiomas) { model.Banner_Idioma.Add(item); }

            model.DataInclusao = DateTime.Now;

            var startDateTime = Convert.ToDateTime(String.Format("{0} 00:00", model.DataInicio.ToShortDateString()));
            var endDateTime = Convert.ToDateTime(String.Format("{0} 23:59", model.DataFim.ToShortDateString()));

            model.DataInicio = startDateTime;
            model.DataFim = endDateTime;

            new BannerService().InsertObject(model);

            return Json(new JsonRequestResult { ResultType = JsonRequestResultType.Success, Message = Constants._msgCreateSuccess, ReturnUrl = Url.Content("~/Admin/Banner/") });
        }
 /// <summary>
 /// Create a new Banner object.
 /// </summary>
 /// <param name="idBanner">Initial value of the IdBanner property.</param>
 /// <param name="idTipoBanner">Initial value of the IdTipoBanner property.</param>
 /// <param name="nome">Initial value of the Nome property.</param>
 /// <param name="dataInclusao">Initial value of the DataInclusao property.</param>
 /// <param name="isAbrirNovaJanela">Initial value of the IsAbrirNovaJanela property.</param>
 /// <param name="dataInicio">Initial value of the DataInicio property.</param>
 /// <param name="dataFim">Initial value of the DataFim property.</param>
 /// <param name="isAtivo">Initial value of the IsAtivo property.</param>
 public static Banner CreateBanner(global::System.Int32 idBanner, global::System.Int32 idTipoBanner, global::System.String nome, global::System.DateTime dataInclusao, global::System.Boolean isAbrirNovaJanela, global::System.DateTime dataInicio, global::System.DateTime dataFim, global::System.Boolean isAtivo)
 {
     Banner banner = new Banner();
     banner.IdBanner = idBanner;
     banner.IdTipoBanner = idTipoBanner;
     banner.Nome = nome;
     banner.DataInclusao = dataInclusao;
     banner.IsAbrirNovaJanela = isAbrirNovaJanela;
     banner.DataInicio = dataInicio;
     banner.DataFim = dataFim;
     banner.IsAtivo = isAtivo;
     return banner;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the Banner EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToBanner(Banner banner)
 {
     base.AddObject("Banner", banner);
 }