public void SetClient(SelectionWell sw, Objecte obj = null) { if (sw == null) { return; } client = Helpers.LogicHelper.ClientsLogic.FirstModel(sw.GetIDValue(C.SelectionWell.Well, C.Well.Object, C.Objecte.Client)); if (obj == null) { objecte = client.Objects.FirstOrDefault(x => AdresHelper.ComparisonAdres(x.Adres, Adres) || Acount.Split(',').FirstOrDefault(y => x.Accounts.Contains(y)) != null); } else { objecte = obj; } if (objecte != null) { List <string> ac = new List <string>(); foreach (var one in Acount.Split(',')) { if (!objecte.Accounts.Contains(one)) { ac.Add(one); } } if (ac.Count > 0) { objecte.SetAccounts(ac.ToArray()); } sample = Helpers.LogicHelper.SampleLogic.FirstModel(sw.SampleID); } }
public Item(SelectionWell sw) { client = Helpers.LogicHelper.ClientsLogic.FirstModel(sw.GetIDValue(C.SelectionWell.Well, C.Well.Object, C.Objecte.Client)); NameClient = client.Detail.FullName.StringDivision(30); INN = client.INN; objecte = sw.Objecte; Adres = objecte.Adres; sample = sw.Sample; }