예제 #1
0
 public void UpdateTotalViews(int ArticleID, string Lang)
 {
     MyConnection ca = new MyConnection();
     //try
     {
         string Sql = "UPDATE Article SET TotalViews = TotalViews + 1 ";
         Sql += "WHERE ModuleID='2' AND ArticleID='" + ArticleID + "' AND Lang='" + Lang + "'";
         ca.ExeSql(Sql);
     }
     //catch { }
 }
예제 #2
0
    /// <summary>
    /// Cập nhật Actived cho đơn hàng
    /// </summary>
    /// <param name="OrderCode"></param>
    /// <returns></returns>
    public bool ConfirmOrder(string OrderCode, string ActiveCode)
    {
        bool         f  = false;
        MyConnection ca = new MyConnection();

        try
        {
            string Sql = "UPDATE [Order] SET Actived = 'True' WHERE OrderCode = '" + OrderCode + "' AND ConfirmString = '" + ActiveCode + "'";
            ca.ExeSql(Sql);
            f = true;
        }
        catch { }
        return(f);
    }
예제 #3
0
        public bool DeleteAboutUsCategory(int CategoryID)
        {
            bool         result = false;
            MyConnection ca     = new MyConnection();

            try
            {
                string Sql = "DELETE FROM ArticleCategory WHERE CategoryID='" + CategoryID + "'";
                ca.ExeSql(Sql);
                result = true;
            }
            catch { result = false; }
            return(result);
        }
예제 #4
0
        public bool InsertVoteDetail(int VoteTypeID, int CommentID, int VoteMark)
        {
            bool         result = false;
            MyConnection ca     = new MyConnection();

            try
            {
                string Sql = "INSERT INTO VoteDetail (VoteTypeID, CommentID, VoteMark) ";
                Sql += "VALUES (N'" + VoteTypeID + "', N'" + CommentID + "',N'" + VoteMark + "')";
                ca.ExeSql(Sql);
                result = true;
            }
            catch { result = false; }
            return(result);
        }
예제 #5
0
        public bool InsertProductComment(int ProductID, int CustomerID, string Title, string Comment)
        {
            bool         result = false;
            MyConnection ca     = new MyConnection();

            try
            {
                string Sql = "INSERT INTO Comment (ProductID, CustomerID, Title, Comment) ";
                Sql += "VALUES (N'" + ProductID + "', N'" + CustomerID + "',N'" + Title + "',N'" + Comment + "')";
                ca.ExeSql(Sql);
                result = true;
            }
            catch { result = false; }
            return(result);
        }
예제 #6
0
    protected void btnAction_Click(object sender, EventArgs e)
    {
        string  c          = ddlChoice.SelectedValue;
        string  tblname    = txtTableName.Text.Trim();
        DataSet ds         = new DataSet();
        Article art        = new Article();
        Product pro        = new Product();
        int     AgentCatID = Convert.ToInt32(ddlAgentCat.SelectedValue);

        lblAgentCatID.Text = ddlAgentCat.SelectedValue;
        if (c == "SELECT")
        {
            if (tblname == "Article")
            {
                ds = art.GetAllArticle("Article", AgentCatID);
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    Response.Write(DataObject.GetString(ds, i, "ArticleID") + "======" + DataObject.GetString(ds, i, "Title") + "<br />");
                }
            }
            else if (tblname == "ProductCat")
            {
                ds = pro.GetAllProduct("ProductCat", AgentCatID, "VI");
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    Response.Write(DataObject.GetString(ds, i, "ID") + "======" + DataObject.GetString(ds, i, "TenGoi") + "<br />");
                }
            }
        }
        else if (c == "DELETE")
        {
            string       sql = txtSql.Text;
            MyConnection ca  = new MyConnection();
            ca.ExeSql(sql);
        }
    }