public ActionResult DeleteConfirmed(int id) { styles styles = db.styles.Find(id); db.styles.Remove(styles); db.SaveChanges(); return(RedirectToAction("Index")); }
public frmLogin() { InitializeComponent(); #region styles objStyles = new styles(); this.txtUsername.GotFocus += new EventHandler(objStyles.textBoxGotFocus); this.txtPassword.GotFocus += new EventHandler(objStyles.textBoxGotFocus); this.txtUsername.LostFocus += new EventHandler(objStyles.textBoxLostFocus); this.txtPassword.LostFocus += new EventHandler(objStyles.textBoxLostFocus); #endregion }
private static styles StileCheck(styles fntStl, styles style) { if (fntStl.HasFlag(style)) { fntStl ^= style; } else { fntStl |= style; } return(fntStl); }
// GET: styles/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } styles styles = db.styles.Find(id); if (styles == null) { return(HttpNotFound()); } return(View(styles)); }
// GET: styles/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } styles styles = db.styles.Find(id); if (styles == null) { return(HttpNotFound()); } ViewBag.OID = new SelectList(db.Origin, "OID", "about", styles.OID); return(View(styles)); }
private static void Adjust() { bool exit = true; styles fntStl = 0; Console.ForegroundColor = ConsoleColor.Green; do { Console.WriteLine("Choose an option:"); Console.WriteLine("1. Bold"); Console.WriteLine("2. Italic"); Console.WriteLine("3. Underline"); Console.WriteLine("4. Quit"); Console.WriteLine(); int styl = Validate(); switch (styl) { case 1: fntStl = StileCheck(fntStl, styles.bold); Console.WriteLine("Text style is: " + fntStl); Console.WriteLine(); break; case 2: fntStl = StileCheck(fntStl, styles.italic); Console.WriteLine("Text style is: " + fntStl); Console.WriteLine(); break; case 3: fntStl = StileCheck(fntStl, styles.underline); Console.WriteLine("Text style is: " + fntStl); Console.WriteLine(); break; case 4: Console.Clear(); exit = false; break; } } while (exit); Console.ForegroundColor = ConsoleColor.Gray; Console.WriteLine(); }
public ActionResult Edit(styles styles) { if (ModelState.IsValid) { //To get the url of the image brought from the view string imagename = Path.GetFileNameWithoutExtension(styles.ImageFile.FileName); string extension = Path.GetExtension(styles.ImageFile.FileName); //DateTime below to avoid duplicate name of image DateTime.Now.ToString("yymmssfff") imagename = imagename + extension; styles.image = "/Content/Simages/" + imagename; //To save it to to the server imagename = Path.Combine(Server.MapPath("/Content/Simages/"), imagename); styles.ImageFile.SaveAs(imagename); db.Entry(styles).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.OID = new SelectList(db.Origin, "OID", "about", styles.OID); return(View(styles)); }
public static bool ModifyStyle(IntPtr hWnd, styles dwRemove, styles dwAdd, uint nFlags) { Trace.Assert(IsWindow(hWnd)); uint dwStyle = GetWindowLong(hWnd, indices.GWL_STYLE); uint dwNewStyle = (dwStyle & ~(uint)dwRemove) | (uint)dwAdd; if (dwStyle == dwNewStyle) { return(false); } SetWindowLong(hWnd, indices.GWL_STYLE, dwNewStyle); if (nFlags != 0) { SetWindowPos(hWnd, IntPtr.Zero, 0, 0, 0, 0, posFlags.SWP_NOSIZE | posFlags.SWP_NOMOVE | posFlags.SWP_NOZORDER | posFlags.SWP_NOACTIVATE | (posFlags)nFlags); } return(true); }
public ActionResult Create(styles styles) { if (styles.video == null) { styles.video = ""; } if (ModelState.IsValid) { //To get the url of the image brought from the view string imagename = Path.GetFileNameWithoutExtension(styles.ImageFile.FileName); string extension = Path.GetExtension(styles.ImageFile.FileName); //DateTime below to avoid duplicate name of image DateTime.Now.ToString("yymmssfff") imagename = imagename + extension; styles.image = "/Content/Simages/" + imagename; //To save it to to the server imagename = Path.Combine(Server.MapPath("/Content/Simages/"), imagename); styles.ImageFile.SaveAs(imagename); db.styles.Add(styles); db.SaveChanges(); return(RedirectToAction("Index")); } //if (styles.image == null) //{ // styles.image = "~/Content/Style/stylesholder.png"; //} //if (ModelState.IsValid) //{ // db.styles.Add(styles); // db.SaveChanges(); // return RedirectToAction("Index"); //} ViewBag.OID = new SelectList(db.Origin, "OID", "about", styles.OID); return(View(styles)); }
return(true, new DateRange(map["start"].AsNullableDateTime(styles: styles), map["end"].AsNullableDateTime(styles: styles)));
public static bool ModifyStyle(IntPtr hWnd, styles dwRemove, styles dwAdd, uint nFlags) { Trace.Assert(IsWindow(hWnd)); uint dwStyle = GetWindowLong(hWnd, indices.GWL_STYLE); uint dwNewStyle = (dwStyle & ~(uint) dwRemove) | (uint) dwAdd; if (dwStyle == dwNewStyle) return false; SetWindowLong(hWnd, indices.GWL_STYLE, dwNewStyle); if (nFlags != 0) { SetWindowPos(hWnd, IntPtr.Zero, 0, 0, 0, 0, posFlags.SWP_NOSIZE | posFlags.SWP_NOMOVE | posFlags.SWP_NOZORDER | posFlags.SWP_NOACTIVATE | (posFlags) nFlags); } return true; }
public static bool ModifyStyle(IntPtr hWnd, styles dwRemove, styles dwAdd) { return ModifyStyle(hWnd, dwRemove, dwAdd, 0); }
public static bool HasStyle(IntPtr hWnd, styles styleVal) { uint dwStyle = GetWindowLong(hWnd, indices.GWL_STYLE); return (((uint) styleVal & dwStyle) == (uint) styleVal) ? true : false; }
public static bool ModifyStyle(IntPtr hWnd, styles dwRemove, styles dwAdd) { return(ModifyStyle(hWnd, dwRemove, dwAdd, 0)); }
public static bool HasStyle(IntPtr hWnd, styles styleVal) { uint dwStyle = GetWindowLong(hWnd, indices.GWL_STYLE); return((((uint)styleVal & dwStyle) == (uint)styleVal) ? true : false); }
public Car(styles style, string make, string model, string colour, int weight, int topSpeed, string registration) : base(make, model, colour, weight, topSpeed, registration) { Style = style; base.NumWheels = 4; }