internal static IEnumerable<string> Phones(Phone_Type[] phones, string module) { List<string> errors = new List<string>(); foreach (var phone in phones) { errors.AddRange(Phone(phone, module)); } return errors; }
public void Set_Phone(Phone_Type type, string number) { sPhone ph; for (int i = 0; i < phones.Count; i++) { if (phones[i].type == type) { ph = phones[i]; ph.number = number; phones[i] = ph; //Error("Phone replaced at " + i.ToString()); return; } } // If not found add it ph = new sPhone(); ph.type = type; ph.number = number; Add_Phone(ph); Error("Phone added"); }
internal static IEnumerable<string> Phone(Phone_Type phone, string module) { List<string> errors = new List<string>(); if (string.IsNullOrWhiteSpace(phone.AreaCode)) { errors.Add(module + " phone AreaCode"); } if (string.IsNullOrWhiteSpace(phone.DialNumber)) { errors.Add(module + " phone DialNumber"); } if (LUObjNotValid(phone.PhoneTypeCode)) { errors.Add(module + " phone PhoneTypeCode"); } return errors; }
public sPhone Get_Phone(Phone_Type type) { sPhone p = new sPhone(); for (int i = 0; i < phones.Count; i++) { if (phones[i].type == type) { p = phones[i]; break; } } if (String.IsNullOrEmpty(p.number)) { Console.WriteLine("Phone type doesn't found!"); } return p; }