public async Task <ActionResult <Sexs> > PostSexs(Sexs sexs) { _context.Sexs.Add(sexs); await _context.SaveChangesAsync(); return(CreatedAtAction("GetSexs", new { id = sexs.SexId }, sexs)); }
public async Task <IActionResult> PutSexs(int id, Sexs sexs) { if (id != sexs.SexId) { return(BadRequest()); } _context.Entry(sexs).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SexsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public Patient(int id, string name, string surname, double pesel, Sexs sex, DateTime birthDay, string address, string phoneNumber) { Id = id; Name = name; Surname = surname; Pesel = pesel; Sex = sex; BirthDay = birthDay.Date; Address = address; PhoneNumber = phoneNumber; }
public static void Demo7() { Sex sex = Sex.Female; // 将一个字符串转换成枚举 Sexs sex1 = (Sexs)Enum.Parse(typeof(Sexs), "男"); Console.WriteLine(sex1); Console.ReadKey(); // 枚举转字符串 string sex2 = sex.ToString(); Console.WriteLine(sex2); Console.ReadKey(); }
public static void SetPersonnel(Personnel person, user item) { Sexs nSex = Sexs.未知; if (item.gender != null) { nSex = (Sexs)item.gender; } person.Abutment_Id = item.id; person.Name = item.name; person.Sex = nSex; person.Email = item.email; person.Phone = item.phone; person.Mobile = item.mobile; person.Enabled = item.enabled; }
private void AddPerson(string name, Sexs sex, LocationCard tag, Department dep, Post pst, int worknumber, string phone) { Personnel person = new Personnel() { Name = name, Sex = sex, Enabled = true, ParentId = dep.Id, WorkNumber = worknumber, Phone = phone, Pst = pst.Name }; Personnels.Add(person); _bll.BindCardToPerson(person, tag); }
private void AddPerson(string name, Sexs sex, LocationCard tag, Department dep, Post pst, int worknumber, string phone) { Personnel person = new Personnel() { Name = name, Sex = sex, Enabled = true, ParentId = dep.Id, WorkNumber = worknumber, Phone = phone, Pst = pst.Name }; Personnels.Add(person); if (tag != null && person != null) { LocationCardToPersonnel cardToPerson = new LocationCardToPersonnel(); cardToPerson.PersonnelId = person.Id; cardToPerson.LocationCardId = tag.Id; LocationCardToPersonnels.Add(cardToPerson); } }