Esempio n. 1
0
 public ClientsDataController(DutyService dutyApp, OrganizeService organizeApp, ItemsDetailService itemDetailApp, ItemsService itemsApp, RoleService roleApp, RoleAuthorizeService roleAuthorizeApp, MenuService menuApp, MenuButtonService menuButtonApp)
 {
     this.itemDetailApp    = itemDetailApp;
     this.itemsApp         = itemsApp;
     this.organizeApp      = organizeApp;
     this.roleApp          = roleApp;
     this.dutyApp          = dutyApp;
     this.roleAuthorizeApp = roleAuthorizeApp;
     this.menuApp          = menuApp;
     this.menuButtonApp    = menuButtonApp;
 }
Esempio n. 2
0
 public ActionResult Form(Sys_Itemsdetail model)
 {
     if (model.Id > 0)
     {
         var primaryKey = ItemsDetailService.Insert(model);
         return(primaryKey > 0 ? Success() : Error());
     }
     else
     {
         int row = ItemsDetailService.Update(model);
         return(row > 0 ? Success() : Error());
     }
 }
Esempio n. 3
0
        public ActionResult Index(int pageIndex, int pageSize, string itemId, string keyWord)
        {
            var pageData = ItemsDetailService.GetList(pageIndex, pageSize, itemId, keyWord);
            var result   = new LayPadding <Sys_Itemsdetail>()
            {
                Result = true,
                Msg    = "success",
                List   = pageData.Items,
                Count  = pageData.TotalItems
            };

            return(Content(result.ToJson()));
        }
Esempio n. 4
0
        public ActionResult Delete(int primaryKey)
        {
            long count = ItemService.GetChildCount(primaryKey);

            if (count == 0)
            {
                //删除字典。
                int row = ItemService.Delete(primaryKey);
                //删除字典选项。
                ItemsDetailService.Delete(primaryKey);
                return(row > 0 ? Success() : Error());
            }
            return(Warning(string.Format("操作失败,请先删除该项的{0}个子级字典。", count)));
        }
        private object GetDataItemList()
        {
            var itemdata = new ItemsDetailService().GetList();
            Dictionary <string, object> dictionaryItem = new Dictionary <string, object>();

            foreach (var item in new ItemsService().GetList())
            {
                var dataItemList = itemdata.FindAll(t => t.F_ItemId.Equals(item.F_Id));
                Dictionary <string, string> dictionaryItemList = new Dictionary <string, string>();
                foreach (var itemList in dataItemList)
                {
                    dictionaryItemList.Add(itemList.F_ItemCode, itemList.F_ItemName);
                }
                dictionaryItem.Add(item.F_EnCode, dictionaryItemList);
            }
            return(dictionaryItem);
        }
Esempio n. 6
0
 public ItemsDataController(ItemsDetailService itemsDetailApp)
 {
     this.itemsDetailApp = itemsDetailApp;
 }
Esempio n. 7
0
        public ActionResult GetForm(string primaryKey)
        {
            var entity = ItemsDetailService.Get(primaryKey);

            return(Content(entity.ToJson()));
        }
Esempio n. 8
0
        public ActionResult Delete(int primaryKey)
        {
            int row = ItemsDetailService.Delete(primaryKey);

            return(row > 0 ? Success() : Error());
        }