public ActionResult Create(Customer customer)
        {
            if (this.Session["Account"] == null)
            {
                return Redirect("/Login");

            }
            var id = Convert.ToInt32(this.Session["ID"]);
            if (ModelState.IsValid)
            {
                var code = RandomString(5);

                if (IsExist(code)==false) {
                    customer.CreatorId = id;
                    customer.Code = RandomString(5);
                    customer.DateCreater = DateTime.Now;
                    customer.Invisible = false;
                    db.Customers.Add(customer);
                    db.SaveChanges();
                    return RedirectToAction("Index");
                }

            }

            return View(customer);
        }
 public ActionResult Edit(Customer customer)
 {
     if (this.Session["Account"] == null)
     {
         return Redirect("/Login");
     }
     if (ModelState.IsValid)
     {
         db.Entry(customer).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(customer);
 }