Exemplo n.º 1
0
    private void FillData()
    {
        try
        {
            int PageCount = 0;
            tbl_PhotoGalleryMasterProp Objtbl_PhotoGalleryMasterProp = new tbl_PhotoGalleryMasterProp();
            Objtbl_PhotoGalleryMasterProp.PhotoCode   = 0;
            Objtbl_PhotoGalleryMasterProp.PageNo      = Convert.ToInt32(txtCurPage.Text);
            Objtbl_PhotoGalleryMasterProp.RecordCount = Convert.ToInt32(20);

            tbl_PhotoGalleryMasterBAL Objtbl_PhotoGalleryMasterBAL = new tbl_PhotoGalleryMasterBAL();
            DataSet dsData = Objtbl_PhotoGalleryMasterBAL.Select_Data(Objtbl_PhotoGalleryMasterProp, ref PageCount);

            lblTotalPage.Text = Convert.ToString(PageCount);

            grdData.DataSource = dsData.Tables[0];
            grdData.DataBind();
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
Exemplo n.º 2
0
    private void EditData(int PhotoCode)
    {
        try
        {
            tbl_PhotoGalleryMasterProp Objtbl_PhotoGalleryMasterProp = new tbl_PhotoGalleryMasterProp();
            Objtbl_PhotoGalleryMasterProp.PhotoCode = PhotoCode;

            int PageCount = 0;
            tbl_PhotoGalleryMasterBAL Objtbl_PhotoGalleryMasterBAL = new tbl_PhotoGalleryMasterBAL();
            DataSet dsData = Objtbl_PhotoGalleryMasterBAL.Select_Data(Objtbl_PhotoGalleryMasterProp, ref PageCount);

            txtPhotoHead.Text          = Convert.ToString(dsData.Tables[0].Rows[0]["PhotoHead"]);
            ddlAlbumName.SelectedValue = Convert.ToString(dsData.Tables[0].Rows[0]["AlbumCode"]);
            tdUploadedImage.Visible    = true;
            imgPhotos.ImageUrl         = "~/PhotoGallery/" + Convert.ToString(dsData.Tables[0].Rows[0]["FileName"]).Split('.')[0] + "_thumb.jpg";

            ViewState["FileName"] = Convert.ToString(dsData.Tables[0].Rows[0]["FileName"]);
            ViewState["EditCode"] = PhotoCode;
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }