// GET: ProTip/Create public ActionResult Create(int?pagina) { ViewBag.Pagina = (pagina ?? 1); ProTip bdProTip = new ProTip(); return(View(bdProTip)); }
protected override void AppendToolTip(ProTip tip) { string text1 = "CSharp Box"; string text2 = "It realizes dynamic generation and execution of CSharp."; string text3 = "Press <<Q>> to change CSharp Box settings"; tip.Add(new ProTipSegment_TitleSubTitle(text1, text2), Position.First); tip.Add(new ProTipSegment_Text(400, text3)); }
private void ProcessFileImage(int pProTipId, Image pImage, string pExtension) { ProTip bdProTip = db.ProTip.Find(pProTipId); string sToFile = ""; string sNameFile = "slmf-protip-" + Funcion.NameEncode(bdProTip.Nombre).Trim().ToLower(); bdProTip.FileImage = sNameFile + "." + pExtension; db.Entry(bdProTip).State = EntityState.Modified; db.SaveChanges(); sToFile = Server.MapPath(sFolderImagesRoutines + sNameFile + "." + pExtension); pImage.Save(sToFile); }
public ActionResult DeleteConfirmed(int id, int?pagina) { ViewBag.Pagina = (pagina ?? 1); ProTip bdProTip = db.ProTip.Find(id); if (bdProTip.DiasConElProTip.Count == 0) { db.ProTip.Remove(bdProTip); db.SaveChanges(); } return(RedirectToAction("Index", "ProTip", new { pagina = ViewBag.Pagina })); }
// GET: ProTip/Details/5 public ActionResult Details(int?id, int?pagina) { ViewBag.Pagina = (pagina ?? 1); if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ProTip bdProTip = db.ProTip.Find(id); if (bdProTip == null) { return(HttpNotFound()); } return(View(bdProTip)); }
public ActionResult DeleteImage(int id, int?pagina) { ViewBag.Pagina = (pagina ?? 1); ProTip bdProTip = db.ProTip.Find(id); if (bdProTip.FileImage != null) { string sArchivo = Server.MapPath(sFolderImagesRoutines + bdProTip.FileImage); bdProTip.FileImage = null; db.Entry(bdProTip).State = EntityState.Modified; db.SaveChanges(); Funcion.EliminaArchivo(sArchivo); } return(RedirectToAction("Details", "ProTip", new { id = bdProTip.ID, pagina = ViewBag.Pagina })); }
public ActionResult Edit(int?pagina, [Bind(Include = "ID,Nombre,Descripcion,Autor,VimeoID,FileImage")] ProTip proTip) { ViewBag.Pagina = (pagina ?? 1); if (ModelState.IsValid) { if (db.ProTip.Any(x => x.Nombre.Trim().ToUpper() == proTip.Nombre.Trim().ToUpper() && x.ID != proTip.ID)) { ModelState.AddModelError("Nombre", "Ya existe un Protip con ese Nombre"); } else { db.Entry(proTip).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index", "ProTip", new { sSearchString = proTip.Nombre })); } } return(View(proTip)); }
protected override void AppendToolTip(ProTip tip) { base.AppendToolTip(tip); tip.Add(new ProTipSegment_TitleSubTitle("Mod Notifier", "Alert for missing mods"), Position.Middle); tip.InfoOnly = false; }