Esempio n. 1
0
        public async Task <ActionResult <FormNames> > AddFormName(FormNames item)
        {
            _context.FormNames.Add(item);
            await _context.SaveChangesAsync();

            return(CreatedAtAction(nameof(AddFormName), new { id = item.Id }, item));
        }
Esempio n. 2
0
        /// <summary>
        /// 名词处理.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void namesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormNames subForm = new FormNames();

            subForm.MdiParent = this;
            subForm.Show();
        }
Esempio n. 3
0
        public async Task <IActionResult> UpdateFormName(long id, FormNames formName)
        {
            if (id != formName.Id)
            {
                return(BadRequest());
            }

            _context.Entry(formName).State = EntityState.Modified;
            await _context.SaveChangesAsync();

            return(NoContent());
        }