Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int page = int.Parse("0" + Request.QueryString["page"]);

            if (page == 0)
            {
                page = 1;
            }
            if (!IsPostBack)
            {
                string MADM = Request.QueryString.Get("MADM");

                DataTable dt = new DataTable();
                //string sql="Select * from tbDANHMUC where DanhMuc_ID='"++"'"
                //string parent_id = "";


                if (MADM == null)
                {
                    // sql = "Select * from tbSANPHAM";
                    NapDuLieu1(page, 20, 4);
                }
                else
                {
                    SqlParameter[] pr = { new SqlParameter("@MaDM", MADM) };

                    dt = cm.getTableStoreprocedure("getSanPham", pr);

                    DataList1.DataSource = dt;
                    DataList1.DataBind();
                    NapDuLieu(page, 20, 4, Int16.Parse(MADM));
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            SqlParameter[] pr = { new SqlParameter("@MaDM", DBNull.Value) };

            tbDANHMUC = cm.getTableStoreprocedure("getCategory", pr);

            MenuDequy(0);
            strMenu += "</ul></div>";
        }
Beispiel #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int page = int.Parse("0" + Request.QueryString["page"]);

            if (page == 0)
            {
                page = 1;
            }
            if (!IsPostBack)
            {
                string MADM = Request.QueryString.Get("MADM");

                DataTable dt = new DataTable();
                //string sql="Select * from tbDANHMUC where DanhMuc_ID='"++"'"
                //string parent_id = "";


                if (MADM == null)
                {
                    // sql = "Select * from tbSANPHAM";
                    NapDuLieu1(page, 20, 4);
                }
                else
                {
                    SqlParameter[] pr = { new SqlParameter("@MaDM", MADM) };

                    dt = cm.getTableStoreprocedure("getSanPham", pr);

                    DataList1.DataSource = dt;
                    DataList1.DataBind();
                    if (dt.Rows.Count > 0)
                    {
                        NapDuLieu(page, 20, 4, Int16.Parse(MADM));
                    }
                    else
                    {
                        string script = "alert(\"Mục này chưa có sản phẩm!\");";
                        ScriptManager.RegisterStartupScript(this, GetType(), "ServerControlScript", script, true);
                        return;
                    }
                }
            }
        }
Beispiel #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                user_name.Attributes.Add("onkeypress", "return clickButton(event,'" + btn_dangnhap.ClientID + "')");
                password.Attributes.Add("onkeypress", "return clickButton(event,'" + btn_dangnhap.ClientID + "')");
                username.Attributes.Add("onkeypress", "return clickButton(event,'" + btn_dangky.ClientID + "')");
                password1.Attributes.Add("onkeypress", "return clickButton(event,'" + btn_dangky.ClientID + "')");
                password2.Attributes.Add("onkeypress", "return clickButton(event,'" + btn_dangky.ClientID + "')");
                day.Attributes.Add("onkeypress", "return clickButton(event,'" + btn_dangky.ClientID + "')");
                month.Attributes.Add("onkeypress", "return clickButton(event,'" + btn_dangky.ClientID + "')");
                year.Attributes.Add("onkeypress", "return clickButton(event,'" + btn_dangky.ClientID + "')");
                txt_search.Attributes.Add("onkeypress", "return clickButton(event,'" + btn_timkiem.ClientID + "')");
                chat_input.Attributes.Add("onkeypress", "return clickButton(event,'" + chat_submit.ClientID + "')");
            }
            SqlParameter[] pr = { new SqlParameter("@MaDM", DBNull.Value) };

            tbDANHMUC = cm.getTableStoreprocedure("getCategory", pr);

            MenuDequy(0);
            strMenu += "</ul></div>";

            if (Request.Cookies["UserName"] == null)
            {
                strLogin += "<li><a data-modal='modalTwo' class='button'>Đăng ký</a></li> ";
                strLogin += "<li><a data-modal='modalOne' class='button'>Đăng nhập</a></li>";
            }
            else
            {
                string    username = Request.Cookies["UserName"].Value;
                string    password = Request.Cookies["Password"].Value;
                string    userid   = "Select * from View_login where UserName='******' and Password='******'";
                DataTable tb       = cm.getTable(userid);
                foreach (DataRow row in tb.Rows)
                {
                    strLogin += "<li><a title='Click vào đây để xem thông tin của bạn' href='ThongTinKhachHang.aspx'>Chào mừng " + row["HoTen"].ToString() + "</a></li>";
                }
                strLogin += "<li><a href='DangXuat.aspx'>Đăng xuất</a>";
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.Cookies["UserName"] == null)
            {
                strLogin += "<li class='nav - item dropdown'><a  data-modal='modalOne' class='nav-link button'>Đăng nhập</a></li>";
                string sql = "Select * from tbMODULE";
                tbModule = cm.getTable(sql);
                MenuDequy(0);
                strMenu += "</ul></div>";
            }
            else
            {
                login();
                string         username = Request.Cookies["UserName"].Value;
                string         password = Request.Cookies["Password"].Value;
                SqlParameter[] pr       = { new SqlParameter("@UserName", username), new SqlParameter("@Password", password) };

                tbModule = cm.getTableStoreprocedure("getMo", pr);
                MenuDequy(0);
                strMenu += "</ul></div>";
            }
        }