示例#1
0
        protected void GetMappedRoomTypes()
        {
            Accomodation_ID = new Guid(Request.QueryString["Hotel_Id"]);


            var myMaps = new List <DC_Accomodation_SupplierRoomTypeMapping>();

            myMaps = AccSvc.GetAccomodation_RoomTypeMapping(0, 10, Accomodation_ID, Guid.Empty);

            // this code is just there to generate UI for design purposes and ideally should be optimised by someone smarter than me
            if (myMaps != null)
            {
                ddlSelectBaseSupplier.DataSource = (from r in myMaps select new { r.Supplier_Id, r.SupplierName }).Distinct().ToList();
                ddlSelectBaseSupplier.DataBind();

                ddlSelectSupplier.DataSource = ddlSelectBaseSupplier.DataSource;
                ddlSelectSupplier.DataBind();
            }


            grdExistingMaps.DataSource = myMaps;
            grdExistingMaps.DataBind();

            grdUnMappedSupplierRooms.DataSource = myMaps;
            grdUnMappedSupplierRooms.DataBind();
        }