예제 #1
0
 /// <summary>
 ///     公猪下拉列表
 /// </summary>
 /// <returns></returns>
 public IEnumerable<SelectListItem> GetMalePigList()
 {
     var pigService = new PigService();
     var pigTypeService = new PigTypeService();
     pig_type pigType = pigTypeService.FindByName("公猪");
     if (pigType == null) return new List<SelectListItem>();
     IEnumerable<SelectListItem> pigSelect = pigService.FindByPigTypeId(pigType.Id)
                                                       .Select(pigtypeItem => new SelectListItem
                                                                                  {
                                                                                      Text =
                                                                                          pigtypeItem.
                                                                                          Number,
                                                                                      Value =
                                                                                          pigtypeItem.
                                                                                              Id +
                                                                                          string.Empty,
                                                                                  }).OrderBy(m => m.Text);
     return pigSelect;
 }