Exemplo n.º 1
0
        protected void lbtnDelete_Click(object sender, EventArgs e)
        {
            List <object> fieldValues = ASPxGridView1_Unit.GetSelectedFieldValues(new string[] { "ID" });

            foreach (var item in fieldValues)
            {
                _UnitRepo.Remove(Utils.CIntDef(item));
            }
            Response.Redirect("don-vi.aspx");
        }
Exemplo n.º 2
0
        private void LoadUnit()
        {
            try
            {
                var list = _UnitRepo.GetAll();

                HttpContext.Current.Session["listUnit"] = list;
                ASPxGridView1_Unit.DataSource           = list;
                ASPxGridView1_Unit.DataBind();
            }
            catch //(Exception)
            {
                //throw;
            }
        }
Exemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            bool isPermission = _UnitDataRepo.checkPermissionPage("don-vi.aspx", Utils.CIntDef(Session["groupId"]), Utils.CIntDef(Session["groupType"]));

            if (!isPermission)
            {
                Response.Write("<script>alert('Bạn không có quyền truy cập vào trang này');location.href='trang-chu.aspx';</script>");
            }
            id = Utils.CIntDef(Request.QueryString["id"]);
            if (!IsPostBack)
            {
                LoadInfo();
                LoadUnit();
            }
            else
            {
                ASPxGridView1_Unit.DataSource = HttpContext.Current.Session["listUnit"];
                ASPxGridView1_Unit.DataBind();
            }
        }