コード例 #1
0
    protected void PopulateControls(DataAccess.Classes.Product pr)
    {
        ltrTenSanPham.Text = pr.ProductName;
        ltrMaSanPham.Text = pr.ProductCode;
        ltrOldPrice.Text = showMoney(pr.OldPrice).ToString();
        ltrNewPrice.Text = showMoney(pr.NewPrice).ToString();
        ltrDiscount.Text = pr.Discount.ToString();
        ltrMoTa.Text = pr.Description;
        ltrChiTietSanPham.Text = pr.Detail;
        ltrXuatXu.Text = pr.Origin;
        ltrBaoHanh.Text = pr.Guarantee;

        List<Img> album = new List<Img>();
        int idimg = 0;
        string listimg = pr.Image;
        string[] str = listimg.Split('\'');
        foreach (var item in str)
        {
            if (item.ToString() != "")
            {
                Img dataimg = new Img();
                dataimg.ID = idimg;
                dataimg.Ten = pr.ProductName;
                dataimg.HinhAnh = item.ToString();
                album.Add(dataimg);
                idimg++;
            }
        }
        rptListImg.DataSource = album;
        rptListImg.DataBind();

        figureLarge.HRef = str.First().Trim().ToString();
        //figureLarge.Title = pr.ProductName;
        figureThumb.Src = ToThumb(str.First().Trim().ToString());
    }
コード例 #2
0
    private void PopulateControls()
    {
        string id = Request.QueryString["ID"];
        ImageAndClips data = ImageAndClips.LayTheoID(Convert.ToInt32(id));
        if (data != null)
        {
            string img = "";
            int stt = 0;

            Label1.Text = data.Ten_Vn;
            List<Img> listimgs = new List<Img>();
            string listimg = data.ImgOrClip;
            string[] str = listimg.Split('\'');
            foreach (var item in str)
            {
                if (item.ToString() != "")
                {
                    Img dataimg = new Img();
                    if (stt == 0)
                        img = item.ToString();
                    dataimg.HinhAnh = item.ToString();
                    listimgs.Add(dataimg);
                }
                stt++;
            }
            UpdataPageView.UpdataMetagOpenGraph(Page, data.Ten_Vn, data.MoTa_Vn, Link.DetailPhoto(data.Ten_Vn, data.ID.ToString()), img, "Photo");
            dlListimages.DataSource = listimgs;
            dlListimages.DataBind();
        }
    }
コード例 #3
0
ファイル: DetailPhoto.aspx.cs プロジェクト: hoanghcmus/tomato
    private void PopulateControls()
    {
        string id = Request.QueryString["ID"];
        ImageAndClips data = ImageAndClips.LayTheoID(id);
        if (data != null)
        {
            if (Session["lang"].ToString().Equals("vn")) { ltrCtTitle.Text = data.Ten_Vn; }
            else if (Session["lang"].ToString().Equals("en")) { ltrCtTitle.Text = data.Ten_En; }
            else if (Session["lang"].ToString().Equals("ru")) { ltrCtTitle.Text = data.Ten_Ru; }

            List<Img> listimgs = new List<Img>();
            string listimg = data.ImgOrClip;
            string[] str = listimg.Split('\'');
            foreach (var item in str)
            {
                if (item.ToString() != "")
                {
                    Img dataimg = new Img();
                    dataimg.HinhAnh = item.ToString();
                    listimgs.Add(dataimg);
                }
            }
            dlListimages.DataSource = listimgs;
            dlListimages.DataBind();
        }
    }
コード例 #4
0
    protected void PopulateControls(MonAn pr)
    {
        ltrPrice.Text = showMoney(pr.Gia).ToString();

        if (Session["lang"].ToString().Equals("vn"))
        {
            ltrTenSanPham.Text = pr.TenMon_Vn;
            ltrCtTitle.Text = pr.TenMon_Vn;
            ltrMoTa.Text = pr.MoTa_Vn;
            ltrChiTietSanPham.Text = pr.ChiTiet_Vn;
            figureLarge.Title = pr.TenMon_Vn;
        }
        else if (Session["lang"].ToString().Equals("en"))
        {
            ltrTenSanPham.Text = pr.TenMon_En;
            ltrCtTitle.Text = pr.TenMon_En;
            ltrMoTa.Text = pr.MoTa_En;
            ltrChiTietSanPham.Text = pr.ChiTiet_En;
            figureLarge.Title = pr.TenMon_En;
        }
        else if (Session["lang"].ToString().Equals("ru"))
        {
            ltrTenSanPham.Text = pr.TenMon_Ru;
            ltrCtTitle.Text = pr.TenMon_Ru;
            ltrMoTa.Text = pr.MoTa_Ru;
            ltrChiTietSanPham.Text = pr.ChiTiet_Ru;
            figureLarge.Title = pr.TenMon_Ru;
        }

        List<Img> album = new List<Img>();
        int idimg = 0;
        string listimg = pr.HinhAnh;
        string[] str = listimg.Split('\'');
        foreach (var item in str)
        {
            if (item.ToString() != "")
            {
                Img dataimg = new Img();
                dataimg.ID = idimg;
                dataimg.HinhAnh = item.ToString();
                album.Add(dataimg);
                idimg++;
            }
        }
        rptListImg.DataSource = album;
        rptListImg.DataBind();

        figureLarge.HRef = str.First().Trim().ToString();
        figureThumb.Src = ToThumb(str.First().Trim().ToString());

        List<MonAn> listBV = MonAn.MonAn_LayTheoIDTheLoai(pr.MenuID);
        if (listBV != null && listBV.Count != 0)
        {
            rptRelatedProduct.DataSource = listBV;
            rptRelatedProduct.DataBind();
        }
    }
コード例 #5
0
ファイル: Site.master.cs プロジェクト: hoanghcmus/benhvien
    private void LoadAlbum()
    {
        ImageAndClips data = ImageAndClips.LayTheoID(ImageAndClips.ImageAndClips_GetLastID(14));
        if (data != null)
        {
            List<Img> listimgs = new List<Img>();
            string listimg = data.ImgOrClip;
            string[] str = listimg.Split('\'');

            foreach (var item in str)
            {
                if (item.ToString() != "")
                {
                    Img dataimg = new Img();
                    dataimg.HinhAnh = item.ToString();
                    listimgs.Add(dataimg);
                }
            }

            int j = 1;
            foreach (Img img in listimgs)
            {
                if (j == 1)
                {
                    ltrListImages.Text += "<li>";
                }
                ltrListImages.Text += "<div class='gallery-item'>"
                             + "<a class='highslide imgshow link' rel='main-gallery' href='" + img.HinhAnh + "'>"
                                 + "<img src='" + img.HinhAnh + "' alt='Picture' class='img' />"
                             + "</a>"
                          + "</div>";

                if (j == 2)
                {
                    ltrListImages.Text += "</li>";
                    j = 1;
                    continue;
                }
                j++;

            }
        }
    }
コード例 #6
0
 private void PopulateControls()
 {
     ImageAndClips dataimg = ImageAndClips.ImageAndClipsTop1("6");
     if (dataimg != null)
     {
         List<Img> showlistimgs = new List<Img>();
         string listimg = dataimg.ImgOrClip;
         string[] str = listimg.Split('\'');
         foreach (var item in str)
         {
             if (item.ToString() != "")
             {
                 Img itemimg = new Img();
                 itemimg.HinhAnh = item.ToString();
                 showlistimgs.Add(itemimg);
             }
         }
         dlNewsHot.DataSource = showlistimgs;
         dlNewsHot.DataBind();
     }
 }
コード例 #7
0
ファイル: DetailPhoto.aspx.cs プロジェクト: hoanghcmus/tasty
 private void PopulateControls()
 {
     string id = Request.QueryString["ID"];
     ImageAndClips data = ImageAndClips.LayTheoID(id);
     if (data != null)
     {
         List<Img> listimgs = new List<Img>();
         string listimg = data.ImgOrClip;
         string[] str = listimg.Split('\'');
         foreach (var item in str)
         {
             if (item.ToString() != "")
             {
                 Img dataimg = new Img();
                 dataimg.HinhAnh = item.ToString();
                 listimgs.Add(dataimg);
             }
         }
         dlListimages.DataSource = listimgs;
         dlListimages.DataBind();
     }
 }
コード例 #8
0
    private void LoadFirstAlbum()
    {
        ImageAndClips data = ImageAndClips.LayTheoID("10");
        if (data != null)
        {
            List<Img> listimgs = new List<Img>();
            string listimg = data.ImgOrClip;
            string[] str = listimg.Split('\'');
            int i = 1;
            foreach (var item in str)
            {
                if (item.ToString() != "")
                {
                    Img dataimg = new Img();
                    dataimg.HinhAnh = item.ToString();
                    listimgs.Add(dataimg);

                    i++;
                }
            }
            dlListimages.DataSource = listimgs;
            dlListimages.DataBind();
        }
    }
コード例 #9
0
ファイル: EditProduct.aspx.cs プロジェクト: hoanghcmus/tomato
    private void SetData(MonAn data)
    {
        lblId.Text = data.ID.ToString();

        txtTieuDe_Vi.Text = data.TenMon_Vn;
        txtChiTietVn.Text = data.ChiTiet_Vn;
        txtTomTatVn.Text = data.MoTa_Vn;

        txtTieuDe_En.Text = data.TenMon_En;
        txtChiTietEn.Text = data.ChiTiet_En;
        txtTomTatEn.Text = data.MoTa_En;

        txtTieuDe_Ru.Text = data.TenMon_Ru;
        txtChiTietRu.Text = data.ChiTiet_Ru;
        txtTomTatRu.Text = data.MoTa_Ru;

        txtHinhNho.Text = data.AnhDaiDien;
        if (data.Gia <= 0)
            txtDonGia.Text = "0";
        else
            txtDonGia.Text = String.Format("{0:#.##}", data.Gia);
        ddlLoaiMenu.SelectedValue = data.MenuID.ToString();

        int idimg = 0;
        string listimg = data.HinhAnh;
        string[] str = listimg.Split('\'');
        foreach (var item in str)
        {
            if (item.ToString() != "")
            {
                Img dataimg = new Img();
                dataimg.ID = idimg;
                dataimg.HinhAnh = item.ToString();
                album.Add(dataimg);
                idimg++;
            }
        }
        dlListImg.DataSource = album;
        dlListImg.DataBind();
    }
コード例 #10
0
ファイル: EditProduct.aspx.cs プロジェクト: hoanghcmus/tomato
 void btnaddimg_Click(object sender, EventArgs e)
 {
     Label1.Text = "";
     if (txtHinhAnh.Text != "")
     {
         int stt;
         if (album == null)
         {
             stt = 0;
             album = new List<Img>();
         }
         else
             stt = album.Count;
         Img dataimg = new Img();
         dataimg.ID = stt;
         dataimg.HinhAnh = txtHinhAnh.Text.Trim();
         album.Add(dataimg);
         dlListImg.DataSource = album;
         dlListImg.DataBind();
         txtHinhAnh.Text = "";
     }
     else
         lbhinhanh.Visible = true;
 }
コード例 #11
0
ファイル: EditProduct.aspx.cs プロジェクト: hoanghcmus/sanaco
    private void SetData(DataAccess.Classes.Product data)
    {
        lblId.Text = data.ID.ToString();
        ddlLoaiMenu.SelectedValue = data.ProductCategoryID.ToString();
        txtMaSanPham.Text = data.ProductCode;
        txtTieuDe_Vi.Text = data.ProductName;
        txtTomTatVn.Text = data.Description;
        txtChiTietVn.Text = data.Detail;
        txtHinhNho.Text = data.Thumbnail;
        txtDonGia.Text = showMoney(data.OldPrice).ToString();

        txtGiamGia.Text = data.Discount.ToString();
        txtXuatXu.Text = data.Origin;
        txtBaoHanh.Text = data.Guarantee;

        if (data.IsNew == 1)
            ckbSanPhamMoi.Checked = true;
        else
            ckbSanPhamMoi.Checked = false;

        int idimg = 0;
        string listimg = data.Image;
        string[] str = listimg.Split('\'');
        foreach (var item in str)
        {
            if (item.ToString() != "")
            {
                Img dataimg = new Img();
                dataimg.ID = idimg;
                dataimg.HinhAnh = item.ToString();
                album.Add(dataimg);
                idimg++;
            }
        }
        dlListImg.DataSource = album;
        dlListImg.DataBind();
    }
コード例 #12
0
ファイル: EditPhoto.aspx.cs プロジェクト: hoanghcmus/tasty
    private void SetData(ImageAndClips data)
    {
        txtTenVn.Text = data.Ten_Vn;
        txtmoTaVn.Text = data.MoTa_Vn;

        lblId.Text = data.ID.ToString();
        int idimg = 0;
        string listimg = data.ImgOrClip;
        string[] str = listimg.Split('\'');
        foreach (var item in str)
        {
            if (item.ToString() != "")
            {
                Img dataimg = new Img();
                dataimg.ID = idimg;
                dataimg.HinhAnh = item.ToString();
                album.Add(dataimg);
                idimg++;
            }
        }
        dlListImg.DataSource = album;
        dlListImg.DataBind();
    }