Exemplo n.º 1
0
 public static sPhone Parse(XElement e)
 {
     sPhone p = new sPhone();
     p.type = (Phone_Type)Enum.Parse(typeof(Phone_Type), Patient.Get_XValue(e, "Type"));
     p.number = Patient.Get_XValue(e, "Number");
     return p;
 }
Exemplo n.º 2
0
        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;
        }
Exemplo n.º 3
0
        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");
        }
Exemplo n.º 4
0
 public void Add_Phone(sPhone p)
 {
     phones.Add(p);
 }