private void LoadPrestadores() { if(this.ID!=NULL_ID && !this.IsPrestadorLoaded) { TicketDS ticketDataService = new TicketDS(); DataSet ds = ticketDataService.List_PrestadoresByTicket(this.ID); if(ds.Tables.Count>0) { foreach (DataRow dr in ds.Tables[0].Rows) { PrestadorCaso p = new PrestadorCaso(); ORM_PrestadorCaso(p, dr); this._prestadorCaso.Add(p); } } this._isPrestadorLoaded = true; } }
public Entities.InterAsisst.PrestadorCaso getPrestadorCaso() { Entities.InterAsisst.PrestadorCaso result = new Entities.InterAsisst.PrestadorCaso(); if(this.IdPrestador>0) result.Prestador = Entities.InterAsisst.Prestador.Get_Shadow(this.IdPrestador); if (this.IdTipoAsistencia.Trim()!=String.Empty) result.TipoServicio = Entities.InterAsisst.TipoServicio.get_Shadow(Int32.Parse(this.IdTipoAsistencia)); result.Comentarios = string.Empty; result.TipoOperacion = this.Estado; result.Costo = this.Costo; result.Kilometros = this.Kilometros; // Verifica si es un nuevo id y en tal caso lo convierte a null. if (Utils.InterAssist.Constants.IsNewPrefix(this.Id)) result.ID = Entities.InterAsisst.PersistEntity.NULL_ID; else result.ID = Int32.Parse(this.Id); return result; }
public static void ORM_PrestadorCaso(PrestadorCaso prestadorCaso, DataRow dr) { prestadorCaso.ID = Int32.Parse(dr["IDTICKETPRESTADOR"].ToString()); prestadorCaso.Prestador = Prestador.GetById(Int32.Parse(dr["IDPRESTADOR"].ToString())); decimal costo = 0; decimal kilometros = 0; FiltroTipoServicio f = new FiltroTipoServicio(); f.ID = Int32.Parse(dr["IDTIPOSERVICIO"].ToString()); prestadorCaso.TipoServicio = TipoServicio.GetById(Int32.Parse(dr["IDTIPOSERVICIO"].ToString())); prestadorCaso.Comentarios = dr["COMENTARIOS"].ToString(); Decimal.TryParse(dr["COSTO"].ToString().Replace(",","."), NumberStyles.Any, new CultureInfo("en-US"), out costo); Decimal.TryParse(dr["KILOMETROS"].ToString().Replace(",", "."), NumberStyles.Any, new CultureInfo("en-US"), out kilometros); prestadorCaso.Kilometros = kilometros; prestadorCaso.Costo = costo; }