public string GetImageUrlByID(int ID)
        {
            string       s  = "";
            MyConnection ca = new MyConnection();

            try
            {
                string Sql = "SELECT ImageUrl FROM RealEstate WHERE ID = '" + ID + "'";
                s = Convert.ToString(ca.ExecuteScalar(Sql));
            }
            catch { }
            return(s);
        }
        /// <summary>
        /// Lấy tên chuyên mục tin tức (Chuẩn)
        /// </summary>
        /// <param name="CateID"></param>
        /// <param name="Lang"></param>
        /// <returns></returns>
        public string GetCategoryNameByCategoryID(int CateID, string Lang)
        {
            string       s  = "";
            MyConnection ca = new MyConnection();

            try
            {
                string Sql = "SELECT CategoryName FROM ArticleCategory WHERE CategoryID='" + CateID + "' AND Lang = '" + Lang + "'";
                s = Convert.ToString(ca.ExecuteScalar(Sql));
            }
            catch { }
            return(s);
        }
Exemple #3
0
        public string GetGroupNameByGroupID(int GroupID, string Lang)
        {
            string       s  = "";
            MyConnection ca = new MyConnection();

            try
            {
                string Sql = "SELECT GroupName" + Lang + " FROM EGroup WHERE ID = '" + GroupID + "'";
                s = Convert.ToString(ca.ExecuteScalar(Sql));
            }
            catch { }
            return(s);
        }
Exemple #4
0
        public string GetCatalogNameByCatalogID(int CatalogID)
        {
            string       s  = "";
            MyConnection ca = new MyConnection();

            try
            {
                string Sql = "SELECT TenNhom FROM GroupCat WHERE ID = '" + CatalogID + "'";
                s = Convert.ToString(ca.ExecuteScalar(Sql));
            }
            catch { }
            return(s);
        }
Exemple #5
0
        public string GetImageOfAlbumID(int AlbumID)
        {
            string       img = "";
            MyConnection ca  = new MyConnection();

            try
            {
                string Sql = "SELECT TOP 1 PhotoUrl FROM GalleryAlbum as a, GalleryPhoto as p WHERE a.ID = p.AlbumID AND a.ID='" + AlbumID + "'";
                img = Convert.ToString(ca.ExecuteScalar(Sql));
            }
            catch { img = ""; }
            return(img);
        }
Exemple #6
0
        public string GetCustomerPasswordByCustomerUsername(string Username)
        {
            string       s  = "";
            MyConnection ca = new MyConnection();

            try
            {
                string Sql = "SELECT CustomerPassword FROM Customer WHERE CustomerUsername='******'";
                s = Convert.ToString(ca.ExecuteScalar(Sql));
            }
            catch { }
            return(s);
        }
Exemple #7
0
        public string GetSizeNameBySizeID(int SizeID)
        {
            string       s  = "";
            MyConnection ca = new MyConnection();

            try
            {
                string Sql = "SELECT SizeName FROM Size WHERE SizeID = '" + SizeID + "'";
                s = Convert.ToString(ca.ExecuteScalar(Sql));
            }
            catch { }
            return(s);
        }
Exemple #8
0
        public int GetFirstAboutUsID(int AgentCatID, string Lang)
        {
            int          ID = 0;
            MyConnection ca = new MyConnection();

            try
            {
                string Sql = "SELECT TOP 1 ArticleID FROM Article WHERE ModuleID='2' AND AgentCatID = '" + AgentCatID + "' AND Lang = '" + Lang + "' ORDER BY ArticleID ASC";
                ID = Convert.ToInt32(ca.ExecuteScalar(Sql));
            }
            catch { }
            return(ID);
        }
Exemple #9
0
        public int GetCategoryIDByArticleID(int ArticleID)
        {
            int          kq = -1;
            MyConnection ca = new MyConnection();

            try
            {
                string Sql = "SELECT CategoryID FROM ArticleCategory WHERE ArticleID = '" + ArticleID + "'";
                kq = Convert.ToInt32(ca.ExecuteScalar(Sql));
            }
            catch { }
            return(kq);
        }
Exemple #10
0
        /// <summary>
        /// Lấy tên cty
        /// </summary>
        /// <param name="AgentCatID"></param>
        /// <param name="Lang"></param>
        /// <returns></returns>
        public string GetAgentName(int AgentCatID, string Lang)
        {
            string       s  = "";
            MyConnection ca = new MyConnection();

            try
            {
                string Sql = "SELECT AgentName" + Lang + " FROM AgentCat WHERE ID = '" + AgentCatID + "'";
                s = Convert.ToString(ca.ExecuteScalar(Sql));
            }
            catch { }
            return(s);
        }
Exemple #11
0
        public string GetFacultyName(int FacultyID, string Lang)
        {
            string       s  = "";
            MyConnection ca = new MyConnection();

            try
            {
                string Sql = "SELECT FacultyName" + Lang + " FROM Faculty WHERE FacultyID = '" + FacultyID + "'";
                s = Convert.ToString(ca.ExecuteScalar(Sql));
            }
            catch { }
            return(s);
        }
Exemple #12
0
        /// <summary>
        /// Lấy path thư mục Upload trên host
        /// </summary>
        /// <param name="AgentCatID"></param>
        /// <returns></returns>
        public string GetUploadHost(int AgentCatID)
        {
            string       s  = "";
            MyConnection ca = new MyConnection();

            try
            {
                string Sql = "SELECT UploadHost FROM AgentCat WHERE ID = '" + AgentCatID + "'";
                s = Convert.ToString(ca.ExecuteScalar(Sql));
            }
            catch { }
            return(s);
        }
Exemple #13
0
        public string GetProducerNameByProducerID(int ProducerID)
        {
            string       s  = "";
            MyConnection ca = new MyConnection();

            try
            {
                string Sql = "SELECT ProducerName FROM Producer WHERE ProducerID='" + ProducerID + "'";
                s = Convert.ToString(ca.ExecuteScalar(Sql));
            }
            catch { }
            return(s);
        }
Exemple #14
0
        /// <summary>
        /// Lấy AgentCatID mới nhất
        /// </summary>
        /// <returns></returns>
        public int GetLastAgentCatID()
        {
            int          kq = -1;
            MyConnection ca = new MyConnection();

            try
            {
                string Sql = "SELECT TOP 1 ID FROM AgentCat ORDER BY ID DESC";
                kq = Convert.ToInt32(ca.ExecuteScalar(Sql));
            }
            catch { }
            return(kq);
        }
        /// <summary>
        /// Lấy số lượng bài viết của nhóm thảo luận
        /// </summary>
        /// <param name="GroupID"></param>
        /// <param name="Lang"></param>
        /// <returns></returns>
        public int GetTotalArticlesOfGroupID(int EGroupID, string Lang)
        {
            int          kq = 0;
            MyConnection ca = new MyConnection();

            try
            {
                string Sql = "SELECT Count(*) FROM Article WHERE EGroupID = '" + EGroupID + "' AND Lang = '" + Lang + "'";
                kq = Convert.ToInt32(ca.ExecuteScalar(Sql));
            }
            catch { kq = 0; }
            return(kq);
        }
Exemple #16
0
    public int GetLastOrderID()
    {
        int          kq = -1;
        MyConnection ca = new MyConnection();

        try
        {
            string Sql = "SELECT ID FROM [Order] WHERE ID >= ALL (Select ID From [Order])";
            kq = Convert.ToInt32(ca.ExecuteScalar(Sql));
        }
        catch { }
        return(kq);
    }
Exemple #17
0
        public string GetCustomerUsernameByCustomerID(int CustomerID)
        {
            string       s  = "";
            MyConnection ca = new MyConnection();

            try
            {
                string Sql = "SELECT CustomerUsername FROM Customer WHERE CustomerID='" + CustomerID + "'";
                s = Convert.ToString(ca.ExecuteScalar(Sql));
            }
            catch { }
            return(s);
        }
Exemple #18
0
    public string GetOrderCodeByOrderID(int OrderID)
    {
        string       s  = "";
        MyConnection ca = new MyConnection();

        try
        {
            string Sql = "SELECT OrderCode FROM [Order] WHERE ID = '" + OrderID + "'";
            s = Convert.ToString(ca.ExecuteScalar(Sql));
        }
        catch { }
        return(s);
    }
Exemple #19
0
        public int GetCustomerIDByCustomerUsername(string CustomerUsername)
        {
            int          kq = -1;
            MyConnection ca = new MyConnection();

            try
            {
                string Sql = "SELECT CustomerID FROM Customer WHERE CustomerUsername='******'";
                kq = Convert.ToInt32(ca.ExecuteScalar(Sql));
            }
            catch { }
            return(kq);
        }
Exemple #20
0
        public string GetLinkImageUrlByLinkID(int LinkID)
        {
            string       s  = "";
            MyConnection ca = new MyConnection();

            try
            {
                string Sql = "SELECT Logo FROM AgentLink WHERE ID='" + LinkID + "'";
                s = Convert.ToString(ca.ExecuteScalar(Sql));
            }
            catch { }
            return(s);
        }
Exemple #21
0
        public string GetChildTypeSizeName(string Lang, int ParentCatID)
        {
            string       s  = "";
            MyConnection ca = new MyConnection();

            try
            {
                string Sql = "SELECT ChildSizeTypeName_" + Lang + " FROM Size WHERE ParentCatID='" + ParentCatID + "'";
                s = Convert.ToString(ca.ExecuteScalar(Sql));
            }
            catch { }
            return(s);
        }
Exemple #22
0
        public int GetCatalogIDByProductID(int ProductID)
        {
            int          kq = -1;
            MyConnection ca = new MyConnection();

            try
            {
                string Sql = "SELECT GroupID FROM ProductCat WHERE ID = '" + ProductID + "'";
                kq = Convert.ToInt32(ca.ExecuteScalar(Sql));
            }
            catch { }
            return(kq);
        }
Exemple #23
0
        public int GetParentCatIDByCatalogID(int CatalogID)
        {
            int          kq = -1;
            MyConnection ca = new MyConnection();

            try
            {
                string Sql = "SELECT ParentCatID FROM GroupCat WHERE ID='" + CatalogID + "'";
                kq = Convert.ToInt32(ca.ExecuteScalar(Sql));
            }
            catch { kq = -1; }
            return(kq);
        }
Exemple #24
0
        //Lấy url hình ảnh của sản phẩm
        public string GetImageUrlByProductID(int ProductID)
        {
            string       s  = "";
            MyConnection ca = new MyConnection();

            try
            {
                string Sql = "SELECT Anh FROM ProductCat WHERE ID = '" + ProductID + "'";
                s = Convert.ToString(ca.ExecuteScalar(Sql));
            }
            catch { }
            return(s);
        }
        public int GetParentCategoryIDByCategoryID(int CategoryID, string ContentType)
        {
            int          kq = -1;
            MyConnection ca = new MyConnection();

            try
            {
                string Sql = "SELECT ParentCategoryID FROM ArticleCategory WHERE ContentType='" + ContentType + "' AND CategoryID='" + CategoryID + "'";
                kq = Convert.ToInt32(ca.ExecuteScalar(Sql));
            }
            catch { kq = -1; }
            return(kq);
        }
Exemple #26
0
        public int GetLastCommentID()
        {
            int          kq = -1;
            MyConnection ca = new MyConnection();

            try
            {
                string Sql = "SELECT CommentID FROM Comment WHERE CommentID >= ALL (Select CommentID From Comment)";
                kq = Convert.ToInt32(ca.ExecuteScalar(Sql));
            }
            catch { }
            return(kq);
        }
Exemple #27
0
        public string GetImageURLByGroupID(int GroupID)
        {
            string       s  = "";
            MyConnection ca = new MyConnection();

            try
            {
                string Sql = "SELECT ImageURL FROM EGroup WHERE ID = '" + GroupID + "'";
                s = Convert.ToString(ca.ExecuteScalar(Sql));
            }
            catch { }
            return(s);
        }
        /// <summary>
        /// Lấy số lượng doanh nhân trong nhóm
        /// </summary>
        /// <param name="GroupID"></param>
        /// <returns></returns>
        public int GetTotalMembersInGroupID(int GroupID)
        {
            int          kq = 0;
            MyConnection ca = new MyConnection();

            try
            {
                string Sql = "SELECT Count(*) FROM Entrepreneur WHERE GroupID = '" + GroupID + "'";
                kq = Convert.ToInt32(ca.ExecuteScalar(Sql));
            }
            catch { kq = 0; }
            return(kq);
        }
Exemple #29
0
        /// <summary>
        /// Lấy ngày sinh nhật của nhóm
        /// </summary>
        /// <param name="GroupID"></param>
        /// <returns></returns>
        public DateTime GetBirthDay(int GroupID)
        {
            DateTime     dt = DateTime.Now;
            MyConnection ca = new MyConnection();

            try
            {
                string Sql = "SELECT BirthDay FROM EGroup WHERE ID = '" + GroupID + "'";
                dt = Convert.ToDateTime(ca.ExecuteScalar(Sql));
            }
            catch { }
            return(dt);
        }
Exemple #30
0
        /// <summary>
        /// Lấy tổng lượt đánh giá của 1 công ty
        /// </summary>
        /// <param name="AgentCatID"></param>
        /// <returns></returns>
        public int GetTotalVotes(int AgentCatID)
        {
            int          kq = -1;
            MyConnection ca = new MyConnection();

            try
            {
                string Sql = "SELECT COUNT(VoteDetailID) FROM VoteDetail WHERE AgentCatID = '" + AgentCatID + "'";
                kq = Convert.ToInt32(ca.ExecuteScalar(Sql));
            }
            catch { }
            return(kq);
        }