示例#1
0
        public ActionResult BillType()
        {
            //var model = new BillType();
            //{
            //    model.BillType1 = "Credit Card";
            //    model.Customers.Add(new Customer());
            //};

            using (var db = new SemplestEntities())
            {
                try
                {
                    if (db.BillTypes.Count() > 0)
                        return View(db.BillTypes.ToList());
                    else
                        return View();
                }
                catch
                {
                    return View();
                }
            }


            //return View();
        }
示例#2
0
 public ActionResult Create(Phone ph)
 {
     try
     {
         using (var db = new SemplestEntities())
         {
             db.Phones.Add(ph);
             db.SaveChanges();
         }
         return RedirectToAction("Index");
     }
     catch
     {
         return View();
     }
 }
示例#3
0
 public ActionResult Create(BillType billtype)
 {
     try
     {
         using (var db = new SemplestEntities())
         {
             db.BillTypes.Add(billtype);
             db.SaveChanges();
         }
         return RedirectToAction("BillType");
     }
     catch
     {
         return View();
     }
 }