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

            foreach (var item in fieldValues)
            {
                _ProductDetailMaterialRepo.Remove(Utils.CIntDef(item));
            }
            Response.Redirect("nguyen-lieu-can-cho-san-pham.aspx?id=" + id);
        }
Esempio n. 2
0
        private void LoadProduct_Material()
        {
            try
            {
                int productDetailId = Utils.CIntDef(ddlProductDetail.SelectedValue);
                var list            = _ProductDetailMaterialRepo.GetByProductDetailId(productDetailId);

                HttpContext.Current.Session["listProductMaterial"] = list;
                ASPxGridView_ProductDetail_Material.DataSource     = list;
                ASPxGridView_ProductDetail_Material.DataBind();
            }
            catch //(Exception)
            {
                //throw;
            }
        }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            bool isPermission = _UnitDataRepo.checkPermissionPage("nguyen-lieu-can-cho-san-pham.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)
            {
                LoadProductDetail();
                LoadProductDetailSize();
                LoadMaterial();
                LoadProduct_Material();
            }
            else
            {
                ASPxGridView_ProductDetail_Material.DataSource = HttpContext.Current.Session["listProductMaterial"];
                ASPxGridView_ProductDetail_Material.DataBind();
            }
        }