Example #1
0
        private string GetMenuName(int Menu_ID)
        {
            SqlService _service = new SqlService();

            try
            {
                string str        = "";
                string strParrent = "";
                _service.AddParameter("@Menu_ID", SqlDbType.Int, Menu_ID);
                SqlDataReader _drMenu = null;
                _drMenu = _service.ExecuteSPReader("SP_GetTen_chucnangMaster");
                if (_drMenu.HasRows)
                {
                    while (_drMenu.Read())
                    {
                        str        = _drMenu["Ten_chucnang"].ToString();
                        strParrent = _drMenu["MenuParrent"].ToString();
                    }
                }
                _drMenu.Close();
                _service.CloseConnect();
                _service.Disconnect();

                return(" " + strParrent + " ยป " + str);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                _service.CloseConnect();
                _service.Disconnect();
            }
        }
Example #2
0
        //End
        //keyword
        public void InsertT_Keywords(string Keyword, double NewsID, int UserID)
        {
            string _sql = "CMS_InsertT_Keywords_Dynamic";

            try
            {
                string sql = "Delete T_KeyNews where IDNews = " + NewsID;
                HPCDataProvider.Instance().ExecSql(sql);
                string[] _Keyword = Keyword.ToString().Trim().Split(',');
                for (int i = 0; i < _Keyword.Length; i++)
                {
                    string _key = _Keyword[i].Trim();
                    if (_key.Length > 1)
                    {
                        SqlService _sqlservice = new SqlService();
                        _sqlservice.AddParameter("@Keyword", SqlDbType.NVarChar, _key, true);
                        _sqlservice.AddParameter("@NewsID", SqlDbType.Float, NewsID, true);
                        _sqlservice.AddParameter("@UserID", SqlDbType.Float, UserID, true);
                        _sqlservice.ExecuteSP(_sql);
                        _sqlservice.CloseConnect(); _sqlservice.Disconnect();
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        protected void LoadData()
        {
            SqlService _service = new SqlService();
            int        Catid    = 0;

            if (Request["catps"] != null)
            {
                Catid = Convert.ToInt32(Request["catps"]);
            }
            DataSet _ds = null;

            //_service.AddParameter("@Cat_Album_ID", SqlDbType.Int, Catid);
            try
            {
                _ds = _service.ExecuteSqlDataSet("select * from T_Album_Photo where Cat_Album_ID= " + Catid.ToString());
                this.rptAlbumActive.DataSource = _ds.Tables[0].DefaultView;
                this.rptAlbumActive.DataBind();
            }
            catch
            {
                _ds.Clear(); _service.CloseConnect();
            }
            finally { _ds.Clear(); _service.CloseConnect(); _service.Disconnect(); }
        }
        public static DataSet CallSP(string StoreName, string fd, string td, int cate)
        {
            DataSet    _ds         = null;
            SqlService _sqlservice = new SqlService();

            if (fd != "")
            {
                _sqlservice.AddParameter("@fromdate", SqlDbType.NVarChar, fd + " 00:00:01", 25);
            }
            if (td != "")
            {
                _sqlservice.AddParameter("@todate", SqlDbType.NVarChar, td + " 23:59:59", 25);
            }
            _sqlservice.AddParameter("@Cate", SqlDbType.Int, cate, 25);
            _ds = _sqlservice.ExecuteSPDataSet(StoreName, StoreName);
            _sqlservice.CloseConnect(); _sqlservice.Disconnect();
            return(_ds);
        }
Example #5
0
        protected void LoadData(double _newsID)
        {
            SqlService _service = new SqlService();

            System.Data.SqlClient.SqlDataReader _dr = null;
            try
            {
                _service.AddParameter("@News_ID", SqlDbType.Int, _newsID);
                _dr = _service.ExecuteSPReader(@"CMS_GetNewDetailsPrints");
                if (_dr != null)
                {
                    while (_dr.Read())
                    {
                        if (_dr["News_DateEdit"] != System.DBNull.Value)
                        {
                            this.litDateTime.Text = Convert.ToDateTime(_dr["News_DateEdit"]).ToString("HH:mm, dd/MM/yyyy");
                        }
                        if (_dr["News_DatePublished"] != System.DBNull.Value)
                        {
                            this.litDateTime.Text = Convert.ToDateTime(_dr["News_DatePublished"]).ToString("HH:mm, dd/MM/yyyy");
                        }
                        this.litTittle.Text = _dr["News_Tittle"].ToString();
                        this.litSapo.Text   = _dr["News_Summary"].ToString();
                        string contents = _dr["News_Body"].ToString();
                        this.litCategorys.Text = "<a href=\"#\">" + HPCBusinessLogic.UltilFunc.GetCategoryName(_dr["CAT_ID"]) + "</a>";
                        //this.litContents.Text = SearchImgTag(contents);
                        this.litContents.Text = contents;

                        if (_dr["News_AuthorName"] != null)
                        {
                            this.litAuthor.Text += "<div class=\"author\">";
                            this.litAuthor.Text += _dr["News_AuthorName"].ToString();
                            this.litAuthor.Text += "</div>";
                        }
                    }
                }
            }
            catch { }
            finally { if (_dr != null)
                      {
                          _dr.Close(); _dr.Dispose();
                      }
                      _service.CloseConnect(); _service.Disconnect(); }
        }