Ejemplo n.º 1
0
        protected void GrDelete(object sender, CommandEventArgs e)
        {
            SessionUserLogin nUserLogin = (SessionUserLogin)Session["UserLogin"];

            nUserLogin.CheckRole("CA0001");
            if (!nUserLogin.Role.Del)
            {
                Response.Write("<script >alert('Bạn không có quyền xóa danh mục này!')</script>");
            }
            else
            {
                try
                {
                    int       mKey = int.Parse(e.CommandArgument.ToString());
                    Seed_Info info = new Seed_Info(mKey);
                    info.Delete();
                    DataTable nTable = Seeds_Categories_Data.GetList(0, 1, txtSearch.Text);
                    GV_Seeds.DataSource = nTable;
                    GV_Seeds.DataBind();
                }
                catch
                {
                    Response.Write("<script >alert('Có lỗi gì đó vui lòng thử lại!')</script>");
                }
            }
        }
Ejemplo n.º 2
0
        protected void cmdView_Click1(object sender, ImageClickEventArgs e)
        {
            txtPageNumber.Text = "1";
            int       nPageSize = int.Parse(txtPageSize.Text);
            DataTable nTable    = Seeds_Categories_Data.GetList(nPageSize, 1, txtSearch.Text);

            GV_Seeds.DataSource = nTable;
            GV_Seeds.DataBind();
            LoadPages();
        }
Ejemplo n.º 3
0
        private void LoadData()
        {
            int       nPageNumber = int.Parse(txtPageNumber.Text);
            int       nPageSize   = int.Parse(txtPageSize.Text);
            DataTable nTable      = Seeds_Categories_Data.GetList(nPageSize, nPageNumber, txtSearch.Text);

            GV_Seeds.DataSource = nTable;
            GV_Seeds.DataBind();
            LoadPages();
        }