Пример #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            styles styles = db.styles.Find(id);

            db.styles.Remove(styles);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
 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
 }
Пример #3
0
        private static styles StileCheck(styles fntStl, styles style)
        {
            if (fntStl.HasFlag(style))
            {
                fntStl ^= style;
            }
            else
            {
                fntStl |= style;
            }

            return(fntStl);
        }
Пример #4
0
        // 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));
        }
Пример #5
0
        // 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));
        }
Пример #6
0
        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();
        }
Пример #7
0
 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));
 }
Пример #8
0
        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);
        }
Пример #9
0
        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));
        }
Пример #10
0
 return(true, new DateRange(map["start"].AsNullableDateTime(styles: styles), map["end"].AsNullableDateTime(styles: styles)));
Пример #11
0
        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;
        }
Пример #12
0
 public static bool ModifyStyle(IntPtr hWnd, styles dwRemove, styles dwAdd)
 {
     return ModifyStyle(hWnd, dwRemove, dwAdd, 0);
 }
Пример #13
0
 public static bool HasStyle(IntPtr hWnd, styles styleVal)
 {
     uint dwStyle = GetWindowLong(hWnd, indices.GWL_STYLE);
     return (((uint) styleVal & dwStyle) == (uint) styleVal) ? true : false;
 }
Пример #14
0
 public static bool ModifyStyle(IntPtr hWnd, styles dwRemove, styles dwAdd)
 {
     return(ModifyStyle(hWnd, dwRemove, dwAdd, 0));
 }
Пример #15
0
        public static bool HasStyle(IntPtr hWnd, styles styleVal)
        {
            uint dwStyle = GetWindowLong(hWnd, indices.GWL_STYLE);

            return((((uint)styleVal & dwStyle) == (uint)styleVal) ? true : false);
        }
Пример #16
0
 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;
 }