コード例 #1
0
        public async Task <ActionResult <OrgFee> > PostOrgFee(OrgFee orgFee)
        {
            _context.OrgFee.Add(orgFee);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetOrgFee", new { id = orgFee.OrgFeeId }, orgFee));
        }
コード例 #2
0
        public async Task <IActionResult> PutOrgFee(int id, OrgFee orgFee)
        {
            if (id != orgFee.OrgFeeId)
            {
                return(BadRequest());
            }

            _context.Entry(orgFee).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!OrgFeeExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
コード例 #3
0
            public static OrgFee Parse(Parser parser, int startindent)
            {
                if (parser.curr.kw != Parser.RegKeywords.None)
                {
                    throw parser.GetException("expected orgid only");
                }
                var oid = parser.GetInt();

                if (oid == 0)
                {
                    parser.lineno--;
                    throw parser.GetException("invalid orgid");
                }
                var f = new OrgFee {
                    OrgId = oid
                };

                if (parser.curr.indent > startindent)
                {
                    if (parser.curr.kw != Parser.RegKeywords.Fee)
                    {
                        throw parser.GetException("expected fee");
                    }
                    f.Fee = parser.GetDecimal();
                }
                return(f);
            }
コード例 #4
0
        public static OrgFees Parse(Parser parser)
        {
            var ff = new OrgFees();

            parser.lineno++;
            var startindent = parser.curr.indent;

            while (parser.curr.indent == startindent)
            {
                var f = OrgFee.Parse(parser, startindent);
                ff.list.Add(f);
            }
            return(ff);
        }
コード例 #5
0
ファイル: OrgFees.cs プロジェクト: rossspoon/bvcms
 public static OrgFee Parse(Parser parser, int startindent)
 {
     if (parser.curr.kw != Parser.RegKeywords.None)
         throw parser.GetException("expected orgid only");
     var oid = parser.GetInt();
     if (oid == 0)
     {
         parser.lineno--;
         throw parser.GetException("invalid orgid");
     }
     var f = new OrgFee { OrgId = oid };
     if (parser.curr.indent > startindent)
     {
         if (parser.curr.kw != Parser.RegKeywords.Fee)
             throw parser.GetException("expected fee");
         f.Fee = parser.GetDecimal();
     }
     return f;
 }