public ActionResult Create(BDepartment bdepartment)
        {
            try
            {
                if (ModelState.IsValid)
                {

                    //if (db.BDepartments.Find(bdepartment.BNumber) != null)
                    //{
                    //    return RedirectToAction("Error", "MyTart", new { err = "编号不能重复", Act = "Create", Con = "BDepartment" });

                    //}
                    db.BDepartments.Add(bdepartment);

                    db.SaveChanges();

                    return RedirectToAction("Create");
                    //return View(new BDepartment { BNumber = bdepartment.BNumber.GetAscNumberStr() });
                }
                return View(bdepartment);
            }
            catch (Exception ex)
            {
                return Content(ex.Message);
            }

            //return View(bdepartment);
        }
 public ActionResult Edit(BDepartment bdepartment)
 {
     if (ModelState.IsValid)
     {
         db.Entry(bdepartment).State = EntityState.Modified;
         db.SaveChanges();
         //return RedirectToAction("Index");
     }
     return View(bdepartment);
 }