Ejemplo n.º 1
0
    public static string Tao_Chuoi_HTML_Danh_sach_Nhom_San_pham_Xem(List <XmlElement> Danh_sach_Nhom_San_pham)
    {
        var Chuoi_HTML_Danh_sach = "<div class='btn btn-primary' style='margin:10px'>";

        Danh_sach_Nhom_San_pham.ForEach(Nhom_San_pham =>
        {
            var Ten                  = Nhom_San_pham.GetAttribute("Ten");
            var Ma_so                = Nhom_San_pham.GetAttribute("Ma_so");
            var So_luong_Ton         = int.Parse(Nhom_San_pham.GetAttribute("So_luong_Ton"));
            var Chuoi_Chuc_nang_Chon = $"<form method='post'>" +
                                       "<input name='Th_Ma_so_Chuc_nang' type='hidden' value='CHON_NHOM_SAN_PHAM' />" +
                                       $"<input name='Th_Ma_so_Nhom_San_pham' type='hidden' value='{Ma_so}' />" +
                                       $"<button type='submit' class ='btn btn-primary'>{Ten} ({So_luong_Ton})</button>" +
                                       "</form>";
            var Chuoi_Hinh      = $"";
            var Chuoi_Thong_tin = $"<div class='' style=''> " +
                                  $"{Chuoi_Chuc_nang_Chon}" +
                                  $"</div>";
            var Chuoi_HTML = $"<div class='btn ' style=' ' >" +
                             $"{Chuoi_Hinh}" + $"{Chuoi_Thong_tin}" +
                             "</div>";
            Chuoi_HTML_Danh_sach += Chuoi_HTML;
        });

        Chuoi_HTML_Danh_sach += "</div>";
        return(Chuoi_HTML_Danh_sach);
    }
Ejemplo n.º 2
0
    public static XmlElement Tim_Nhom_San_pham(string Ma_so, XmlElement Danh_sach_Nhom_San_pham)
    {
        var Kq = (XmlElement)null;

        foreach (XmlElement Nhom_San_pham in Danh_sach_Nhom_San_pham.GetElementsByTagName("San_pham"))
        {
            if (Ma_so == Nhom_San_pham.GetAttribute("Ma_so"))
            {
                Kq = Nhom_San_pham;
            }
        }


        return(Kq);
    }
Ejemplo n.º 3
0
    public static List <XmlElement> Tao_Danh_sach_San_pham_cua_Nhan_vien_Ban_hang(XmlElement Nhan_vien, List <XmlElement> Danh_sach_Tat_ca_San_pham)
    {
        var Danh_sach               = new List <XmlElement>();
        var DS_Nhom_San_pham        = (XmlElement)Nhan_vien.GetElementsByTagName("Danh_sach_Nhom_San_pham")[0];
        var Danh_sach_Nhom_San_pham = XL_NGHIEP_VU.Tao_Danh_sach(DS_Nhom_San_pham, "Nhom_San_pham");

        Danh_sach_Tat_ca_San_pham.ForEach(San_pham =>
        {
            var Ma_so_Nhom_San_pham = San_pham.SelectSingleNode("Nhom_San_pham/@Ma_so").Value;
            if (Danh_sach_Nhom_San_pham.Any(Nhom_San_pham => Nhom_San_pham.GetAttribute("Ma_so") == Ma_so_Nhom_San_pham))
            {
                Danh_sach.Add(San_pham);
            }
        });
        return(Danh_sach);
    }