Пример #1
0
        protected void GridViewGuest_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            LinkButton lbGuestTitle = (LinkButton)(e.Row.FindControl("lbGuestTitle"));

            if (lbGuestTitle != null)
            {
                lbGuestTitle.CommandName = DataBinder.Eval(e.Row.DataItem, "guest_id").ToString();
            }

            LinkButton lbGueatRefer = (LinkButton)(e.Row.FindControl("lbGueatRefer"));

            if (lbGueatRefer != null)
            {
                lbGueatRefer.Text        = "ที่ " + (string)DataBinder.Eval(e.Row.DataItem, "guest_refer") + " เรื่อง " + (string)DataBinder.Eval(e.Row.DataItem, "guest_refer_title");
                lbGueatRefer.CommandName = (string)DataBinder.Eval(e.Row.DataItem, "guest_id").ToString();
            }

            LinkButton lbGuestDate = (LinkButton)(e.Row.FindControl("lbGuestDate"));

            if (lbGuestDate != null)
            {
                lbGuestDate.Text        = dBScript.convertDatelongThai((string)DataBinder.Eval(e.Row.DataItem, "guest_refer_date"));
                lbGuestDate.CommandName = (string)DataBinder.Eval(e.Row.DataItem, "guest_id").ToString();
            }

            Label lbGuestAmount = (Label)(e.Row.FindControl("lbGuestAmount"));

            if (lbGuestAmount != null)
            {
                lbGuestAmount.Text = dBScript.selectCount("tbl_guest_list", "guest_id = '" + DataBinder.Eval(e.Row.DataItem, "guest_id").ToString() + "'", "guest_id").ToString();
            }
        }