Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="productId"></param>
        /// <param name="type">==NULL mặc định hình</param>
        /// <param name="type">==1:map</param>
        private void BindData()
        {
            BookingGroupBLL bll = new BookingGroupBLL();

            lst = bll.GetList();
            if (lst.Count() > 0)
            {
                grdBookingGroup.DataSource = lst;
                grdBookingGroup.DataBind();

                //grdBookingGroup.Columns[4].Visible = true;
            }
            else
            {
                PNK_BookingGroup pnk = new PNK_BookingGroup();
                DataTable        dt  = Common.UtilityLocal.ObjectToData(pnk);
                grdBookingGroup.DataSource = dt;
                grdBookingGroup.DataBind();

                //grdBookingGroup.Columns[4].Visible = false;
                foreach (GridViewRow row in grdBookingGroup.Rows)
                {
                    if (row.RowType == DataControlRowType.DataRow)
                    {
                        LinkButton lb = ((LinkButton)row.FindControl("lnkRemove"));
                        if (lb != null)
                        {
                            lb.Visible = false;
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private void BindBookingGroup()
        {
            BookingGroupBLL          bllBookingGroup = new BookingGroupBLL();
            IList <PNK_BookingGroup> lstBookingGroup = bllBookingGroup.GetList();

            drpTourGroup.DataSource     = lstBookingGroup;
            drpTourGroup.DataTextField  = "Name";
            drpTourGroup.DataValueField = "Name";
            drpTourGroup.DataBind();

            DataTable dtb = DBHelper.ExcuteFromCmd(string.Format("select * from PNK_BookingPrice where ProductId={0} ", productId), null);

            if (dtb != null && dtb.Rows.Count > 0)
            {
                string d = dtb.Rows[0]["GroupType"].ToString();
                drpTourGroup.SelectedValue = drpTourGroup.Items.FindByText(d).Value;
            }
        }