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


C# DBManager.queryTable方法代码示例

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


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

示例1: GridView2_RowDataBound

    protected void GridView2_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            if (e.Row.Cells[5].Text == "0")
            {
                e.Row.Cells[5].Text = "Cash/Cheque";
                e.Row.Cells[6].Text = e.Row.Cells[6].Text == "1" ? "Paid" : "Unpaid";

                if (e.Row.Cells[6].Text == "Unpaid" && lblClassStatus.Text != "Cancelled")
                {
                    ((Button)e.Row.Cells[7].FindControl("btnPayment")).Visible = true;
                }
            }
            else
            {
                try
                {
                    DBManager manager = new DBManager("table");
                    manager.AddParameter(int.Parse(lblID.Text));
                    DataTable table = manager.queryTable(
                        @"select 'Credit/ATTID:' + convert(varchar, reg.intIdAttendance) + ' CID:' + convert(varchar,ClassSchedule.intIdClassSchedule) + ' (' + convert(varchar, s.strNameSubject) + ' ' + convert(varchar, l.strNameLevel) + ')' from MakeupAttendance
                        inner join Attendance ot on ot.intIdAttendance = MakeupAttendance.intIdAttendanceOnetimeMakeupAttendance
                        inner join Attendance reg on reg.intIdAttendance = MakeupAttendance.intIdAttendanceRegularMakeupAttendance
                        inner join ClassSchedule on ClassSchedule.intIdClassSchedule = reg.intIdClassAttendance
                        inner join [Subject] s on s.intIdSubject = ClassSchedule.intIdSubjectClassSchedule
                        inner join [Level] l on l.intIdLevel = ClassSchedule.intIdLevelClassSchedule
                        where ot.intIdClassAttendance = @p0 ");

                    if (table.Rows.Count > 0)
                        e.Row.Cells[5].Text = table.Rows[0][0].ToString();
                    else
                        e.Row.Cells[5].Text = "Undetected";
                }
                catch (Exception ex)
                {
                    e.Row.Cells[5].Text = "Undetected";
                }

                e.Row.Cells[6].Text = "Paid";
            }
        }
    }
开发者ID:khtutz,项目名称:anet4jkhz,代码行数:43,代码来源:IntensiveClassReport.aspx.cs

示例2: GridView1_RowDataBound

    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            if (e.Row.Cells[9].Text == "1")
            {
                e.Row.Cells[9].Text = "Cancelled";
                e.Row.Cells[10].FindControl("btnCancel").Visible = false;
            }
            else
                e.Row.Cells[9].Text = "Running";

            Label l = ((Label)e.Row.Cells[10].FindControl("lblCount"));
            try
            {
                DBManager manager = new DBManager("Table");
                manager.AddParameter(int.Parse(e.Row.Cells[0].Text));
                l.Text =
                    manager.queryTable(
                    "select COUNT(*) from ASP_IntensiveClassContainer where intIntensiveClassID = @p0")
                    .Rows[0][0].ToString();

            }
            catch (Exception ex)
            {
                l.Text = "Undetected";
            }

            if (e.Row.Cells[9].Text == "Cancelled")
            {
                e.Row.BackColor = System.Drawing.Color.DarkBlue;
                e.Row.ForeColor = System.Drawing.Color.White;
            }
            else
                if (l.Text == "Undetected")
                {
                    e.Row.BackColor = System.Drawing.Color.Red;
                    e.Row.ForeColor = System.Drawing.Color.White;
                }
                else if (int.Parse(l.Text) >= int.Parse(e.Row.Cells[8].Text))
                {
                    e.Row.BackColor = System.Drawing.Color.Gold;
                    e.Row.ForeColor = System.Drawing.Color.Brown;
                }
                else if (int.Parse(l.Text) < int.Parse(e.Row.Cells[7].Text))
                {
                    e.Row.BackColor = System.Drawing.Color.Tomato;
                    e.Row.ForeColor = System.Drawing.Color.White;
                }
        }
    }
开发者ID:khtutz,项目名称:anet4jkhz,代码行数:51,代码来源:IntensiveClassReport.aspx.cs


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