public static List <Animal_Info_S> GetBase(string globes, List <Animal_Info> Item_List, string pays) { List <Animal_Info_S> list = new List <Animal_Info_S>(); try { if (!string.IsNullOrEmpty(globes) && !string.IsNullOrEmpty(pays)) { string[] globeArray = globes.Split(new char[] { ',' }); string[] payArray = pays.Split(new char[] { ',' }); for (int i = 0; i < globeArray.Length; i++) { int clue = Convert.ToInt32(globeArray[i]); decimal pay = Convert.ToDecimal(payArray[i]); Animal_Info globe = Item_List.FirstOrDefault(g => g.Code == clue); list.Add(Animal_Info_S.GetBase(globe, (float)pay)); } } } catch (Exception ex) { LogHelper.Error(ex); } return(list); }
public static Animal_Info_S GetBase(Animal_Info item, float pay) { Animal_Info_S Animal_InfoS = new Animal_Info_S() { Id = item.Id, Code = item.Code, GlobeCodeList = Split_Hepler.str_to_ints(item.Globe), IsEnable = item.IsEnable, Name = item.Name, PayReturn = pay, }; return(Animal_InfoS); }