Exemplo n.º 1
0
    protected void fillScrollData()
    {
        string html    = "";
        string scmdTxt = string.Format(" SELECT    " +
                                       " CASE WHEN SCROLL_DT < (CURDATE()- INTERVAL 8 DAY) THEN " +   //(CURDATE() - INTERVAL 1  DAY)
                                       " CONCAT('<h4>','<img style=\"margin-right: 6px; vertical-align: bottom;\" src=\"images/calendar.png\" alt=\"new\"  />',DATE_FORMAT( SCROLL_DT,'%a, %D %b, %Y') ,'</h4>' ,'<a  href=\"' ,  WEBURL ,  '\" target=\"_self\">' , DOC_TITLE , '</a>')     " +
                                       " ELSE " +
                                       "  CONCAT('<h4>','<img style=\"margin-right: 6px; vertical-align: bottom;\" src=\"images/calendar.png\" alt=\"new\" />',DATE_FORMAT( SCROLL_DT,'%a, %D %b, %Y') ,'</h4>' ,'<a  href=\"' ,  WEBURL , '\" target=\"_blank\"><img style=\"margin-right: 3px;\" src=\"images/new.gif\" alt=\"new\" />' , DOC_TITLE , '</a>')   " +
                                       " END DOC_TITLE  " +
                                       "  FROM FRONTSCROLL    " +
                                       " WHERE SCROLL_TILL >=  (CURDATE() )  " +
                                       "    ORDER BY DOC_ID desc "
                                       );

        try
        {
            DataSet ds = MySqlDBConnection.fillDataSet(scmdTxt);

            DataTable dt = new DataTable();
            dt = ds.Tables[0];
            int colCount = ds.Tables[0].Columns.Count;
            html = "<marquee  id=\"marq\"  height='220'  behavior='scroll' direction='up' scrollamount='2' onmouseover='this.stop();' onmouseout='this.start();'>";

            //add li
            //Remove this block to remove the pic
            //    html += " <li> ";
            //	html += "<a  href='http://pstcl.org/photogallery.aspx?p=19' target='_blank'>";
            //   html +=  "<img class=\"mImagedropshadowGallery\" src=\"pgallery/pimagesrday2019/thumb.JPEG\" alt=\"\"  width='150px' height='150px'><br>Republic Day 2019 Celebrations at PSTCL,Patiala</a>";
            //  html += "</li>";

            //Remove this block to remove the pic

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                html += " <li> ";
                //for (int j = 0; j < dt.Columns.Count; j++)  //1 instead of dt.Columns.Count
                html += dt.Rows[i][0].ToString();
                html += "</li>";
            }
            html += " </marquee>";

            divScroll.InnerHtml = html;
            dt.Clear();
            dt.Dispose();
            ds.Clear();
            ds.Dispose();
        }
        catch (Exception ex)
        {
            divScroll.InnerHtml = html;
        }
    }
Exemplo n.º 2
0
 private static string InitiateConnectionProcess(string query)
 {
     try
     {
         MySqlDBConnection connection = new MySqlDBConnection();
         MySqlConnection   connect    = connection.SQLConnection;
         connection.RunInTrx(query, ref connect);
         return("Success");
     }
     catch (Exception ex)
     {
         return(ex.Message);
     }
 }
Exemplo n.º 3
0
    protected void fillHtml()
    {
        string qry = " SELECT aboutus_final FROM ABOUTUS  " +
                     " WHERE PUBLISH = 'Y' AND UPPER(OFFICE) = UPPER('CEHISD') ";

        DataSet ds = MySqlDBConnection.fillDataSet(qry);

        DataTable dt = new DataTable();

        dt = ds.Tables[0];
        if (ds.Tables[0].Rows.Count > 0)
        {
            string html = dt.Rows[0]["aboutus_final"].ToString();

            divTable.InnerHtml = html;
        }
        ds.Clear();
        ds.Dispose();
    }
Exemplo n.º 4
0
    protected void fillHtmlTable()
    {
        //string scmdTxt = string.Format("SELECT DOC_REF,DOC_TITLE, DATE_FORMAT(NIT_OP_DT,'%d-%m-%Y') NIT_OP_DT,NIT_OP_TM,PUBLISH_DT " +
        //                                " FROM ( " +
        //                                " SELECT  DOC_REF  , GROUP_CONCAT(CONCAT( '<a  href=\"' ,  WFM.PATH_URL ,DOC_ID, DOC_EXT, '\" target=\"_blank\">' , DOC_TITLE , '</a>') ORDER BY DOC_ID ASC  SEPARATOR ' ') DOC_TITLE , " +
        //                                " NIT_OP_DT " +
        //                                ",NIT_OP_TM " +
        //                                ", DATE_FORMAT( PUBLISH_DT,'%d-%m-%Y') PUBLISH_DT  " +
        //                                " FROM NIT   " +
        //                                " LEFT OUTER JOIN WEB_FOLDER_MAP WFM  " +
        //                                " ON NIT.WEB_ID  =  WFM.WEB_ID " +
        //                                 " WHERE PUBLISHED = 'Y'  " +
        //                                "  GROUP BY PARENT_DOC_ID   ORDER BY DOC_ID desc " +
        //                                " ) FIN WHERE NIT_OP_DT >= (CURDATE()) " ) ;
        string scmdTxt = " SET SESSION group_concat_max_len = 1000000;  ";

        scmdTxt += string.Format(" SELECT DOC_REF, " +
                                 " (SELECT   " +
                                 " GROUP_CONCAT( " +
                                 " CONCAT( '<a  href=\"' ,  WFM.PATH_URL ,Y.DOC_ID, Y.DOC_EXT, '\" target=\"_blank\">' , Y.DOC_TITLE , '</a>')  " +
                                 "  ORDER BY DOC_ID ASC  SEPARATOR ' '                                                                          " +
                                 "  )DOC_TITLE                                                                                                  " +
                                 " FROM NIT Y                                                                                                   " +
                                 " LEFT OUTER JOIN WEB_FOLDER_MAP WFM                                                                           " +
                                 " ON Y.WEB_ID  =  WFM.WEB_ID                                                                                   " +
                                 " WHERE Y.PARENT_DOC_ID =  a.PARENT_DOC_ID                                                                     " +
                                 " GROUP BY Y.PARENT_DOC_ID                                                                                     " +
                                 "  )  DOC_TITLE                                                                                                " +
                                 "  ,DATE_FORMAT(NIT_OP_DT,'%d-%m-%Y') NIT_OP_DT                                                                " +
                                 "  , NIT_OP_TM                                                                                    " +
                                 "  , DATE_FORMAT( PUBLISH_DT,'%d-%m-%Y') PUBLISH_DT " +
                                 " FROM                                                                                                         " +
                                 " NIT a                                                                                                        " +
                                 " INNER JOIN (                                                                                                 " +
                                 "     SELECT PARENT_DOC_ID, MAX(DOC_ID) DOC_ID                                                                 " +
                                 "     FROM NIT                                                                                                 " +
                                 "     GROUP BY PARENT_DOC_ID                                                                                   " +
                                 " ) b ON a.PARENT_DOC_ID = b.PARENT_DOC_ID AND a.DOC_ID = b.DOC_ID                                             " +
                                 " AND a.PUBLISHED = 'Y'    " +
                                 " AND a.NIT_OP_DT >= (CURDATE())  " +
                                 "  ORDER BY a.DOC_ID desc  ");


        DataSet ds = MySqlDBConnection.fillDataSet(scmdTxt);

        DataTable dt = new DataTable();

        dt = ds.Tables[0];
        string html = "<table id='tableTwo1' class='yui' style='margin-left: auto; margin-right: auto; width: 900px;' >";

        //add header row
        html += "<thead> ";
        html += "<tr > " +
                "     <td colspan='5' class='filter' style='background: #ffffff;'> " +
                "         <span style='color: Black;'>Search</span> <input id='filterBoxTwo' value='' maxlength='30' size='30' type='text' /> " +
                "         <img id='filterClearTwo' src='_assets/img/cross.png' title='Click to clear filter.' alt='Clear Filter Image' /> " +
                "     </td> " +
                " </tr> ";
        html += "<tr>";

        //Add Header
        //html += "<th style='width: 100px;'>" + "ID" + "</th> ";
        html += "<th style='width: 150px;'>" + "Tender Enquiry No." + "</th> ";
        html += "<th style='width: 470px;'>" + "Brief Description " + "</th>";
        html += "<th style='width: 125px;'>" + "Bids<br> Opening Date" + "</th>";
        html += "<th style='width: 125px;'>" + "Bids<br> Opening Time" + "</th>";
        html += "<th style='width: 100px;'>" + "Last Updated on Website" + "</th>";

        //for (int i = 0; i < dt.Columns.Count; i++)
        //    html += "<th>" + dt.Columns[i].ColumnName + "</th>";
        html += "</tr></thead>";


        //add rows
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            html += "<tr>";
            for (int j = 0; j < dt.Columns.Count; j++)
            {
                html += "<td>" + dt.Rows[i][j].ToString() + "</td>";
            }
            html += "</tr>";
        }

        string tfoot = " <tfoot> " +
                       "  <tr id='pagerTwo' align='center'> <td colspan='5'>  " +
                       "   <img src='_assets/img/first.png' class='first'/>  " +
                       "       <img src='_assets/img/prev.png' class='prev'/>  " +
                       "          <input type='text' class='pagedisplay'/>   " +
                       "          <img src='_assets/img/next.png' class='next'/> " +
                       "          <img src='_assets/img/last.png' class='last'/>  " +
                       "          <select class='pagesize'>  " +
                       "              <option selected='selected'  value='10'>10</option>  " +
                       "              <option value='20'>20</option>  " +
                       "              <option value='30'>30</option>  " +
                       "              <option  value='40'>40</option>  " +
                       "          </select>  " +
                       "      </td>  " +
                       "   </tr>   " +
                       "   </tfoot>  ";

        html += tfoot;
        html += "</table>";

        divTable.InnerHtml = html;
    }
Exemplo n.º 5
0
    protected void fillHtmlTable()
    {
        string web_page = this.GetType().Name.Replace("_aspx", "") + ".aspx";
        string qry      = " SELECT DOC_DT, DOC_REF,   CONCAT(DOC_TITLE,LANG) DOC_TITLE, CONCAT('  ',EXT, ' ' ,FSIZE, FUNIT ) FILE_DETAIL, PUBLISH_DT " +
                          " , (SELECT LNAME FROM COMPILLOGIN WHERE UPPER(USERID) = UPPER(FIN.USERID) ) UPLOADED_BY FROM ( " +
                          " SELECT DATE_FORMAT(DOC_DT,'%d-%m-%Y') DOC_DT,  DOC_REF " +
                          ", GROUP_CONCAT(CONCAT( '<a  href=\"' ,  WFM.PATH_URL ,DOC_ID, DOC_EXT, '\" target=\"_blank\">' , DOC_TITLE     ,'</a>' ) ORDER BY DOC_ID ASC  SEPARATOR ' ') DOC_TITLE " +
                          ",  CASE WHEN LANG <> '' THEN CONCAT( ' (In ',LANG , ')' ) ELSE '' END   LANG " +
                          ",   CASE WHEN UPPER(DOC_EXT) = '.PDF' THEN  '<img src=\"images/pdf_16_3.png\" alt=\"\" />' ELSE '' END  EXT  " +
                          ",  CASE WHEN ISNULL(FILE_SIZE_BYTES) <> 1  THEN (CASE WHEN (FILE_SIZE_BYTES) < 1048576  THEN ROUND((FILE_SIZE_BYTES/1024), 2) ELSE ROUND((FILE_SIZE_BYTES/1048576),2) END) ELSE  '' END FSIZE " +
                          ",  CASE WHEN ISNULL(FILE_SIZE_BYTES) <> 1 THEN CASE WHEN (FILE_SIZE_BYTES) < 1048576  THEN 'KB' ELSE 'MB' END  ELSE '' END FUNIT " +
                          ", DATE_FORMAT( PUBLISH_DT,'%d-%m-%Y') PUBLISH_DT ,  USERID " +
                          " FROM UPLOAD  UD  " +
                          " LEFT OUTER JOIN WEB_FOLDER_MAP WFM  " +
                          " ON UD.WEB_ID  =  WFM.WEB_ID " +
                          " WHERE PUBLISHED = 'Y' AND UPPER(WFM.WEB_PAGE) = UPPER('{0}') " +
                          "  GROUP BY PARENT_DOC_ID    ORDER BY DOC_ID desc ) FIN";
        string scmdTxt = string.Format(qry, web_page);

        DataSet ds = MySqlDBConnection.fillDataSet(scmdTxt);

        DataTable dt = new DataTable();

        dt = ds.Tables[0];
        string html = "<table id='tableTwo1' class='yui' style='margin-left: auto; margin-right: auto; width: 900px;' >";

        //add header row
        html += "<thead> ";
        html += "<tr > " +
                "     <td colspan='6' class='filter' style='background: #ffffff;'> " +
                "         <span style='color: Black;'>Search</span> <input id='filterBoxTwo' value='' maxlength='30' size='30' type='text' /> " +
                "         <img id='filterClearTwo' src='_assets/img/cross.png' title='Click to clear filter.' alt='Clear Filter Image' /> " +
                "     </td> " +
                " </tr> ";
        html += "<tr>";

        //Add Header
        //html += "<th style='width: 100px;'>" + "ID" + "</th> ";
        html += "<th style='width: 100px;'>" + "Dated" + "</th> ";
        html += "<th style='width: 110px;'>" + "Reference No." + "</th> ";
        html += "<th style='width: 460px;'>" + "Brief Description " + "</th>";
        html += "<th style='width: 100px;'>" + "File Details " + "</th>";
        html += "<th style='width: 100px;'>" + "Last Updated on Website" + "</th>";
        html += "<th style='width: 100px;'>" + "Published by O/o " + "</th>";


        //for (int i = 0; i < dt.Columns.Count; i++)
        //    html += "<th>" + dt.Columns[i].ColumnName + "</th>";
        html += "</tr></thead>";


        //add rows
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            html += "<tr>";
            for (int j = 0; j < dt.Columns.Count; j++)
            {
                html += "<td>" + dt.Rows[i][j].ToString() + "</td>";
            }
            html += "</tr>";
        }

        string tfoot = " <tfoot> " +
                       "  <tr id='pagerTwo' align='center'> <td colspan='6'>  " +
                       "   <img src='_assets/img/first.png' class='first'/>  " +
                       "       <img src='_assets/img/prev.png' class='prev'/>  " +
                       "          <input type='text' class='pagedisplay'/>   " +
                       "          <img src='_assets/img/next.png' class='next'/> " +
                       "          <img src='_assets/img/last.png' class='last'/>  " +
                       "          <select class='pagesize'>  " +
                       "              <option selected='selected'  value='10'>10</option>  " +
                       "              <option value='20'>20</option>  " +
                       "              <option value='30'>30</option>  " +
                       "              <option  value='40'>40</option>  " +
                       "          </select>  " +
                       "      </td>  " +
                       "   </tr>   " +
                       "   </tfoot>  ";

        html += tfoot;
        html += "</table> <br />";

        divTable.InnerHtml = html;
    }
Exemplo n.º 6
0
    protected void fillHtmlTable()
    {
        string web_page = this.GetType().Name.Replace("_aspx", "") + ".aspx";
        string scmdTxt  = string.Format(Utilities.qry_website()
                                        , web_page);

        DataSet ds = MySqlDBConnection.fillDataSet(scmdTxt);

        DataTable dt = new DataTable();

        dt = ds.Tables[0];
        string html = "<table id='tableTwo1' class='yui' style='margin-left: auto; margin-right: auto; width: 900px;' >";

        //add header row
        html += "<thead> ";
        html += "<tr > " +
                "     <td colspan='5' class='filter' style='background: #ffffff;'> " +
                "         <span style='color: Black;'>Search</span> <input id='filterBoxTwo' value='' maxlength='30' size='30' type='text' /> " +
                "         <img id='filterClearTwo' src='_assets/img/cross.png' title='Click to clear filter.' alt='Clear Filter Image' /> " +
                "     </td> " +
                " </tr> ";
        html += "<tr>";

        //Add Header
        //html += "<th style='width: 100px;'>" + "ID" + "</th> ";
        html += "<th style='width: 100px;'>" + "Dated" + "</th> ";
        html += "<th style='width: 110px;'>" + "Reference No." + "</th> ";
        html += "<th style='width: 460px;'>" + "Brief Description " + "</th>";
        html += "<th style='width: 100px;'>" + "File Details " + "</th>";
        html += "<th style='width: 100px;'>" + "Last Updated on Website" + "</th>";

        //for (int i = 0; i < dt.Columns.Count; i++)
        //    html += "<th>" + dt.Columns[i].ColumnName + "</th>";
        html += "</tr></thead>";


        //add rows
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            html += "<tr>";
            for (int j = 0; j < dt.Columns.Count; j++)
            {
                html += "<td>" + dt.Rows[i][j].ToString() + "</td>";
            }
            html += "</tr>";
        }

        string tfoot = " <tfoot> " +
                       "  <tr id='pagerTwo' align='center'> <td colspan='5'>  " +
                       "   <img src='_assets/img/first.png' class='first'/>  " +
                       "       <img src='_assets/img/prev.png' class='prev'/>  " +
                       "          <input type='text' class='pagedisplay'/>   " +
                       "          <img src='_assets/img/next.png' class='next'/> " +
                       "          <img src='_assets/img/last.png' class='last'/>  " +
                       "          <select class='pagesize'>  " +
                       "              <option selected='selected'  value='10'>10</option>  " +
                       "              <option value='20'>20</option>  " +
                       "              <option value='30'>30</option>  " +
                       "              <option  value='40'>40</option>  " +
                       "          </select>  " +
                       "      </td>  " +
                       "   </tr>   " +
                       "   </tfoot>  ";

        html += tfoot;
        html += "</table> <br />";

        divTable.InnerHtml = html;
    }