private bool EsPropietario(int id_remate) { var r = new co_re_responsables(); r.re_id_origen = id_remate; r.re_id_tabla.id = Convert.ToInt32(FWPConfiguration.get_AppSettings("TABLAS_RE_REMATES")); r.re_id_usuario.id = FWPConfiguration.get_ID_User(Session.SessionID); var responsable = new bf_re_responsables().GetData(r); if (responsable == null || !responsable.Any()) { return false; } return true; }
private void CargaResponsables(int id_remate) { try { RowSelectionModel sm = this.grdResponsable.SelectionModel.Primary as RowSelectionModel; IList<co_re_responsables> responsablesList = new bf_re_responsables().GetData(new co_re_responsables { re_id_origen = id_remate, re_id_tabla = { id = Constantes.TABLA_REMATES } }); if (responsablesList != null && responsablesList.Any()) { foreach (co_re_responsables responsable in responsablesList) { sm.SelectedRows.Add(new SelectedRow(responsable.re_id_usuario.id.ToString())); } } if (new bf_re_responsables().EsPropietario(Convert.ToInt32(FWPConfiguration.get_ID_User(Session.SessionID)), id_remate)) { grdResponsable.Selectable = true; grdResponsable.Disabled = false; } else { grdResponsable.Title = "Responsable (Solo puede ser modificado por el propietario del Remate)"; grdResponsable.Selectable = false; grdResponsable.Disabled = true; } } catch (Exception) { Mensajes.Error(ErrorText.ERROR_CARGAR_RESPONSABLES); } }