//RETORNA TABELA NO FORMATO DE RECORDSET public ADODB.Recordset ReturnRs(string p_strSql) { ADODB.Recordset objRS = new ADODB.Recordset(); try { if (this._AdodbConn == null) { SetConn(); this._AdodbConn = new Connection(); GenericCLX.CS.Util objUtil = new GenericCLX.CS.Util(); //objUtil.GetConfig(""); this._AdodbConn.Open(objUtil.ConnectionStringXML(), this._User, this._Password, 0); } objRS.CursorLocation = (ADODB.CursorLocationEnum) 3; objRS.Open(p_strSql, this._AdodbConn, (ADODB.CursorTypeEnum) 3, (ADODB.LockTypeEnum) 3, 1); objRS.ActiveConnection = null; } catch (Exception e) { if (TreatedError(e.Message)) { this.ReturnRs(p_strSql); } } return(objRS); }
public void DefineActionsGrid() { if (this._Actions.Trim() != "" && this._Actions.Trim() != "") { GenericCLX.CS.Util objUtil = new GenericCLX.CS.Util(); //objUtil.GetConfig(""); string strProjectName = objUtil.ProjectName.Trim(); string[] arrStrActions = this._Actions.Split(chrDelimiter); string[] arrStrAcronyms = this._Acronyms.Split(chrDelimiter); for (int i = 0; i < arrStrActions.Length; i++) { if (arrStrActions[i].Trim() != "" && arrStrAcronyms[i].Trim() != "") { HyperLinkColumn objLink = new HyperLinkColumn(); objLink.Text = "<img src=\"/GenericCLX/img/" + arrStrActions[i] + ".gif\" border=\"0\" class=\"hand\">"; //objLink.Text = "<img src=\"/GenericCLX/img/new/" + arrStrActions[i] + ".ico\" border=\"0\" class=\"hand\">"; objLink.DataNavigateUrlField = this._ID; objLink.DataNavigateUrlFormatString = "javascript:redirect('" + "/" + strProjectName + "/" + this._Module + "/" + this._Title + "/" + this._Title + arrStrAcronyms[i] + ".aspx?" + this._ID + "={0}');"; //objLink.DataNavigateUrlFormatString = "javascript:popupcenter('../Includes/Pop.asp?tipo=<%=LCase(strFolder)%>&id=<%=intCount%>&titulo=<%=strTitulo%>&link=<%=strLink%>&texto=<%=strTexto%>&bgcolor=<%=strColor%>&w=190&h=83','POP<%=intCount%>',230,230,0,0); objLink.HeaderText = arrStrActions[i]; objLink.HeaderStyle.HorizontalAlign = (HorizontalAlign)2; objLink.ItemStyle.HorizontalAlign = (HorizontalAlign)2; this._Grid.Columns.Add(objLink); } } } }
public void DefineActionsGrid() { if (this._Actions.Trim() != "" && this._Actions.Trim() != "") { GenericCLX.CS.Util objUtil = new GenericCLX.CS.Util(); //objUtil.GetConfig(""); string strLocationUrlFull = objUtil.LocationUrlFull.Trim(); string[] arrStrActions = this._Actions.Split(chrDelimiter); string[] arrStrAcronyms = this._Acronyms.Split(chrDelimiter); for (int i = 0; i < arrStrActions.Length; i++) { if (arrStrActions[i].Trim() != "" && arrStrAcronyms[i].Trim() != "") { HyperLinkField objLink = new HyperLinkField(); objLink.Text = "<img src=\"/GenericCLX/img/" + arrStrActions[i] + ".gif\" border=\"0\" class=\"hand\"/>"; string[] arrDataNavigateUrlFields = new string[1]; arrDataNavigateUrlFields[0] = this._ID; objLink.DataNavigateUrlFields = arrDataNavigateUrlFields; objLink.DataNavigateUrlFormatString = strLocationUrlFull + this._Module + "/" + this._Title + "/" + this._Title + arrStrAcronyms[i] + ".aspx?" + this._ID + "={0}"; objLink.HeaderText = arrStrActions[i]; objLink.HeaderStyle.HorizontalAlign = (HorizontalAlign)2; objLink.ItemStyle.HorizontalAlign = (HorizontalAlign)2; this._Grid.Columns.Add(objLink); } } } }
public void SetConn() { //Util.Server = this._Server; //Util.DB = this._DB; //Util.User = this._User; //Util.Password = this._Password; GenericCLX.CS.Util objUtil = new GenericCLX.CS.Util(); //objUtil.GetConfig(""); objUtil.User = this._User; objUtil.Password = this._Password; }
public void Connect() { try { if (this._SqlConn == null || this._SqlConn.State == ConnectionState.Closed || this._SqlConn.State == ConnectionState.Broken) { //SetConn(); GenericCLX.CS.Util objUtil = new GenericCLX.CS.Util(); //objUtil.GetConfig(""); this._SqlConn = new SqlConnection(objUtil.ConnectionString()); this._SqlConn.Open(); } } catch (Exception e) { this.Error = e.Message; } }
//RETORNA TABELA NO FORMATO DE STRING XML public string ReturnStrXml() { string strXml = ""; try { DateTime datStart = DateTime.Now; if (this._XmlCmd == null) { SetConn(); GenericCLX.CS.Util objUtil = new GenericCLX.CS.Util(); //objUtil.GetConfig(""); _XmlCmd = new SqlXmlCommand(objUtil.ConnectionStringXML()); _XmlCmd.OutputEncoding = "ISO-8859-1"; _XmlCmd.RootTag = "ROOT"; } _XmlCmd.CommandText = this._Sql; System.Xml.XmlReader objXr = _XmlCmd.ExecuteXmlReader(); XmlDocument objXd = new XmlDocument(); objXd.Load(objXr); strXml = objXd.OuterXml; objXd = null; objXr.Close(); objXr = null; if (this._CloseConn) { _XmlCmd = null; } this._TimeQuery = Functions.DateDiff(datStart.ToLocalTime().ToString()); } catch (Exception e) { if (TreatedError(e.Message)) { this.ReturnStrXml(); } } return(strXml); }