public static List <Size_S> GetBase(string globes, List <Size_Special> Item_List, string pays) { List <Size_S> list = new List <Size_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]); Size_Special globe = Item_List.FirstOrDefault(g => g.Code == clue); list.Add(Size_S.GetBase(globe, (float)pay)); } } } catch (Exception ex) { LogHelper.Error(ex); } return(list); }
public static Size_S GetBase(Size_Special item, float pay) { Size_S Size_S = new Size_S() { Id = item.Id, Code = item.Code, GlobeCodeList = Split_Hepler.str_to_ints(item.Globe), IsEnable = item.IsEnable, Name = item.Name, PayReturn = pay, }; return(Size_S); }
/// <summary> /// 设置特码个例 /// </summary> public void Set_Size(Globe_Clue item, List <Size_Special> Size_Special_List) { try { string[] globe_clues2 = item.Clue2.Split(new char[] { ',' }); string[] globe_pays2 = item.Pay2.Split(new char[] { ',' }); for (int i = 0; i < globe_clues2.Length; i++) { int clue = Convert.ToInt32(globe_clues2[i]); float pay = float.Parse(globe_pays2[i]); Size_Special size_Special = Size_Special_List.FirstOrDefault(g => g.Code == clue); if (size_Special != null) { Size_S Size_S = Size_S.GetBase(size_Special, pay); this.Size_S_List.Add(Size_S); } } } catch (Exception ex) { LogHelper.Error(ex); } }
public static string GetBase_Str(string globes, List <Size_Special> Item_List) { string content = string.Empty; try { if (!string.IsNullOrEmpty(globes)) { string[] globeArray = globes.Split(new char[] { ',' }); for (int i = 0; i < globeArray.Length; i++) { int clue = Convert.ToInt32(globeArray[i]); Size_Special globe = Item_List.FirstOrDefault(g => g.Code == clue); content += globe.Name + ","; } } } catch (Exception ex) { LogHelper.Error(ex); } return(content); }