public ActionResult Index()
 {
     HinhAnhController ctr = new HinhAnhController();
     HinhAnh re = ctr.upload_mvc_use_only(Server, Request.Files);
     ViewBag.Message = re.duongdan + "|" + re.duongdan_thumb + "|";
     return View();
 }
예제 #2
0
        public FmThongTinSanPham(SanPham sp = null, SanPhamController spc = null)
        {
            InitializeComponent();
            dtgvHinhAnh.AutoGenerateColumns = false;
            dtgvChiTietSanPham.AutoGenerateColumns = false;
            //set primary context
            if (spc != null) SPCtr = spc;
            else SPCtr = new SanPhamController();

            HSXCtr = new HangSXController(this.SPCtr._db);
            MSCtr = new MauSacController(this.SPCtr._db);
            HACtr = new HinhAnhController(this.SPCtr._db);
            SPCTCtr = new SanPham_ChiTietController(this.SPCtr._db);
            MSCtr.timkiem();
            LoadCb_HangSX();
            if (sp == null)
            {
                this.sp = new SanPham(SPCtr._db);
                this.Text = "Thêm Mới Sản Phẩm";
            }
            else
            {
                this.sp = sp;
                this.sp._set_context(SPCtr._db);
                EditMode = true;
                ThongTinFormSanPham = this.sp;
                LoadDTGV_HinhAnh();
                LoadDTGV_ChiTietSP();
            }
        }
 public ActionResult Delete(int hinhanh_id=0)
 {
     HinhAnhController ctr=new HinhAnhController();
     HinhAnh obj = ctr.get_by_id(hinhanh_id);
     if (obj == null)
     {
         ViewBag.Message = "0";
         return View("Index");
     }
     obj.delete_mvc_use_only(Server);
     ViewBag.Message = "1";
     return View("Index");
 }
예제 #4
0
 public HinhAnh()
 {
     this._ctr = new HinhAnhController();
     this._Init();
 }
예제 #5
0
 public HinhAnh(DTDDDbContext context)
 {
     this._ctr = new HinhAnhController(context);
     this._Init();
 }