示例#1
0
        public IHttpActionResult PutClient(int id, Client client)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            if (id != client.ClientID)
            {
                return BadRequest();
            }

            db.Entry(client).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ClientExists(id))
                {
                    return NotFound();
                }
                else
                {
                    throw;
                }
            }

            return StatusCode(HttpStatusCode.NoContent);
        }
示例#2
0
        public IHttpActionResult PostClient(Client client)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            db.Clients.Add(client);
            db.SaveChanges();

            return CreatedAtRoute("DefaultApi", new { id = client.ClientID }, client);
        }
示例#3
0
 public Candidate(string _name, string _firstApe, string _secondApe, string _firstEmail,
                      int _firstTelephone, int _secondTelephone, string _secondEmail, bool _isHide, 
                      Client _client, User _seller)
 {
     name = _name;
     firstApe = _firstApe;
     secondApe = _secondApe;
     firstEmail = _firstEmail;
     firstTelephone = _firstTelephone;
     secondTelephone = _secondTelephone;
     secondEmail = _secondEmail;
     isHide = _isHide;
     client = _client;
     seller = _seller;
     calls = new HashSet<CandidateCall>();
     attributeInfoCandidate = new HashSet<AttributeInfoCandidate>();
 }