コード例 #1
0
        public string PostSupplyRecords([FromBody] RequestData modal)
        {
            var obj = new SupplyRecordLogic(_context);

            var result = PostData(modal, obj);

            if (result == Status.MessageType.SUCCESS)
            {
                _responseMessage.Status = result.ToString();
                _responseMessage.Data   = Messages.SAVESUCCESS;
            }
            else
            {
                _responseMessage.Status = result.ToString();
                _responseMessage.Data   = Messages.SAVESUCCESS;
            }

            return(Tools.ConvertToJSON(_responseMessage));
        }
コード例 #2
0
        public async Task <string> GetSupplyRecord(RequestData modal)
        {
            var user = await _userManager.FindByNameAsync(User.Identity.Name);

            var isGuest = (User.Identity.Name == _setting.GetSuperId()) ? true : await _userManager.IsInRoleAsync(user, "Guest");

            var obj   = new ConfigurationMainLogic(_context);
            var obj1  = new SupplyRecordLogic(_context);
            var data  = obj.SelectHeader(Convert.ToInt32(modal.identifier), isGuest);
            var data1 = obj1.SelectMenuData(modal.identifier, modal.updated);

            await Task.WhenAll(data, data1);

            var result = new TableFormatter {
                Header = data.Result, Body = data1.Result
            };

            return(Tools.ConvertToJSON(result));
        }