Inheritance: IBus, IReplier
        public bool Update(int id, string name, string group, string address, string phone)
        {
            Contact objCont = new Contact()
            {
                Id       = id,
                FullName = name,
                Group    = group,
                Address  = address,
                Phone    = phone
            };
            bool checkPhone = InternalBus.PhoneValid(phone);

            if (checkPhone)
            {
                if (objCD.Update(objCont) == 1)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }
Exemple #2
0
        public static bool Insert(string name, string group, string address, string phone)
        {
            Contact objCont = new Contact()
            {
                FullName = name,
                Group    = group,
                Address  = address,
                Phone    = phone
            };
            bool checkPhone = InternalBus.PhoneValid(phone);

            if (checkPhone)
            {
                if (objCD.Insert(objCont) == 1)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }