private void SetTicketInCotrols(Entities.InterAsisst.Ticket t) { this.ObjectHash = t.UObjectID; this.lbltxtCaso.Text = t.ID.ToString(); this.lblTextOperador.Text = string.Format(OPERADOR_TEXT, t.Operador.ID.ToString(), t.Operador.Apellido, t.Operador.Nombre); this.lblTextFecha.Text = t.Fecha.ToString(); this.ddlEstado.SelectedValue = t.IdEstado.ToString(); this.ddlProblema.SelectedValue = t.IdProblema.ToString(); this.txtTelefono.Text = t.Telefono; this.UbicacionDestino.IsNew = false; this.UbicacionOrigen.IsNew = false; // Datos Origen this.UbicacionOrigen.Dirección = t.CalleOrigen; this.UbicacionOrigen.IdPais = t.IdPaisOrigen; this.UbicacionOrigen.IDLocalidad = t.IdLocalidadOrigen; // Datos Destino this.UbicacionDestino.Dirección = t.CalleDestino; this.UbicacionOrigen.IdPais = t.IdPaisOrigen; this.UbicacionDestino.IDLocalidad = t.IdLocalidadDestino; // Prestador this.IdPrestador = t.IdPrestador; this.Prestadorctrl.CargarPrestador(t.IdPrestador); // Observaciones this.ddlProblema.SelectedValue = t.IdProblema.ToString(); if (t.ObservacionesHistoricas.Count > 0) { this.ShowObservaciones(true); this.rptObservaciones.DataSource = t.ObservacionesHistoricas; this.rptObservaciones.DataBind(); } this.divDatosPrestador.Visible = t.IdPrestador != -1; this.ddlTipoCaso.SelectedValue = t.TipoTicket; this.ddlTipoServicio.SelectedValue = t.IdTipoServicio.ToString(); }
private Entities.InterAsisst.Ticket GetTicketFromControl() { Entities.InterAsisst.Ticket t = new Entities.InterAsisst.Ticket(this.EntityID, this.ObjectHash); t.IdAfiliado = Classes.SessionHelper.ID_CASO_AFILIADO; t.IdEstado = Int32.Parse(this.ddlEstado.SelectedValue); t.Telefono = this.txtTelefono.Text.Trim(); t.IDOperador = this.SessionOperador.ID; t.TipoTicket = this.ddlTipoCaso.SelectedValue; // Datos Origen. Classes.Ubicacion uOrigen = this.UbicacionOrigen.GetUbicacion; t.IdPaisOrigen = uOrigen.IDPais; t.IdProvinciaOrigen = uOrigen.IDProvincia; t.IdCiudadOrigen = uOrigen.IDCiudad; t.IdLocalidadOrigen = uOrigen.IDLocalidad; t.CalleOrigen = this.UbicacionOrigen.Dirección; // Datos Destino. Classes.Ubicacion uDestino = this.UbicacionDestino.GetUbicacion; t.IdPaisDestino = uDestino.IDPais; t.IdProvinciaDestino = uDestino.IDProvincia; t.IdCiudadDestino = uDestino.IDCiudad; t.IdLocalidadDestino = uDestino.IDLocalidad; t.CalleDestino = this.UbicacionDestino.Dirección; t.IdPrestador = this.IdPrestador; t.IdProblema = Int32.Parse(this.ddlProblema.SelectedValue); t.IdTipoServicio = Int32.Parse(this.ddlTipoServicio.SelectedValue); // Detalles t.Observacion = new Observacion(SessionOperador.ID); t.Observacion.Descripcion = string.Format(TIPO_TICKET, t.TipoTicket) + this.txtDetalles.Text.Trim(); return(t); }
protected void dtgAfiliados_ItemDataBound(object sender, DataGridItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { Entities.InterAsisst.Ticket t = (Entities.InterAsisst.Ticket)e.Item.DataItem; ((LinkButton)e.Item.Cells[(int)Columnas.IdTicket].Controls[0]).CommandArgument = t.ID.ToString(); ((LinkButton)e.Item.Cells[(int)Columnas.IdTicket].Controls[0]).Text = t.ID.ToString(); ((LinkButton)e.Item.Cells[(int)Columnas.IdTicket].Controls[0]).ToolTip = String.Format(Resource.TOOL_TIP_ID_CASO, t.ID.ToString()); e.Item.Cells[(int)Columnas.Tipo].Text = t.TipoTicket; e.Item.Cells[(int)Columnas.MarcaModelo].Text = ResultMarcaModelo(t.Marca, t.Modelo); e.Item.Cells[(int)Columnas.Patente].Text = t.Patente; e.Item.Cells[(int)Columnas.LocalidadOrigen].Text = t.NombreLocalidadOrigen; e.Item.Cells[(int)Columnas.LocalidadDestino].Text = t.NombreLocalidadDestino; e.Item.Cells[(int)Columnas.Empresa].Text = t.NombreEmpresa; e.Item.Cells[(int)Columnas.Fecha].Text = t.Fecha.ToString(); e.Item.Cells[(int)Columnas.Operador].Text = t.NombreOperador; } }
private void Aceptar(bool salir) { if (this.IsValid) { Entities.InterAsisst.Ticket t = this.GetTicketFromControl(); if (t.Persist()) { // Success: if (!salir) { this.ReloadEntity(t.ID); } this.SendSuccMsg(t.ID.ToString(), salir); } else { // Error: this.SendErrorMsg(); } } }
private void InicializaControles() { this.EntityID = Classes.SessionHelper.ID_CASO; this.ShowAsPrestador(); this.inicializaControlUbicacionDestino(); this.InicializaControlUbicacionOrigen(); this.InicializaCombosPrestador(); this.InicializaComboTipos(); this.InicializaComboProblema(); this.InicializaComboEstados(); this.InicializaComboTipoAsistencia(); if (!this.IsNew) { Entities.InterAsisst.Ticket t = Entities.InterAsisst.Ticket.GetById(this.EntityID); Classes.SessionHelper.ID_CASO_AFILIADO = t.IdAfiliado; this.SetTicketInCotrols(t); } else { this.InicializaControlAfilado(Classes.SessionHelper.ID_CASO_AFILIADO); this.ShowObservaciones(false); } this.InicializaControlAfilado(Classes.SessionHelper.ID_CASO_AFILIADO); // Varifica si le tiene que cambiar el rotulo al boton. if (this.TienePrestadorAsignado) { this.btnAsignarPrestador.Text = Resource.BTN_QUITAR_PRESTADOR; } this.SetValidadores(this.ddlTipoCaso.SelectedValue); }
private Entities.InterAsisst.Ticket GetTicketFromControl() { Entities.InterAsisst.Ticket t = new Entities.InterAsisst.Ticket(this.EntityID, this.ObjectHash); t.IdAfiliado = Classes.SessionHelper.ID_CASO_AFILIADO; t.IdEstado = Int32.Parse(this.ddlEstado.SelectedValue); t.Telefono = this.txtTelefono.Text.Trim(); t.IDOperador = this.SessionOperador.ID; t.TipoTicket = this.ddlTipoCaso.SelectedValue; // Datos Origen. Classes.Ubicacion uOrigen = this.UbicacionOrigen.GetUbicacion; t.IdPaisOrigen = uOrigen.IDPais; t.IdProvinciaOrigen = uOrigen.IDProvincia; t.IdCiudadOrigen = uOrigen.IDCiudad; t.IdLocalidadOrigen = uOrigen.IDLocalidad; t.CalleOrigen = this.UbicacionOrigen.Dirección; // Datos Destino. Classes.Ubicacion uDestino = this.UbicacionDestino.GetUbicacion; t.IdPaisDestino = uDestino.IDPais; t.IdProvinciaDestino = uDestino.IDProvincia; t.IdCiudadDestino = uDestino.IDCiudad; t.IdLocalidadDestino = uDestino.IDLocalidad; t.CalleDestino = this.UbicacionDestino.Dirección; t.IdProblema = Int32.Parse(this.ddlProblema.SelectedValue); /*t.IdTipoServicio = Int32.Parse(this.ddlTipoServicio.SelectedValue);*/ // Detalles t.Observacion = new Observacion(SessionOperador.ID); t.Observacion.Descripcion = string.Format(TIPO_TICKET, t.TipoTicket) + this.txtDetalles.Text.Trim(); // Prestadores foreach(var p in this.PrestadoresAsignados) { PrestadorCaso entPrestador = p.getPrestadorCaso(); if(!entPrestador.IsNew || entPrestador.TipoOperacion!=Constants.PersistOperationType.Delete) { t.PrestadorCaso.Add(p.getPrestadorCaso()); } } return t; }
public static void ORM(Ticket ticket, DataRow dr) { ticket._id = Int32.Parse(dr[TicketDS.COL_IDTICKET].ToString()); ticket._idOperador = Int32.Parse(dr[TicketDS.COL_IDOPERADOR].ToString()); ticket._idPaisOrigen = PersistEntity.NuleableInt(dr[TicketDS.COL_IDPAIS_ORIGEN].ToString()); ticket._idAfiliado = Int32.Parse(dr[TicketDS.COL_IDAFILIADO].ToString()); //ticket._idPrestador = PersistEntity.NuleableInt(dr[TicketDS.COL_IDPRESTADOR].ToString()); ticket._telefono = dr[TicketDS.COL_TELEFONO].ToString(); ticket._idEstado = Int32.Parse(dr[TicketDS.COL_IDESTADO].ToString()); ticket._idPaisDestino = PersistEntity.NuleableInt(dr[TicketDS.COL_IDPAIS_DESTINO].ToString()); ticket._idProvinciaDestino = PersistEntity.NuleableInt(dr[TicketDS.COL_IDPROVINCIA_DESTINO].ToString()); ticket._idProvinciaOrigen = PersistEntity.NuleableInt(dr[TicketDS.COL_IDPROVINCIA_ORIGEN].ToString()); ticket._idCiudadOrigen = PersistEntity.NuleableInt(dr[TicketDS.COL_IDCIUDAD_ORIGEN].ToString()); ticket._idCiudadDestino = PersistEntity.NuleableInt(dr[TicketDS.COL_IDCIUDAD_DESTINO].ToString()); ticket._idLocalidadDestino = PersistEntity.NuleableInt(dr[TicketDS.COL_IDLOCALIDAD_DESTINO].ToString()); ticket._idLocalidadOrigen = PersistEntity.NuleableInt(dr[TicketDS.COL_IDLOCALIDAD_ORIGEN].ToString()); ticket._calle_origen = dr[TicketDS.COL_CALLE_ORIGEN].ToString(); ticket._altura_origen = dr[TicketDS.COL_ALTURA_ORIGEN].ToString(); ticket._calle_destino = dr[TicketDS.COL_CALLE_DESTINO].ToString(); ticket._altura_destino = dr[TicketDS.COL_ALTURA_DESTINO].ToString(); ticket._fecha = (DateTime)dr[TicketDS.COL_FECHA]; ticket._idProblema = Int32.Parse(dr[TicketDS.COL_ID_PROBLEMA].ToString()); //ticket._idTipoServicio = Int32.Parse(dr[TicketDS.COL_IDTIPOSERVICIO].ToString()); // Columnas para el listado. ticket._patente = dr[TicketDS.COL_PATENTE].ToString(); ticket._poliza = dr[TicketDS.COL_POLIZA].ToString(); //ticket._nombrePrestador = dr[TicketDS.COL_NOMBRE_PRESTADOR].ToString(); ticket._nombreOperador = dr[TicketDS.COL_NOMBRE_OPERADOR].ToString(); ticket._problema = dr[TicketDS.COL_PROBLEMA].ToString(); ticket._nombreEmpresa = dr[TicketDS.COL_NOMBRE_EMPRESA].ToString(); ticket._nombreAfiliado = dr[TicketDS.COL_NOMBRE_AFILIADO].ToString(); ticket._tipoTicket = dr[TicketDS.COL_TIPO_TICKET].ToString(); ticket._nombreLocalidadOrigen = dr[TicketDS.COL_LOCALIDAD_ORIGEN_NOMBRE].ToString(); ticket._nombreLocalidadDestino = dr[TicketDS.COL_LOCALIDAD_DESTINO_NOMBRE].ToString(); ticket._marca = dr[TicketDS.COL_MARCA].ToString(); ticket._modelo = dr[TicketDS.COL_MODELO].ToString(); }
public static List<Ticket> List(FiltroTicket f, out int RecordCount) { List<Ticket> resultList = new List<Ticket>(); try { TicketDS dataservice = new TicketDS(); DataSet ds = dataservice.List(f, out RecordCount); if (ds.Tables.Count > 0) { foreach (DataRow r in ds.Tables[0].Rows) { Ticket t = new Ticket(); ORM(t, r); resultList.Add(t); } } } catch (Exception ex) { throw ex; } return resultList; }
public static Ticket GetById(int id) { Ticket ticketResult = null; try { TicketDS ticketDS = new TicketDS(); String objectHash = Guid.NewGuid().ToString(); DataRow dr = ticketDS.GetObjectById(id, objectHash); if (dr != null) { ticketResult = new Ticket(); ticketResult._UObjectID = objectHash; ORM(ticketResult, dr); ticketResult.ObservacionesHistoricas = Observacion.ListByTicket(ticketResult.ID); ticketResult.LoadPrestadores(); } } catch (Exception ex) { throw ex; } return ticketResult; }