public bool FnEVistaaspD(ClsVista OVista) { bool ExisteVista = true; try { ObjConexion = new ClsConexion(); Cmd_D = new MySqlCommand("spEVistaAsp", ObjConexion.Con_D);// dos tipos de control no se pueden llamar igual dentro de una vista Cmd_D.CommandType = CommandType.StoredProcedure; Cmd_D.Parameters.AddWithValue("prmIdVista", Convert.ToInt16(OVista.Idvista)); Cmd_D.Parameters.AddWithValue("prmIdModulo", Convert.ToInt16(OVista.ObjModulo.IdModulo)); Cmd_D.Parameters.AddWithValue("prmVistaAsp", OVista.Idaspvista); ObjConexion.Abrircon(); Dr_D = Cmd_D.ExecuteReader(); if (Dr_D.Read()) { ExisteVista = Convert.ToBoolean(Dr_D[0]); } return(ExisteVista); } catch (Exception ex) { return(false); throw ex; } finally { ObjConexion.Cerrarcon(); } }
public List <ClsModulo> FnRModuloD() { ClsModulo OMod = null; try { ObjConexion = new ClsConexion(); Cmd_D = new MySqlCommand("spRMod", ObjConexion.Con_D); Cmd_D.CommandType = CommandType.StoredProcedure; ObjConexion.Abrircon(); Dr_D = Cmd_D.ExecuteReader(); List <ClsModulo> LstMod = new List <ClsModulo>(); while (Dr_D.Read()) { OMod = new ClsModulo(); OMod.IdModulo = Dr_D[0].ToString(); //id_modulo OMod.Modulo = Dr_D[1].ToString(); //modulo OMod.Idaspmodulo = Dr_D[2].ToString(); //id asp OMod.Fechainciomodulo = Dr_D[3].ToString(); //decha LstMod.Add(OMod); } return(LstMod); } catch (Exception ex) { return(null); throw ex; } finally { ObjConexion.Cerrarcon(); } }
public bool FnCVistaD(ClsVista OVista) { bool CreateVista = false; try { ObjConexion = new ClsConexion(); Cmd_D = new MySqlCommand("spCVista", ObjConexion.Con_D);// dos tipos de control no se pueden llamar igual dentro de una vista Cmd_D.CommandType = CommandType.StoredProcedure; Cmd_D.Parameters.AddWithValue("prmVista", OVista.Vista); Cmd_D.Parameters.AddWithValue("prmIdAspVista", OVista.Idaspvista); Cmd_D.Parameters.AddWithValue("prmIdModulo", Convert.ToInt16(OVista.ObjModulo.IdModulo)); ObjConexion.Abrircon(); int FilasCVista = Cmd_D.ExecuteNonQuery(); if (FilasCVista > 0) { CreateVista = true; } return(CreateVista); } catch (Exception ex) { return(false); throw ex; } finally { ObjConexion.Cerrarcon(); } }
public bool FnUModuloD(ClsModulo OModulo) { bool UpdateModulo = false; try { ObjConexion = new ClsConexion(); Cmd_D = new MySqlCommand("spUModulo", ObjConexion.Con_D);// dos tipos de control no se pueden llamar igual dentro de una vista Cmd_D.CommandType = CommandType.StoredProcedure; Cmd_D.Parameters.AddWithValue("prmIdModulo", Convert.ToInt16(OModulo.IdModulo)); Cmd_D.Parameters.AddWithValue("prmModulo", OModulo.Modulo); Cmd_D.Parameters.AddWithValue("prmIdAspmodulo", OModulo.Idaspmodulo); ObjConexion.Abrircon(); int FilasUModulo = Cmd_D.ExecuteNonQuery(); if (FilasUModulo > 0) { UpdateModulo = true; } return(UpdateModulo); } catch (Exception ex) { return(false); throw ex; } finally { ObjConexion.Cerrarcon(); } }
public bool FnEElemEl(ClsElemento OElem) { bool ExisteEE = false; try { ObjConexion = new ClsConexion(); Cmd_D = new MySqlCommand("spEElemEl", ObjConexion.Con_D);// dos tipos de control no se pueden llamar igual dentro de una vista Cmd_D.CommandType = CommandType.StoredProcedure; Cmd_D.Parameters.AddWithValue("prmEIdEl", Convert.ToInt16(OElem.Id_elemento)); Cmd_D.Parameters.AddWithValue("prmEElem", OElem.Elemento);// no se convierte pq viene como string Cmd_D.Parameters.AddWithValue("prmEIdTC", Convert.ToInt16(OElem.ObjTipo_control.Idtipocontrol)); Cmd_D.Parameters.AddWithValue("prmEIdVi", Convert.ToInt16(OElem.ObjVista.Idvista)); ObjConexion.Abrircon(); Dr_D = Cmd_D.ExecuteReader(); if (Dr_D.Read()) { ExisteEE = Convert.ToBoolean(Dr_D[0]); } return(ExisteEE); } catch (Exception ex) { return(false); throw ex; } finally { ObjConexion.Cerrarcon(); } }
public bool FnUElementoD(ClsElemento OElemento) { bool UpdateElemento = false; try { ObjConexion = new ClsConexion(); Cmd_D = new MySqlCommand("spUElemento", ObjConexion.Con_D); Cmd_D.CommandType = CommandType.StoredProcedure; Cmd_D.Parameters.AddWithValue("prmIdElemento", Convert.ToInt16(OElemento.Id_elemento)); Cmd_D.Parameters.AddWithValue("prmElemento", OElemento.Elemento); Cmd_D.Parameters.AddWithValue("prmIdAspElemento", OElemento.Idaspelemento); Cmd_D.Parameters.AddWithValue("prmIdTipoControl", Convert.ToInt16(OElemento.ObjTipo_control.Idtipocontrol)); Cmd_D.Parameters.AddWithValue("prmIdVista", Convert.ToInt16(OElemento.ObjVista.Idvista)); ObjConexion.Abrircon(); int FilasUElemento = Cmd_D.ExecuteNonQuery(); if (FilasUElemento > 0) { UpdateElemento = true; } return(UpdateElemento); } catch (MySqlException ex) { return(false); throw ex; } finally { ObjConexion.Cerrarcon(); } }
public bool FnEElemAE(ClsElemento OElem) { bool ExisteEA = false; try { ObjConexion = new ClsConexion(); Cmd_D = new MySqlCommand("spEElemAE", ObjConexion.Con_D);//si exise elemento con nombre asp dentro de la misma vista Cmd_D.CommandType = CommandType.StoredProcedure; Cmd_D.Parameters.AddWithValue("prmEIdEl", Convert.ToInt16(OElem.Id_elemento)); Cmd_D.Parameters.AddWithValue("prmEAsEl", OElem.Idaspelemento); Cmd_D.Parameters.AddWithValue("prmEIdVi", Convert.ToInt16(OElem.ObjVista.Idvista)); ObjConexion.Abrircon(); Dr_D = Cmd_D.ExecuteReader(); if (Dr_D.Read()) { ExisteEA = Convert.ToBoolean(Dr_D[0]); } return(ExisteEA); } catch (Exception ex) { return(false); throw ex; } finally { ObjConexion.Cerrarcon(); } }
public bool FnDElementoD(ClsElemento OElemento) { bool DeleteElemento = false; try { ObjConexion = new ClsConexion(); Cmd_D = new MySqlCommand("spDElemento", ObjConexion.Con_D); Cmd_D.CommandType = CommandType.StoredProcedure; Cmd_D.Parameters.AddWithValue("prmIdElemento", Convert.ToInt16(OElemento.Id_elemento)); ObjConexion.Abrircon(); int FilasDElemento = Cmd_D.ExecuteNonQuery(); if (FilasDElemento > 0) { DeleteElemento = true; } return(DeleteElemento); } catch (Exception ex) { return(false); throw ex; } finally { ObjConexion.Cerrarcon(); } }
public bool FnUTico(ClsTipoControl OTico) { bool UpdateTIco = false; try { ObjConexion = new ClsConexion(); Cmd_D = new MySqlCommand("spUTico", ObjConexion.Con_D); Cmd_D.CommandType = CommandType.StoredProcedure; Cmd_D.Parameters.AddWithValue("prmUIdTC", Convert.ToInt16(OTico.Idtipocontrol)); Cmd_D.Parameters.AddWithValue("prmUTico", OTico.Tipocontrol); ObjConexion.Abrircon(); int FilasNTiCo = Cmd_D.ExecuteNonQuery(); if (FilasNTiCo > 0) { UpdateTIco = true; } return(UpdateTIco); } catch (Exception ex) { return(false); throw ex; } finally { ObjConexion.Cerrarcon(); } }
public bool FnCTico(ClsTipoControl OTico) { bool CreateTico = false; try { ObjConexion = new ClsConexion(); Cmd_D = new MySqlCommand("spCTico", ObjConexion.Con_D); Cmd_D.CommandType = CommandType.StoredProcedure; Cmd_D.Parameters.AddWithValue("prmCTico", OTico.Tipocontrol); ObjConexion.Abrircon(); int FilasCTiCo = Cmd_D.ExecuteNonQuery(); if (FilasCTiCo > 0) { CreateTico = true; } return(CreateTico); } catch (Exception ex) { return(false); throw ex; } finally { ObjConexion.Cerrarcon(); } }
private MySqlCommand Cmd_D = null; // ejecutamos comandos de transact o procedimiento almacenado public List <ClsTipoControl> MostrarTC() { ClsTipoControl OTC = null; try { ObjConexion = new ClsConexion(); Cmd_D = new MySqlCommand("spVerTC", ObjConexion.Con_D); Cmd_D.CommandType = CommandType.StoredProcedure; ObjConexion.Abrircon(); Dr_D = Cmd_D.ExecuteReader(); List <ClsTipoControl> LstTC = new List <ClsTipoControl>(); while (Dr_D.Read()) { OTC = new ClsTipoControl(); OTC.Idtipocontrol = Dr_D[0].ToString(); //ID_tipo_control OTC.Tipocontrol = Dr_D[1].ToString(); //tipo_control LstTC.Add(OTC); } return(LstTC); } catch (Exception ex) { return(null); throw ex; } finally { ObjConexion.Cerrarcon(); } }
public bool FnETicoTC(ClsTipoControl OTico) { bool ExisteTCTC = false; try { ObjConexion = new ClsConexion(); Cmd_D = new MySqlCommand("spETicoTC", ObjConexion.Con_D); Cmd_D.CommandType = CommandType.StoredProcedure; Cmd_D.Parameters.AddWithValue("prmEIdTC", Convert.ToInt16(OTico.Idtipocontrol)); Cmd_D.Parameters.AddWithValue("prmETCTC", OTico.Tipocontrol); ObjConexion.Abrircon(); Dr_D = Cmd_D.ExecuteReader(); if (Dr_D.Read()) { ExisteTCTC = Convert.ToBoolean(Dr_D[0]); } return(ExisteTCTC); } catch (Exception ex) { return(true); throw ex; } finally { ObjConexion.Cerrarcon(); } }
public List <ClsElemento> FnRElem() { ClsElemento OElem = null; try { ObjConexion = new ClsConexion(); Cmd_D = new MySqlCommand("spRElem", ObjConexion.Con_D); Cmd_D.CommandType = CommandType.StoredProcedure; ObjConexion.Abrircon(); Dr_D = Cmd_D.ExecuteReader(); List <ClsElemento> LstElem = new List <ClsElemento>(); while (Dr_D.Read()) { OElem = new ClsElemento(); OElem.Id_elemento = Dr_D[0].ToString(); //ID_elemento OElem.Elemento = Dr_D[1].ToString(); //elemento OElem.Fecha_inicioElemento = Dr_D[2].ToString(); //fecha inicio OElem.ObjTipo_control.Tipocontrol = Dr_D[3].ToString(); //tipo control OElem.ObjVista.Vista = Dr_D[4].ToString(); // vist OElem.Idaspelemento = Dr_D[5].ToString(); // asp elemento OElem.ObjVista.Idvista = Dr_D[6].ToString(); //id vista LstElem.Add(OElem); } return(LstElem); } catch (Exception ex) { return(null); throw ex; } finally { ObjConexion.Cerrarcon(); } }
private MySqlCommand Cmd_D = null; // ejecutamos comandos de transact o procedimiento almacenado public List <ClsVista> FnRVist() { ClsVista OVist = null; try { ObjConexion = new ClsConexion(); Cmd_D = new MySqlCommand("spRVist", ObjConexion.Con_D); Cmd_D.CommandType = CommandType.StoredProcedure; ObjConexion.Abrircon(); Dr_D = Cmd_D.ExecuteReader(); List <ClsVista> LstVist = new List <ClsVista>(); while (Dr_D.Read()) { OVist = new ClsVista(); OVist.Idvista = Dr_D[0].ToString();//idvista OVist.Vista = Dr_D[1].ToString(); OVist.Fechainiciovista = Dr_D[2].ToString(); OVist.ObjModulo.Modulo = Dr_D[3].ToString(); OVist.Idaspvista = Dr_D[4].ToString(); OVist.ObjModulo.IdModulo = Dr_D[5].ToString(); LstVist.Add(OVist); } return(LstVist); } catch (Exception ex) { return(null); throw ex; } finally { ObjConexion.Cerrarcon(); } }