public static void GrabarTelefono(string telefono, string tipoTel, string codigo) { var usuariosdad = new UsuarioCore(); var Current = HttpContext.Current; var coreUsuario = new UsuarioCore(); UsuarioEntidad usuarioentidadStatic; if (HttpContext.Current.Session["Usuario"] != null) { usuarioentidadStatic = (UsuarioEntidad)Current.Session["Usuario"]; } else { return; } if (!string.IsNullOrEmpty(telefono) && !string.IsNullOrEmpty(codigo)) { var telefonoNuevo = new TelefonoEntidad(); telefonoNuevo.NroTelefono = telefono; telefonoNuevo.miUsuario = new UsuarioEntidad(); telefonoNuevo.miUsuario.NombreUsuario = usuarioentidadStatic.NombreUsuario; telefonoNuevo.CodArea = codigo; telefonoNuevo.miTipoTel = new TipoTelEntidad(); telefonoNuevo.miTipoTel.IdTipoTel = Convert.ToInt32(tipoTel); telefonoNuevo.miUsuario.CUIT = usuarioentidadStatic.CUIT; coreUsuario.insertTelefonoUsuario(telefonoNuevo); } }
private List <TelefonoEntidad> MapearMuchos(DataSet ds) { List <TelefonoEntidad> ResUnosTel = new List <TelefonoEntidad>(); try { foreach (DataRow row in ds.Tables[0].Rows) { TelefonoEntidad unTel = new TelefonoEntidad(); unTel.miUsuario = new UsuarioEntidad(); unTel.miUsuario.CUIT = row["CUIT"].ToString(); unTel.miUsuario.NombreUsuario = row["NombreUsuario"].ToString(); unTel.NroTelefono = row["NroTelefono"].ToString(); unTel.CodArea = row["CodArea"].ToString(); unTel.miTipoTel = new TipoTelEntidad(); unTel.miTipoTel.IdTipoTel = (int)row["IdTipoTel"]; if (row["FecBaja"].ToString() != "") { unTel.FecBaja = DateTime.Parse(row["FecBaja"].ToString()); } ResUnosTel.Add(unTel); } return(ResUnosTel); } catch (Exception es) { throw; } }
/// <summary> /// Updates a record in the Tarjeta table. /// </summary> public void UpdateDatosPersonales(TelefonoEntidad telefono) { ValidationUtility.ValidateArgument("tarjeta", telefono); SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@cuit", telefono.miUsuario.CUIT), new SqlParameter("@NombreUsuario", telefono.miUsuario.NombreUsuario), new SqlParameter("@NroTelefono", telefono.NroTelefono), new SqlParameter("@IdTipoTel", telefono.miTipoTel.IdTipoTel) }; SqlClientUtility.ExecuteNonQuery(SqlClientUtility.connectionStringName, CommandType.StoredProcedure, "TelefonoUpdateDatosPersonales", parameters); }
/// <summary> /// Saves a record to the Telefono table. /// </summary> public void Insert(TelefonoEntidad telefono) { ValidationUtility.ValidateArgument("telefono", telefono); SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@CUIT", telefono.CUIT), new SqlParameter("@NombreUsuario", telefono.NombreUsuario), new SqlParameter("@NroTelefono", telefono.NroTelefono), new SqlParameter("@CodArea", telefono.CodArea), new SqlParameter("@IdTipoTel", telefono.IdTipoTel) }; SqlClientUtility.ExecuteNonQuery(SqlClientUtility.connectionStringName, CommandType.StoredProcedure, "TelefonoInsert", parameters); }
/// <summary> /// Selects a single record from the Telefono table. /// </summary> public TelefonoEntidad Select(string cuit, string nombreUsuario, string nroTelefono, string codArea, int idTipoTel) { SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@cuit", cuit), new SqlParameter("@NombreUsuario", nombreUsuario), new SqlParameter("@NroTelefono", nroTelefono), new SqlParameter("@CodArea", codArea), new SqlParameter("@IdTipoTel", idTipoTel) }; using (DataTable dt = SqlClientUtility.ExecuteDataTable(SqlClientUtility.connectionStringName, CommandType.StoredProcedure, "TelefonoSelect", parameters)) { TelefonoEntidad entidad = new TelefonoEntidad(); // entidad = Mapeador.MapearFirst <TelefonoEntidad>(dt); return(entidad); } }
protected void grillatelefonos_RowUpdating(object sender, GridViewUpdateEventArgs e) { TelefonoEntidad TelefonoActualizado = new TelefonoEntidad(); GridViewRow row = grillatelefonos.Rows[e.RowIndex]; var CodArea = ((TextBox)row.Cells[2].Controls[0]).Text; var Telefono = ((TextBox)row.Cells[3].Controls[0]).Text; var Tipo = ((DropDownList)row.Cells[4].Controls[1]).SelectedIndex; TelefonoActualizado.miUsuario = new UsuarioEntidad(); TelefonoActualizado.miUsuario.CUIT = usuarioentidad.CUIT; TelefonoActualizado.miUsuario.NombreUsuario = usuarioentidad.NombreUsuario; TelefonoActualizado.NroTelefono = Telefono; TelefonoActualizado.CodArea = CodArea; int tipodetelefono = 1; if (Tipo == 1) { tipodetelefono = 2; } TelefonoActualizado.miTipoTel = new TipoTelEntidad(); TelefonoActualizado.miTipoTel.IdTipoTel = tipodetelefono; UsuarioBLL.UpdateTelefonosPersonales(TelefonoActualizado); ////Reset the edit index. grillatelefonos.EditIndex = -1; //////Bind data to the GridView control. grillatelefonos.DataBind(); CargarGrillaTelefonos(); }
////Para mantener la sesión activa //[WebMethod(EnableSession = true)] //public static void MantenerSesion() //{ //} protected void Page_Load(object sender, EventArgs e) { //En caso de no tener un Pedido vigente redirige a home var Current = HttpContext.Current; if (Current.Session["Productos"] == null) { Response.Redirect("/Areas/Public/Forms/Home.aspx"); } logueado = (UsuarioEntidad)Current.Session["Usuario"]; idioma = new LenguajeEntidad(); if (!IsPostBack) { idioma = (LenguajeEntidad)Session["Idioma"]; if (idioma == null) { idioma = new LenguajeEntidad(); idioma.DescripcionLenguaje = "es"; Session["Idioma"] = idioma; } cotizacion = new MonedaEmpresaEntidad(); cotizacion = (MonedaEmpresaEntidad)Session["Cotizacion"]; Session.Add("cotizacionAnterior", ""); } else { cotizacion.IdMoneda = Convert.ToInt16(Master.obtenerValorDropDown()); Session["Cotizacion"] = cotizacion; idioma.DescripcionLenguaje = Master.obtenerIdiomaCombo(); Session["Idioma"] = idioma; } if (cotizacion != null) { moneda = _coreMoneda.selectMoneda(cotizacion.IdMoneda); } DropDownList lblIdioma = FindControlFromMaster <DropDownList>("ddlLanguages"); if (lblIdioma != null) { lblIdioma.SelectedValue = idioma.DescripcionLenguaje; } DropDownList lblStatus = FindControlFromMaster <DropDownList>("MonedaDRW"); if (lblStatus != null) { if (cotizacion != null) { lblStatus.SelectedValue = cotizacion.IdMoneda.ToString(); } } if (logueado != null) { var dirs = _usuarioManager.FindDireccionesPredeterminadas(logueado); direccionEnvio = dirs .Where(x => x.IdTipoDireccion == (int)TipoDireccionEntidad.Options.Envio) .FirstOrDefault(); direccionFacturacion = dirs .Where(x => x.IdTipoDireccion == (int)TipoDireccionEntidad.Options.Facturacion) .FirstOrDefault(); telefonoContacto = _usuarioManager.FindTelefonoContacto(logueado.NombreUsuario); } }
public void insertTelefonoUsuario(TelefonoEntidad tel) { DaldeTelefono.Insert(tel); }
public void UpdateTelefonosPersonales(TelefonoEntidad telefono) { DaldeTelefono.UpdateDatosPersonales(telefono); }