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 static bool FnDElementoV(string IdElemento) { bool DeleteElemento = false; ClsElemento OElemento = new ClsElemento(); OElemento.Id_elemento = IdElemento; DeleteElemento = new ClsElementoN().FnDElementoN(OElemento); return(DeleteElemento); }
public bool FnEElemAE(ClsElemento OElem) { if (OElem.Id_elemento != "" && OElem.Id_elemento != null) { Boolean ExisteEA = new ClsElementoD().FnEElemAE(OElem); // instanciar de la capa datos con el parametro del obj return(ExisteEA); // lo que venga de la bd } else { return(true);// va a la gaver si quiere meter gol } }
public bool FnDElementoN(ClsElemento OElemento) { if (OElemento.Id_elemento != "" && OElemento.Id_elemento != null) { Boolean DeleteElemento = new ClsElementoD().FnDElementoD(OElemento); return(DeleteElemento); } else { return(false); } }
public static bool FnEElemAE(string EIdEl, string EAspE, string EIdVi) { bool ExisteEA = false; ClsElemento OElem = new ClsElemento(); OElem.Id_elemento = EIdEl; OElem.Idaspelemento = EAspE; OElem.ObjVista.Idvista = EIdVi; ExisteEA = new ClsElementoN().FnEElemAE(OElem); // enviar a capa N return(ExisteEA); }
public bool FnEElemEl(ClsElemento OElem) { if (OElem.Id_elemento != "" && OElem.Id_elemento != null) { OElem.Elemento = OElem.Elemento.Trim(); //quitar espacios Boolean ExisteEE = new ClsElementoD().FnEElemEl(OElem); // instanciar de la capa datos con el parametro del obj return(ExisteEE); // lo que venga de la bd } else { return(true);// va a la gaver si quiere meter gol } }
public static bool FnEElemEl(string EIdEl, string EElem, string EIdTC, string EIdVi) { bool ExisteEE = false; ClsElemento OElem = new ClsElemento(); OElem.Id_elemento = EIdEl; OElem.Elemento = EElem; OElem.ObjTipo_control.Idtipocontrol = EIdTC; OElem.ObjVista.Idvista = EIdVi; ExisteEE = new ClsElementoN().FnEElemEl(OElem); // enviar a capa N return(ExisteEE); }
public static bool FnCElementoV(string Elemento, string ElementoAsp, string IdTipoControl, string IdVista) { bool CreateElemento = false; ClsElemento OElemento = new ClsElemento(); OElemento.Elemento = Elemento; OElemento.Idaspelemento = ElementoAsp; OElemento.ObjTipo_control.Idtipocontrol = IdTipoControl; OElemento.ObjVista.Idvista = IdVista; CreateElemento = new ClsElementoN().FnCElementoN(OElemento); return(CreateElemento); }
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(); } }
public bool FnCElementoN(ClsElemento OElemento) { Boolean CreateElemento = new ClsElementoD().FnCElementoD(OElemento); return(CreateElemento); }