コード例 #1
0
        protected void GrdBlogList_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int id = 0;

            if (e.CommandName == "Deleterec")
            {
                id = Convert.ToInt32(e.CommandArgument);
                int result = clsobj.DeleteDreamHouse(id);
                FillGridData();
            }
            else if (e.CommandName == "Editrec")
            {
                id = Convert.ToInt32(e.CommandArgument);
                DataTable dt = new DataTable();
                dt                  = clsobj.GetDreamHousebyID(id);
                txtName.Text        = dt.Rows[0]["Title"].ToString();
                hdnImg.Value        = dt.Rows[0]["ImageUrl"].ToString();
                imgbanner.ImageUrl  = "/admin/uploadfiles/" + dt.Rows[0]["ImageUrl"].ToString();
                txtDescription.Text = dt.Rows[0]["Description"].ToString();
                imgbanner.Visible   = true;
                FillGridData();
            }
            else
            {
                FillGridData();
            }
        }
コード例 #2
0
        protected void GrdBlogList_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int id = 0;

            if (e.CommandName == "Deleterec")
            {
                id = Convert.ToInt32(e.CommandArgument);
                int result = clsobj.DeleteDreamHouse(id);
                FillGridData();
            }
            else if (e.CommandName == "Editrec")
            {
                id          = Convert.ToInt32(e.CommandArgument);
                hdnId.Value = id.ToString();
                DataTable dt = new DataTable();
                dt                  = clsobj.GetDreamHousebyID(id);
                txtName.Text        = dt.Rows[0]["Title"].ToString();
                hdnImg.Value        = dt.Rows[0]["ImageUrl"].ToString();
                hdnLogo.Value       = dt.Rows[0]["Logo"].ToString();
                imgbanner.ImageUrl  = "/admin/uploadfiles/" + dt.Rows[0]["ImageUrl"].ToString();
                ImgLogo.ImageUrl    = "/admin/logo/" + dt.Rows[0]["Logo"].ToString();
                txtDescription.Text = Server.HtmlDecode(Convert.ToString(dt.Rows[0]["Description"]));
                txtPrice.Text       = dt.Rows[0]["Price"].ToString();
                txtAddress.Text     = dt.Rows[0]["Address"].ToString();
                imgbanner.Visible   = true;
                ImgLogo.Visible     = true;
                FillGridData();
                BtnUpdate.Visible      = true;
                btnUploadImage.Visible = false;
            }
            else
            {
                FillGridData();
            }
        }