public void UptCorreos(HipotecaCorreo hipoteca) { try { using (var sqlConn = new SqlConnection(this.strConn)) { sqlConn.Open(); var cmd = new SqlCommand(strConn, sqlConn) { CommandType = System.Data.CommandType.StoredProcedure, CommandText = "up_hipotecaCorreo" }; cmd.Parameters.AddWithValue("@id_cliente", hipoteca.IdCliente); cmd.Parameters.AddWithValue("@id_estado", hipoteca.IdCodigoEstado); cmd.Parameters.AddWithValue("@correoEjecutivo", hipoteca.CorreoEjecutivoHipotecario); cmd.Parameters.AddWithValue("@correoVendedor", hipoteca.CorreoVendedorHipotecario); cmd.Parameters.AddWithValue("@correoComprador", hipoteca.CorreoCompradorHipotecario); cmd.Parameters.AddWithValue("@correoUsuarios", hipoteca.CorreoUsuariosOperacion); cmd.Parameters.AddWithValue("@correoLista", hipoteca.CorreoListaCorreo); cmd.Parameters.AddWithValue("@id_formato_correo", hipoteca.IdFormatoCorreo); cmd.Parameters.AddWithValue("@lista", hipoteca.Lista); cmd.ExecuteNonQuery(); } } catch (Exception ex) { throw ex; } }
private void Upt() { var conteo = 0; for (var i = 0; i < gr_dato.Rows.Count; i++) { var row = gr_dato.Rows[i]; var chkEjecutivo = (CheckBox)gr_dato.Rows[i].FindControl("chkEjecutivo"); var chkVendedor = (CheckBox)gr_dato.Rows[i].FindControl("chkVendedor"); var chkComprador = (CheckBox)gr_dato.Rows[i].FindControl("chkComprador"); var chkUsuarios = (CheckBox)gr_dato.Rows[i].FindControl("chkUsuarios"); var chkLista = (CheckBox)gr_dato.Rows[i].FindControl("chkLista"); var txtListaCorreo = (TextBox)gr_dato.Rows[i].FindControl("txtListaCorreo"); var idEstado = Convert.ToInt32(gr_dato.DataKeys[row.RowIndex].Values[0]); var dlFormatoCorreo = (DropDownList)gr_dato.Rows[i].FindControl("dlFormatoCorreo"); var hi = new HipotecaCorreo(); hi.IdCliente = IdCliente; hi.IdCodigoEstado = idEstado; hi.CorreoEjecutivoHipotecario = chkEjecutivo.Checked; hi.CorreoCompradorHipotecario = chkComprador.Checked; hi.CorreoVendedorHipotecario = chkVendedor.Checked; hi.CorreoUsuariosOperacion = chkUsuarios.Checked; hi.CorreoListaCorreo = chkLista.Checked; hi.Lista = txtListaCorreo.Text; hi.IdFormatoCorreo = Convert.ToInt32(dlFormatoCorreo.SelectedValue); if (chkEjecutivo.Checked || chkVendedor.Checked || chkComprador.Checked || chkUsuarios.Checked || chkLista.Checked) { if (hi.IdFormatoCorreo != 0) { new HipotecaCorreoBC().UptCorreos(hi); conteo += 1; } } else { new HipotecaCorreoBC().DelCorreos(hi); } } Mensaje("Se han realizado " + conteo + " cambios."); }
public void DelCorreos(HipotecaCorreo hipoteca) { try { using (var sqlConn = new SqlConnection(this.strConn)) { sqlConn.Open(); var cmd = new SqlCommand(strConn, sqlConn) { CommandType = System.Data.CommandType.StoredProcedure, CommandText = "sp_del_hipoteca_correo" }; cmd.Parameters.AddWithValue("@id_cliente", hipoteca.IdCliente); cmd.Parameters.AddWithValue("@id_estado", hipoteca.IdCodigoEstado); cmd.ExecuteNonQuery(); } } catch (Exception ex) { throw ex; } }
public List <HipotecaCorreo> GetHipotecaCorreos(int idCliente, int idFamilia) { try { using (var sqlConn = new SqlConnection(this.strConn)) { sqlConn.Open(); var cmd = new SqlCommand(strConn, sqlConn) { CommandType = System.Data.CommandType.StoredProcedure, CommandText = "sp_get_Hipoteca_correo" }; cmd.Parameters.AddWithValue("@id_cliente", idCliente); cmd.Parameters.AddWithValue("@id_familia", idFamilia); SqlDataReader reader = cmd.ExecuteReader(); var lista = new List <HipotecaCorreo>(); while (reader.Read()) { var h = new HipotecaCorreo(); h.IdCodigoEstado = Convert.ToInt32(reader["codigo_estado"]); h.CorreoEjecutivoHipotecario = Convert.ToBoolean(reader["correo_ejecutivo_hipotecario"]); h.CorreoVendedorHipotecario = Convert.ToBoolean(reader["correo_vendedor_hipotecario"]); h.CorreoCompradorHipotecario = Convert.ToBoolean(reader["correo_comprador_hipotecario"]); h.CorreoUsuariosOperacion = Convert.ToBoolean(reader["correo_usuarios_operacion"]); h.CorreoListaCorreo = Convert.ToBoolean(reader["correo_lista_correo"]); h.Lista = reader["lista"].ToString(); h.IdFormatoCorreo = Convert.ToInt32(reader["id_formato_correo"]); h.DescripcionEstado = reader["descripcion"].ToString(); lista.Add(h); } return(lista); } } catch (Exception ex) { throw ex; } }
public void DelCorreos(HipotecaCorreo hipoteca) { new HipotecaCorreoDAC().DelCorreos(hipoteca); }
public void UptCorreos(HipotecaCorreo hipoteca) { new HipotecaCorreoDAC().UptCorreos(hipoteca); }