Пример #1
0
 public ActionResult AjaxForm()
 {
     var model = new FormCashAdvanceItem
     {
         ObjItem = (DoAction == ActionType.Edit) ? _api.GetCashAdvanceItem(ArrId.FirstOrDefault()) : new CashAdvanceItem(),
         Action = DoAction.ToString(),
         AgencyId = UserItem.AgencyID,
         UserId = UserItem.UserId,
         Users = _userApi.GetListAllAgency(UserItem.AgencyID),
         Users1 = _userApi.GetAll(UserItem.AgencyID)
     };
     return View(model);
 }
Пример #2
0
        /// <summary>
        /// Load ra khung upload mutils
        /// </summary>
        public ActionResult AjaxFormPicture()
        {
            var type       = Request["Type"];
            var categoryId = Request["CategoryID"];
            var model      = new ModelPictureItem
            {
                Type       = !string.IsNullOrEmpty(type) ? Convert.ToInt32(type) : 0,
                CategoryID = !string.IsNullOrEmpty(categoryId) ? Convert.ToInt32(categoryId) : 0,
                Action     = DoAction.ToString(),
            };

            return(View(model));
        }
Пример #3
0
        public ActionResult AjaxForm()
        {
            var model = new FormDebtItem
            {
                ObjItem     = (DoAction == ActionType.Edit) ? _api.GetItemByID(ArrId.FirstOrDefault()) : new DebtItem(),
                Action      = DoAction.ToString(),
                AgencyId    = UserItem.AgencyID,
                UserId      = UserItem.UserId,
                DNSuppliers = supplieAPI.GetList(UserItem.AgencyID)
            };

            return(View(model));
        }
        public ActionResult AjaxForm()
        {
            var model = new FormReceiptPaymentItem
            {
                ObjItem       = (DoAction == ActionType.Edit) ? _api.GetPaymentItem(ArrId.FirstOrDefault()) : new ReceiptPaymentItem(),
                Action        = DoAction.ToString(),
                AgencyId      = UserItem.AgencyID,
                UserId        = UserItem.UserId,
                Users         = _userApi.GetListAllAgency(UserItem.AgencyID),
                CostTypeItems = _costTypeApi.GetList(UserItem.AgencyID, (int)Vouchers.Payment)
            };

            return(View(model));
        }
Пример #5
0
        public ActionResult AjaxForm()
        {
            var model = new ModelDiscountItem
            {
                Action       = DoAction.ToString(),
                DiscountItem = new DiscountItem()
            };

            if (DoAction == ActionType.Edit)
            {
                model.DiscountItem = _api.GetItemById(ArrId.FirstOrDefault());
            }
            return(View(model));
        }
Пример #6
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 = _categoryDa.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));
        }
Пример #7
0
        public ActionResult AjaxForm()
        {
            var model = new ModelModuleControlItem
            {
                ModuleControlItem = new ModuleControlItem(),
                LstSection        = new List <string>(),
                LstAction         = new List <string>()
            };
            var lst = Config.GetAction(WebConfig.ModuleArea);

            if (DoAction == ActionType.Edit)
            {
                model.ModuleControlItem = _da.GetItemById(ArrId.FirstOrDefault());
                model.LstSection        = Config.GetSectsion(model.ModuleControlItem.Layout).Where(c => c != "MenuAdmin" && c != "metas").ToList();
                model.LstAction         = lst.Where(c => c.Controller == model.ModuleControlItem.Module).Select(c => c.Action).ToList();
            }
            model.Action       = DoAction.ToString();
            model.ActionText   = ActionText;
            model.LstModules   = lst.GroupBy(c => c.Controller).Select(u => u.Key).ToList();
            model.SysPageItems = _pageDa.GetChildByParentId();
            return(View(model));
        }