예제 #1
0
        public static string InsCliente(string Nombre, string ApPaterno, string ApMaterno, string Telefono, string Correo, string UrlFoto)
        {
            try
            {
                List <ClientesVO> LstClientes = DALClientes.GetListClientes(null);//Se llena lista
                bool Existe = false;

                foreach (ClientesVO item in LstClientes)//Recorre lista
                {
                    if (item.Nombre == Nombre & item.ApPaterno == ApPaterno && item.ApMaterno == ApMaterno)
                    {
                        Existe = true;
                    }
                }

                if (Existe)
                {
                    return("El nombre de cliente ya fue utilizado con anterioridad");
                }
                else
                {
                    DALClientes.InsCliente(Nombre, ApPaterno, ApMaterno, Telefono, Correo, UrlFoto);
                    return("Cliente agregado");
                }
            }
            catch (Exception ex)
            {
                return(ex.Message);
            }
        }// del InsertCliente