Beispiel #1
0
    public string ShowItem(ImageAndClips imgAndClip, string column)
    {
        switch (column)
        {
            case "TieuDe":
                return imgAndClip.Ten_Vn;

            case "LienKet":
                return "/View/DetailPhoto.aspx?ID=" + imgAndClip.ID;
            default: return "";
        }
    }
Beispiel #2
0
    private ImageAndClips GetData()
    {
        ImageAndClips data = null;
        if (lblId.Text != "")
            data = ImageAndClips.LayTheoID(lblId.Text);//lay thong tin cu cap nhat
        else
            data = new ImageAndClips();//Them moi
        data.Ten_Vn = txtTenVn.Text;
        data.Ten_En = "";
        data.Ten_Ru = "";
        data.Ten_Cn = "";

        data.MoTa_Vn = txtmoTaVn.Text;
        data.MoTa_En = "";
        data.MoTa_Ru = "";
        data.MoTa_Cn = "";

        data.IDTheLoai = 6;
        data.NgayTao = DateTime.Now.ToShortDateString();
        string datalistimg = "";
        foreach (var item in album)
            datalistimg += item.HinhAnh + "'";
        data.ImgOrClip = datalistimg;
        return data;
    }
Beispiel #3
0
    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();
    }
Beispiel #4
0
 public static int Them(ImageAndClips imgorclip)
 {
     try
     {
         object rs = DataProvider.Instance.ExecuteNonQueryWithOutput("@ID", "ImageAndClips_Them",
             imgorclip.ID, imgorclip.Ten_Vn, imgorclip.NgayTao, imgorclip.MoTa_Vn,
             imgorclip.LuotXem, imgorclip.HinhAnh, imgorclip.ImgOrClip, imgorclip.IDTheLoai);
         return Convert.ToInt32(rs);
     }
     catch
     {
         return 0;
     }
 }
Beispiel #5
0
 public static bool Sua(ImageAndClips imgorclip)
 {
     try
     {
         object rs = DataProvider.Instance.ExecuteNonQuery("ImageAndClips_Sua",
             imgorclip.ID, imgorclip.Ten_Vn, imgorclip.NgayTao, imgorclip.MoTa_Vn,
             imgorclip.LuotXem, imgorclip.HinhAnh, imgorclip.ImgOrClip, imgorclip.IDTheLoai);
         return Convert.ToInt32(rs) > 0;
     }
     catch
     {
         return false;
     }
 }
Beispiel #6
0
    private void SetData(ImageAndClips data)
    {
        lblId.Text = data.ID.ToString();
        txtTenVn.Text = data.Ten_Vn;
        txtmoTaVn.Text = data.MoTa_Vn;
        txtTenEn.Text = data.Ten_En;
        txtmoTaEn.Text = data.MoTa_En;

        txtAnhDaiDien.Text = data.HinhAnh;
        txtHinhAnh.Text = data.ImgOrClip;
    }
Beispiel #7
0
 private ImageAndClips GetData()
 {
     ImageAndClips data = null;
     if (lblId.Text != "")
     {
         //lay thong tin cu tu Database de cap nhat
         data = ImageAndClips.LayTheoID(lblId.Text);
         //cap nhat lai thoi gian chinh sua
         data.NgayTao = DateTime.Now.ToShortDateString();
     }
     else
     {
         data = new ImageAndClips();//them moi
         data.NgayTao = DateTime.Now.ToShortDateString();
     }
     data.Ten_Vn = txtTenVn.Text;
     data.MoTa_Vn = txtmoTaVn.Text;
     data.Ten_En = txtTenEn.Text;
     data.MoTa_En = txtmoTaEn.Text;
     data.Ten_Ru = "";
     data.MoTa_Ru = "";
     data.IDTheLoai = 5;
     data.NgayTao = DateTime.Now.ToShortDateString();
     data.HinhAnh = txtAnhDaiDien.Text;
     data.ImgOrClip = txtHinhAnh.Text;
     return data;
 }
 private void SetData(ImageAndClips data)
 {
     lblId.Text = data.ID.ToString();
     txtTenVn.Text = data.Ten_Vn;
     txtmoTaVn.Text = data.MoTa_Vn;
     txtTenEn.Text = data.Ten_En;
     txtmoTaEn.Text = data.MoTa_En;
     txtTenRu.Text = data.Ten_Ru;
     txtmoTaRu.Text = data.MoTa_Ru;
     txtAnhDaiDien.Text = data.HinhAnh;
     txtHinhAnh.Text = data.ImgOrClip;
     drlWebsite.SelectedValue = data.Website.ToString();
 }