public ActionResult edit(BS_Provinces province)
        {
            if (String.IsNullOrEmpty(province.ProvinceID))
            {
                return(Json(new ResultInfo()
                {
                    error = 1, msg = "Missing info"
                }, JsonRequestBehavior.AllowGet));
            }

            var check = db.BS_Provinces.Find(province.ProvinceID);

            if (check == null)
            {
                return(Json(new ResultInfo()
                {
                    error = 1, msg = "Không tìm thấy thông tin"
                }, JsonRequestBehavior.AllowGet));
            }

            check.ProvinceName = province.ProvinceName;
            check.CountryID    = province.CountryID;
            check.ZoneID       = province.ZoneID;


            db.Entry(check).State = System.Data.Entity.EntityState.Modified;
            db.SaveChanges();


            return(Json(new ResultInfo()
            {
                error = 0, msg = "", data = check
            }, JsonRequestBehavior.AllowGet));
        }
        public ActionResult create(BS_Provinces province)
        {
            if (String.IsNullOrEmpty(province.ProvinceID))
            {
                return(Json(new ResultInfo()
                {
                    error = 1, msg = "Missing info"
                }, JsonRequestBehavior.AllowGet));
            }

            var check = db.BS_Provinces.Find(province.ProvinceID);

            if (check != null)
            {
                return(Json(new ResultInfo()
                {
                    error = 1, msg = "Đã tồn tại"
                }, JsonRequestBehavior.AllowGet));
            }

            db.BS_Provinces.Add(province);

            db.SaveChanges();

            return(Json(new ResultInfo()
            {
                error = 0, msg = "", data = province
            }, JsonRequestBehavior.AllowGet));
        }