Example #1
0
        public void addDex(Models.AgenteSeguro formData)
        {
            try
            {
                string        connectionString = System.Configuration.ConfigurationManager.ConnectionStrings["UkuviConnect"].ConnectionString;
                SqlConnection conn             = new SqlConnection(connectionString);
                SqlCommand    com = new SqlCommand("dirExa", conn);
                com.CommandType = CommandType.StoredProcedure;
                com.Parameters.AddWithValue("@udominio", formData.Dominio);
                com.Parameters.AddWithValue("@uestado", formData.Dir_Estado);
                com.Parameters.AddWithValue("@umuni", formData.Dir_MuniDele);
                com.Parameters.AddWithValue("@ucalle", formData.Dir_Calle);
                com.Parameters.AddWithValue("@ucolonia", formData.Dir_Colonia);
                com.Parameters.AddWithValue("@unint", formData.Dir_NoInt);
                com.Parameters.AddWithValue("@unext", formData.Dir_NoExt);
                com.Parameters.AddWithValue("@ucp", formData.Dir_CP);

                conn.Open();
                com.ExecuteNonQuery();
                conn.Close();
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine(e.Message + " This is the error");
            }
        }
Example #2
0
        public void addRedes(Models.AgenteSeguro formData)
        {
            try
            {
                string        connectionString = System.Configuration.ConfigurationManager.ConnectionStrings["UkuviConnect"].ConnectionString;
                SqlConnection conn             = new SqlConnection(connectionString);
                SqlCommand    com = new SqlCommand("addRedes", conn);
                com.CommandType = CommandType.StoredProcedure;
                com.Parameters.AddWithValue("@udominio", formData.Dominio);
                com.Parameters.Add(new SqlParameter("@ufacebook", ToDBNull(formData.Facebook)));
                com.Parameters.Add(new SqlParameter("@utwitter", ToDBNull(formData.Twitter)));
                com.Parameters.Add(new SqlParameter("@uinstagram", ToDBNull(formData.Instagram)));
                com.Parameters.Add(new SqlParameter("@ulinkedin", ToDBNull(formData.LinkedIn)));
                com.Parameters.Add(new SqlParameter("@uyoutube", ToDBNull(formData.Youtube)));

                conn.Open();
                com.ExecuteNonQuery();
                conn.Close();
            }


            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine(e.Message + " This is the error");
            }
        }
Example #3
0
        public void clearAgente(Models.AgenteSeguro formData)
        {
            try
            {
                string        connectionString = System.Configuration.ConfigurationManager.ConnectionStrings["UkuviConnect"].ConnectionString;
                SqlConnection conn             = new SqlConnection(connectionString);
                SqlCommand    com = new SqlCommand("clearAgente", conn);
                com.CommandType = CommandType.StoredProcedure;
                com.Parameters.AddWithValue("@udominio", formData.Dominio);

                conn.Open();
                com.ExecuteNonQuery();
                conn.Close();
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine(e.Message + " This is the error");
            }
        }
Example #4
0
        public void addCorreo(Models.AgenteSeguro formData)
        {
            int test = formData.Campo;


            if (test == 1)
            {
                try
                {
                    string        connectionString = System.Configuration.ConfigurationManager.ConnectionStrings["UkuviConnect"].ConnectionString;
                    SqlConnection conn             = new SqlConnection(connectionString);
                    string        commandText      = "DECLARE @id INT Select @id = A.ID_Agente from AgenteSLandingP A WHERE SubDominio_Page  LIKE '%" + formData.Dominio + "%' UPDATE AgenteSeguros SET CorreoElectronico_1 ='" + formData.CorreoElectronico_1 + "' WHERE ID_Agente = @id";
                    SqlCommand    cmd = new SqlCommand(commandText, conn);
                    System.Diagnostics.Debug.WriteLine(commandText);
                    conn.Open();
                    cmd.ExecuteNonQuery();
                    conn.Close();
                }

                catch (Exception e)
                {
                    System.Console.WriteLine(e.Message);
                }
            }

            if (test == 2)
            {
                try
                {
                    string        connectionString = System.Configuration.ConfigurationManager.ConnectionStrings["UkuviConnect"].ConnectionString;
                    SqlConnection conn             = new SqlConnection(connectionString);
                    string        commandText      = "DECLARE @id INT Select @id = A.ID_Agente from AgenteSLandingP A WHERE SubDominio_Page  LIKE '%" + formData.Dominio + "%' UPDATE AgenteSeguros SET CorreoElectronico_2 ='" + formData.CorreoElectronico_1 + "' WHERE ID_Agente = @id";
                    SqlCommand    cmd = new SqlCommand(commandText, conn);
                    System.Diagnostics.Debug.WriteLine(commandText);
                    conn.Open();
                    cmd.ExecuteNonQuery();
                    conn.Close();
                }

                catch (Exception e)
                {
                    System.Console.WriteLine(e.Message);
                }
            }

            if (test == 3)
            {
                try
                {
                    string        connectionString = System.Configuration.ConfigurationManager.ConnectionStrings["UkuviConnect"].ConnectionString;
                    SqlConnection conn             = new SqlConnection(connectionString);
                    string        commandText      = "DECLARE @id INT Select @id = A.ID_Agente from AgenteSLandingP A WHERE SubDominio_Page  LIKE '%" + formData.Dominio + "%' UPDATE AgenteSeguros SET CorreoElectronico_3 ='" + formData.CorreoElectronico_1 + "'  WHERE ID_Agente = @id";
                    SqlCommand    cmd = new SqlCommand(commandText, conn);
                    System.Diagnostics.Debug.WriteLine(commandText);
                    conn.Open();
                    cmd.ExecuteNonQuery();
                    conn.Close();
                }

                catch (Exception e)
                {
                    System.Console.WriteLine(e.Message);
                }
            }
        }