public void InsertCity(tbl_show_city city)
        {
            CityRepository ci     = new CityRepository();
            int            Result = ci.InsertCity(city);

            if (Result == 0)
            {
                // خطا
            }
            else
            {
                // درست 1
            }
        }
        public ActionResult Insert(tbl_show_city city) // اکشن ثبت شهر
        {
            CityRepository ci     = new CityRepository();
            int            Result = ci.InsertCity(city);

            if (Result == 0)
            {
                // خطا
            }
            else
            {
                // درست 1
            }

            return(View("listcity"));
        }
        public int UpdateCity(tbl_show_city _city)
        {
            db.Entry(_city).State = System.Data.Entity.EntityState.Modified;

            return(db.SaveChanges());
        }
 public int InsertCity(tbl_show_city _city)
 {
     db.tbl_show_city.Add(_city);
     return(db.SaveChanges());
 }
        public tbl_show_city FindCity(int id)
        {
            tbl_show_city city = db.tbl_show_city.Where(c => c.code_city == id).SingleOrDefault();

            return(city);
        }
 public int DeleteCity(tbl_show_city _city)
 {
     db.tbl_show_city.Remove(_city);
     return(db.SaveChanges());
 }