Пример #1
0
        public async Task <IActionResult> PutCaseRelationship([FromRoute] long id, [FromBody] CaseRelationship caseRelationship)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != caseRelationship.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
 public CaseRelationshipDetailWindow (CaseRelationship case_relationship, EventHandler OnSave, Gtk.Window parent) : base(Gtk.WindowType.Toplevel)
 {
     this.Build ();
     this.Modal = true;
     this.OnSaved = OnSave;
     this.TransientFor = parent;
     show.CaseRelationship = case_relationship;
     show.IsEditable = false;
 }
 public CaseRelationshipDetailWindow (Case c, EventHandler OnSave, Gtk.Window parent) : base(Gtk.WindowType.Toplevel)
 {
     this.Build ();
     this.Modal = true;
     this.OnSaved = OnSave;
     this.TransientFor = parent;
     CaseRelationship cr = new CaseRelationship ();
     cr.Case = c;
     show.CaseRelationship = cr;
     show.IsEditable = true;
 }
Пример #4
0
        public async Task <IActionResult> PostCaseRelationship([FromBody] CaseRelationship caseRelationship)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            _context.CaseRelationship.Add(caseRelationship);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetCaseRelationship", new { id = caseRelationship.Id }, caseRelationship));
        }