当前位置: 首页>>代码示例>>C#>>正文


C# DBFunctions.gethostellist方法代码示例

本文整理汇总了C#中DBFunctions.gethostellist方法的典型用法代码示例。如果您正苦于以下问题:C# DBFunctions.gethostellist方法的具体用法?C# DBFunctions.gethostellist怎么用?C# DBFunctions.gethostellist使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DBFunctions的用法示例。


在下文中一共展示了DBFunctions.gethostellist方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        string action = Request.QueryString["action"];
        id = int.Parse(Request.QueryString["Roomid"]);
        if (!IsPostBack)
        {
            DBFunctions db = new DBFunctions();
            if (action == "update")
            {
                HostelRoom_tbl room = db.getRoom(id);
                price.Text = room.Price.ToString();
                capacity.Text = room.Capacity.ToString();
                description.Text = room.RoomDescription;

                DropDownHostel.DataSource = db.gethostellist();

                DropDownHostel.DataTextField = "Name";
                DropDownHostel.DataValueField = "ID";
                DropDownHostel.DataBind();

            }
            else
            {

            }
        }

    }
开发者ID:EezeSolutions,项目名称:Higher_Erp,代码行数:28,代码来源:updateRoom.aspx.cs

示例2: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        string action = Request.QueryString["action"];
        id = int.Parse(Request.QueryString["Wardenid"]);
        if (!IsPostBack)
        {
            DBFunctions db = new DBFunctions();
            if (action == "update")
            {
                HostelWarden_tbl wrd = db.getWarden(id);
                wardenname.Text = wrd.Name;
               
                wardenphone.Text = wrd.Phone;
                email.Text = wrd.Email;
                
                DropDownHostel.DataSource = db.gethostellist();
                
                DropDownHostel.DataTextField = "Name";
                DropDownHostel.DataValueField = "ID";
                DropDownHostel.DataBind();



            }
            else
            {

            }
        }

    }
开发者ID:EezeSolutions,项目名称:Higher_Erp,代码行数:31,代码来源:updateWarden.aspx.cs

示例3: Page_Load


//.........这里部分代码省略.........
                    literalEnd.Text = pageEnd.ToString();
                }

            }
            else
            {
                if (pageEnd == 0)
                {
                    literalStart.Text = "";
                }
                literalTotal.Text = pageEnd.ToString();
                literalEnd.Text = pageEnd.ToString();
            }


            string tmpUrl = string.Empty;
            tmpUrl = "AddWarden.aspx?" + Request.QueryString.ToString();
            if (tmpUrl.Contains("?page"))
            {
                tmpUrl = tmpUrl.Remove(tmpUrl.IndexOf("?page"));
            }

            StringBuilder listingString = new StringBuilder();

            if (ds != null)
            {
                loadRooms(ds);
            }


            if (pageEnd > 10)
            {
                StringBuilder paging = new StringBuilder();
                int counterPage = 1;
                int totalPages = 1;

                totalPages = (pageEnd / 10) + 1;
                string urlMain = string.Empty;
                urlMain = Request.Url.ToString();
                if (urlMain.Contains("?page"))
                {
                    urlMain = urlMain.Remove(urlMain.IndexOf("?page"));
                }

                for (int i = 1; i <= totalPages; i++)
                {
                    string newPageString = string.Empty;


                    if (i == 1)
                    {

                        newPageString = "<li><a aria-label=\"First\"  href=\"" + urlMain + "\" >&lt;&lt;</a></li>";
                        if (page == i)
                        {
                            newPageString += "<li><a style=\"color:#000000;background: #f0f0f0;\" href=\"" + urlMain + "?page=" + i + "\" >" + i + "</a></li>";
                        }
                        else
                        {
                            newPageString += "<li><a href=\"" + urlMain + "?page=" + i + "\" >" + i + "</a></li>";
                        }

                    }
                    else if (i == totalPages)
                    {
                        if (page == i)
                        {
                            newPageString += "<li><a style=\"color:#000000;background: #f0f0f0;\" href=\"" + urlMain + "?page=" + i + "\" >" + i + "</a></li>";
                        }
                        else
                        {
                            newPageString += "<li><a  href=\"" + urlMain + "?page=" + i + "\" >" + i + "</a></li>";
                        }
                        newPageString += "<li><a aria-label=\"Last\" href=\"" + urlMain + "?page=" + totalPages + "\" >&gt;&gt;</a></li>";
                    }
                    else
                    {
                        if (page == i)
                        {
                            newPageString += "<li><a style=\"color:#000000;background: #f0f0f0;\" href=\"" + urlMain + "?page=" + i + "\" >" + i + "</a></li>";
                        }
                        else
                        {
                            newPageString += "<li><a href=\"" + urlMain + "?page=" + i + "\" >" + i + "</a></li>";
                        }
                    }
                    counterPage++;
                    paging.Append(newPageString);
                }

                literalPaging.Text = paging.ToString();
            }
                DropDownHostel.DataSource = db.gethostellist();
                DropDownHostel.DataTextField = "Name";
                DropDownHostel.DataValueField = "ID";
                DropDownHostel.DataBind();
                
            
        }
    }
开发者ID:EezeSolutions,项目名称:Higher_Erp,代码行数:101,代码来源:RoomsList.aspx.cs


注:本文中的DBFunctions.gethostellist方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。