Esempio n. 1
0
        /// <summary>
        /// Sau khi upload xong, cập nhật thông tin cho picture
        /// </summary>
        /// <returns></returns>
        public ActionResult AjaxFormPictureUpdate()
        {
            var arrFile     = Request["fileData"];
            var oSerializer = new JavaScriptSerializer();
            var ltsFileobj  = oSerializer.Deserialize <List <FileObj> >(arrFile);
            var type        = Request["Type"];
            var categoryId  = Request["CategoryID"];
            var model       = new ModelFileObj
            {
                ListCategoryItem = _categoryApi.GetChildByParentId(false),
                ListItem         = ltsFileobj,
                Type             = !string.IsNullOrEmpty(type) ? Convert.ToInt32(type) : 0,
                CategoryId       = !string.IsNullOrEmpty(categoryId) ? Convert.ToInt32(categoryId) : 0,
                Action           = DoAction.ToString()
            };

            return(View(model));
        }
        public ActionResult AjaxForm()
        {
            var model = new ShopProductDetailItem();

            if (DoAction == ActionType.Edit)
            {
                model = _api.GetItemById(UserItem.AgencyID, ArrId.FirstOrDefault());
            }
            ViewBag.UnitID     = _dnUnitApi.GetListUnit(UserItem.AgencyID).OrderBy(x => x.Name);
            ViewBag.category   = _categoryApi.GetChildByParentId(true).Where(m => m.Type == 2).ToList();
            ViewBag.Action     = DoAction;
            ViewBag.ActionText = ActionText;
            return(View(model));
        }
Esempio n. 3
0
        public ActionResult AjaxForm()
        {
            var model   = new CategoryItem();
            var lstCate = _categoryApi.GetChildByParentId(false);

            ViewBag.lstCate    = lstCate;
            ViewBag.Action     = DoAction;
            ViewBag.ActionText = ActionText;
            if (DoAction == ActionType.Edit)
            {
                model = _categoryApi.GetItemById(ArrId.FirstOrDefault());
            }
            model.AgencyId  = UserItem.AgencyID;
            ViewBag.lstUnit = _dnUnitApi.GetAllList();
            return(View(model));
        }
        public ActionResult AjaxForm(int supplierId)
        {
            var lstCate = _categoryApi.GetChildByParentId(false);

            ViewBag.lstCate    = lstCate;
            ViewBag.supplierId = supplierId;
            var model = new SupplieProductItem()
            {
                SupplierId = supplierId
            };


            if (DoAction == ActionType.Edit)
            {
                model = _api.GetSupplierProductById(ArrId.FirstOrDefault());
            }
            ViewBag.Action = DoAction;
            return(View(model));
        }
        public async Task <ActionResult> AjaxForm()
        {
            var lstCate = _categoryApi.GetChildByParentId(false);

            ViewBag.lstCate = lstCate;
            var model = new SupplierAmountProductItem()
            {
                ExpireDate      = DateTime.Now.TotalSeconds(),
                PublicationDate = DateTime.Now.TotalSeconds(),
                CallDate        = DateTime.Now.TotalSeconds()
            };

            ViewBag.lstSupplier = _api.GetList();
            if (DoAction == ActionType.Edit)
            {
                model = await _apiSupplierAmount.GetById(ArrId.FirstOrDefault());
            }
            ViewBag.Action = DoAction;
            return(View(model));
        }