示例#1
0
        public JsonResult OnDelete(int pId = 0)
        {
            var mAccount = AccountService.LayTinTheoId(pId);

            if (mAccount != null)
            {
                MpStartEntities.DeleteObject(mAccount);
                MpStartEntities.SaveChanges();
                return(Json(new { code = 1, message = "Xóa thành công!" }));
            }
            return(Json(new { code = 0, message = "Không tìm thấy tài khoản cần xóa." }));
        }
示例#2
0
        public JsonResult OnDelete(int pId = 0)
        {
            var mSupportType = SupportService.LaySupportTypeTheoId(pId);

            if (mSupportType != null)
            {
                MpStartEntities.DeleteObject(mSupportType);
                MpStartEntities.SaveChanges();
                return(Json(new { code = 1, message = "Xóa thành công!" }));
            }
            return(Json(new { code = 0, message = "Không tìm thấy kiểu cần xóa." }));
        }
示例#3
0
        public JsonResult OnDelete(int pId = 0)
        {
            var mImage = ImagesService.LayAnhTheoId(pId);

            if (mImage != null)
            {
                MpStartEntities.DeleteObject(mImage);
                MpStartEntities.SaveChanges();
                return(Json(new { code = 1, message = "Xóa thành công!" }));
            }
            return(Json(new { code = 0, message = "Không tìm thấy tin cần xóa." }));
        }
示例#4
0
        public JsonResult OnDelete(int pId = 0)
        {
            var mProductOrder = ProductsService.LayProductOrderTheoId(pId);

            if (mProductOrder != null)
            {
                MpStartEntities.DeleteObject(mProductOrder);
                MpStartEntities.SaveChanges();
                return(Json(new { code = 1, message = "Xóa thành công!" }));
            }
            return(Json(new { code = 0, message = "Không tìm thấy hóa đơn cần xóa." }));
        }
示例#5
0
        public JsonResult OnDelete(int pId = 0)
        {
            var mMarket = MarketService.LayTheoId(pId);

            if (mMarket != null)
            {
                //lay danh sach cac san pham cua sieu thi
                var mList = ProductsService.getByPageSizeMarketId(1, 1000, mMarket.ID);
                //xoa cac san pham nay
                foreach (Product it in mList)
                {
                    MpStartEntities.DeleteObject(it);
                }
                MpStartEntities.DeleteObject(mMarket);
                MpStartEntities.SaveChanges();
                return(Json(new { code = 1, message = "Xóa thành công!" }));
            }
            return(Json(new { code = 0, message = "Không tìm thấy tài khoản cần xóa." }));
        }