public static List <Prestador> List(FiltroPrestador filtro, out int RecordCount) { List <Prestador> prestadorList = new List <Prestador>(); try { PrestadorDS dataService = new PrestadorDS(); DataSet ds = dataService.List(filtro, out RecordCount); if (ds.Tables.Count > 0) { foreach (DataRow r in ds.Tables[0].Rows) { Prestador p = new Prestador(); ORM(p, r); prestadorList.Add(p); } } }catch (Exception ex) { throw ex; } return(prestadorList); }
protected void dtgPrestador_ItemDataBound(object sender, DataGridItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { Entities.InterAsisst.Prestador p = (Entities.InterAsisst.Prestador)e.Item.DataItem; e.Item.Cells[(int)ColumnasPrestador.Id].Text = p.ID.ToString(); e.Item.Cells[(int)ColumnasPrestador.Pais].Text = p.NombrePais; e.Item.Cells[(int)ColumnasPrestador.Provincia].Text = p.ProvinciaNombre; e.Item.Cells[(int)ColumnasPrestador.Localidad].Text = p.LocalidadNombre; e.Item.Cells[(int)ColumnasPrestador.Nombre].Text = p.Nombre; e.Item.Cells[(int)ColumnasPrestador.Domicilio].Text = p.Domicilio; e.Item.Cells[(int)ColumnasPrestador.Telefono1].Text = p.Telefono1; ((LinkButton)e.Item.Cells[(int)ColumnasPrestador.MasInfo].Controls[0]).CommandArgument = p.ID.ToString(); ((LinkButton)e.Item.Cells[(int)ColumnasPrestador.Asignar].Controls[0]).CommandArgument = p.ID.ToString(); } }
public static Prestador GetById(int id) { Prestador resultPrestador = null; PrestadorDS dataServicePrestador = new PrestadorDS(); String ObjectHash = Guid.NewGuid().ToString(); DataRow dr = dataServicePrestador.GetObjectById(id, ObjectHash); if (dr != null) { resultPrestador = new Prestador(); resultPrestador._UObjectID = ObjectHash; ORM(resultPrestador, dr); } return(resultPrestador); }
private static void ORM(Prestador prestador, DataRow dr) { prestador._id = Int32.Parse(dr[PrestadorDS.COL_ID_PRESTADOR].ToString()); prestador._nombre = dr[PrestadorDS.COL_NOMBRE].ToString(); prestador._descripcion = dr[PrestadorDS.COL_DESCRIPCION].ToString(); prestador._activo = Int32.Parse(dr[PrestadorDS.COL_ESTADO].ToString()) == ACTIVO; prestador._telefono1 = dr[PrestadorDS.COL_TELEFONO1].ToString(); prestador._telefono2 = dr[PrestadorDS.COL_TELEFONO2].ToString(); prestador._celular1 = dr[PrestadorDS.COL_CELULAR1].ToString(); prestador._celular2 = dr[PrestadorDS.COL_CELULAR2].ToString(); prestador._nextel = dr[PrestadorDS.COL_NEXTEL].ToString(); prestador._domicilio = dr[PrestadorDS.COL_DOMICILIO].ToString(); prestador._idCiudad = Int32.Parse(dr[PrestadorDS.COL_ID_CIUDAD].ToString()); prestador._nombreCiudad = dr[PrestadorDS.COL_NOMBRE_CIUDAD].ToString(); prestador._provinciaNombre = dr[PrestadorDS.COL_PROVINCA_NOMBRE].ToString(); prestador._idProvincia = Int32.Parse(dr[PrestadorDS.COL_IDPROVINCIA].ToString()); prestador._idPais = Int32.Parse(dr[PrestadorDS.COL_IDPAIS].ToString()); prestador._idlocalidad = Int32.Parse(dr[PrestadorDS.COL_IDLOCALIDAD].ToString()); prestador._localidadNombre = dr[PrestadorDS.COL_LOCALIDAD_NOMBRE].ToString(); prestador._nombrePais = dr[PrestadorDS.COL_PAIS_NOMBRE].ToString(); prestador._email = dr[PrestadorDS.COL_EMAIL].ToString(); prestador._cuit = dr[PrestadorDS.COL_CUIT].ToString(); prestador._iva = dr[PrestadorDS.COL_IVA].ToString(); prestador._LIV_MOVIDA = PersistEntity.FloatConvet(dr[PrestadorDS.COL_LIV_MOVIDA]); prestador.LIV_KM = PersistEntity.FloatConvet(dr[PrestadorDS.COL_LIV_KM]); prestador.SP1_MOVIDA = PersistEntity.FloatConvet(dr[PrestadorDS.COL_SP1_MOVIDA]); prestador.SP1_KM = PersistEntity.FloatConvet(dr[PrestadorDS.COL_SP1_KM]); prestador.SP2_MOVIDA = PersistEntity.FloatConvet(dr[PrestadorDS.COL_SP2_MOVIDA]); prestador.SP2_KM = PersistEntity.FloatConvet(dr[PrestadorDS.COL_SP2_KM]); prestador.PS1_MOVIDA = PersistEntity.FloatConvet(dr[PrestadorDS.COL_PS1_MOVIDA]); prestador.PS1_KM = PersistEntity.FloatConvet(dr[PrestadorDS.COL_PS1_KM]); prestador.PS2_MOVIDA = PersistEntity.FloatConvet(dr[PrestadorDS.COL_PS2_MOVIDA]); prestador.PS2_KM = PersistEntity.FloatConvet(dr[PrestadorDS.COL_PS2_KM]); }
private void SetPresatador(Prestador p) { this.EntityID = p.ID; this.ObjectHash = p.UObjectID; // Valores generales. if (!this.IsNewEntity) this.lbltxtId.Text = p.ID.ToString(); this.txtNombre.Text = p.Nombre; this.chkActivo.Checked = p.Activo; this.txtCuit.Text = p.Cuit; this.txtEmail.Text = p.Email; this.txtDomicio.Text = p.Domicilio; this.txtNextel.Text = p.Nextel; this.txtTelefono1.Text = p.Telefono1; this.txtTelefono2.Text = p.Telefono2; this.txtCelular1.Text = p.Celular1; this.txtCelular2.Text = p.Celular2; this.txtDescripcion.Text = p.Descripcion; // Combos this.IDPais = p.IdPais; this.UbicacionPredictivo1.IdLocalidad = p.IdLocalidad; // Valores de tarifas this.decLivMovida.Value = p.LIV_MOVIDA; this.decLivKm.Value = p.LIV_KM; this.decSp1Movida.Value = p.SP1_MOVIDA; this.decSp1Km.Value = p.SP1_KM; this.decSp2Movida.Value = p.SP2_MOVIDA; this.decSp2Km.Value = p.SP2_KM; this.decPs1Movida.Value = p.PS1_MOVIDA; this.decPs1Km.Value = p.PS1_KM; this.decPs2Movida.Value = p.PS2_MOVIDA; this.decPs2Km.Value = p.PS2_KM; this.ddlIva.SelectedValue = p.Iva; this.UbicacionPredictivo1.IdLocalidad = p.IdLocalidad; }
private Prestador GetPrestadorFromControl() { Prestador p = new Prestador(this.EntityID, this.ObjectHash); // Datos obligatorios. p.Nombre = this.txtNombre.Text; p.Activo = this.chkActivo.Checked; p.Cuit = this.txtCuit.Text; p.Email = this.txtEmail.Text; p.Domicilio = this.txtDomicio.Text; p.Nextel = this.txtNextel.Text; p.Telefono1 = this.txtTelefono1.Text; p.Telefono2 = this.txtTelefono2.Text; p.Celular1 = this.txtCelular1.Text; p.Celular2 = this.txtCelular2.Text; p.Descripcion = this.txtDescripcion.Text; p.Iva = this.ddlIva.SelectedValue; // Combos p.IdPais = Int32.Parse(this.ddlPais.SelectedValue); Classes.Ubicacion u = this.UbicacionPredictivo1.GetUbicacion(); if (u != null) { p.IdPais = u.IDPais; p.IdProvincia = u.IDProvincia; p.IdCiudad = u.IDCiudad; p.IdLocalidad = u.IDLocalidad; } // Valores de tarifas p.LIV_MOVIDA = this.decLivMovida.Value; p.LIV_KM = this.decLivKm.Value; p.SP1_MOVIDA = this.decSp1Movida.Value; p.SP1_KM = this.decSp1Km.Value; p.SP2_MOVIDA = this.decSp2Movida.Value; p.SP2_KM = this.decSp2Km.Value; p.PS1_MOVIDA = this.decPs1Movida.Value; p.PS1_KM = this.decPs1Km.Value; p.PS2_MOVIDA = this.decPs2Movida.Value; p.PS2_KM = this.decPs2Km.Value; return p; }
private static void ORM(Prestador prestador, DataRow dr) { prestador._id = Int32.Parse(dr[PrestadorDS.COL_ID_PRESTADOR].ToString()); prestador._nombre = dr[PrestadorDS.COL_NOMBRE].ToString(); prestador._descripcion = dr[PrestadorDS.COL_DESCRIPCION].ToString(); prestador._activo = Int32.Parse(dr[PrestadorDS.COL_ESTADO].ToString()) == ACTIVO; prestador._telefono1 = dr[PrestadorDS.COL_TELEFONO1].ToString(); prestador._telefono2 = dr[PrestadorDS.COL_TELEFONO2].ToString(); prestador._celular1 = dr[PrestadorDS.COL_CELULAR1].ToString(); prestador._celular2 = dr[PrestadorDS.COL_CELULAR2].ToString(); prestador._nextel = dr[PrestadorDS.COL_NEXTEL].ToString(); prestador._domicilio = dr[PrestadorDS.COL_DOMICILIO].ToString(); prestador._idCiudad= Int32.Parse(dr[PrestadorDS.COL_ID_CIUDAD].ToString()); prestador._nombreCiudad = dr[PrestadorDS.COL_NOMBRE_CIUDAD].ToString(); prestador._provinciaNombre = dr[PrestadorDS.COL_PROVINCA_NOMBRE].ToString(); prestador._idProvincia = Int32.Parse(dr[PrestadorDS.COL_IDPROVINCIA].ToString()); prestador._idPais = Int32.Parse(dr[PrestadorDS.COL_IDPAIS].ToString()); prestador._idlocalidad = Int32.Parse(dr[PrestadorDS.COL_IDLOCALIDAD].ToString()); prestador._localidadNombre = dr[PrestadorDS.COL_LOCALIDAD_NOMBRE].ToString(); prestador._nombrePais = dr[PrestadorDS.COL_PAIS_NOMBRE].ToString(); prestador._email = dr[PrestadorDS.COL_EMAIL].ToString(); prestador._cuit = dr[PrestadorDS.COL_CUIT].ToString(); prestador._iva = dr[PrestadorDS.COL_IVA].ToString(); prestador._LIV_MOVIDA = PersistEntity.FloatConvet(dr[PrestadorDS.COL_LIV_MOVIDA]); prestador.LIV_KM = PersistEntity.FloatConvet(dr[PrestadorDS.COL_LIV_KM]); prestador.SP1_MOVIDA = PersistEntity.FloatConvet(dr[PrestadorDS.COL_SP1_MOVIDA]); prestador.SP1_KM = PersistEntity.FloatConvet(dr[PrestadorDS.COL_SP1_KM]); prestador.SP2_MOVIDA = PersistEntity.FloatConvet(dr[PrestadorDS.COL_SP2_MOVIDA]); prestador.SP2_KM = PersistEntity.FloatConvet(dr[PrestadorDS.COL_SP2_KM]); prestador.PS1_MOVIDA = PersistEntity.FloatConvet(dr[PrestadorDS.COL_PS1_MOVIDA]); prestador.PS1_KM = PersistEntity.FloatConvet(dr[PrestadorDS.COL_PS1_KM]); prestador.PS2_MOVIDA = PersistEntity.FloatConvet(dr[PrestadorDS.COL_PS2_MOVIDA]); prestador.PS2_KM = PersistEntity.FloatConvet(dr[PrestadorDS.COL_PS2_KM]); }
public static List<Prestador> List(FiltroPrestador filtro, out int RecordCount) { List<Prestador> prestadorList = new List<Prestador>(); try { PrestadorDS dataService = new PrestadorDS(); DataSet ds = dataService.List(filtro, out RecordCount); if (ds.Tables.Count>0) { foreach (DataRow r in ds.Tables[0].Rows) { Prestador p = new Prestador(); ORM(p, r); prestadorList.Add(p); } } }catch(Exception ex) { throw ex; } return prestadorList; }
public static Prestador Get_Shadow(int id) { Prestador p = new Prestador(); p._id = id; return p; }
public static Prestador GetById(int id) { Prestador resultPrestador = null; PrestadorDS dataServicePrestador = new PrestadorDS(); String ObjectHash = Guid.NewGuid().ToString(); DataRow dr = dataServicePrestador.GetObjectById(id, ObjectHash); if (dr != null) { resultPrestador = new Prestador(); resultPrestador._UObjectID = ObjectHash; ORM(resultPrestador, dr); } return resultPrestador; }