本文整理汇总了C#中SQLDB.getNotes方法的典型用法代码示例。如果您正苦于以下问题:C# SQLDB.getNotes方法的具体用法?C# SQLDB.getNotes怎么用?C# SQLDB.getNotes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SQLDB
的用法示例。
在下文中一共展示了SQLDB.getNotes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if (Session["User"] == null) Response.Redirect("Default.aspx");
this.user = (Person)Session["User"];
SQLDB sql = new SQLDB();
if (Request.QueryString["eid"] != null) employee_id = Convert.ToInt32(Request.QueryString["eid"].ToString());
if (Request.QueryString["rid"] != null) role_id = Convert.ToInt32(Request.QueryString["rid"]);
string employee_fio = sql.getFIO(employee_id);
lbTitle.Text = employee_fio + " " + employee_id;
string html = "<table class='notes-table'>";
List<Note> notes = sql.getNotes(employee_id);
int k = 0;
foreach (Note note in notes)
{
k++;
string role = "";
switch (note.RoleID)
{
case 1:
role = "Табельщик";
break;
case 2:
role = "HR";
break;
case 3:
role = "Бухгалтер";
break;
default:
role = "нет";
break;
}
html += "<tr><td class='notes-field-num'>" + k.ToString() + "</td><td class='notes-field-fio'><div style='width: 200px; overflow: hidden;'>" + sql.getFIO(Convert.ToInt32(user.TabNum)) + "</div></td><td class='notes-field-date-record'>" + note.DateNote.ToString() + "</td></tr><tr><td class='notes-field-num'> </td><td class='notes-field-fio'>Роль: " + role + "</td><td class='notes-field-date-record'>Срок: " + note.DateExpire.ToString("dd.MM.yyyy") + "</td></tr><tr><td class='notes-field-text' colspan='3'><div>" + note.Text + "</div></td></tr>";
}
html += "</table>";
lbNotes.Text = html;
string cbReference = Page.ClientScript.GetCallbackEventReference(this, "arg", "ClientBookmarkCallback", "context");
string func_name = "BookmarkCallback";
string cbScript = "function " + func_name + "(arg, context)" + "{" + cbReference + ";" + "}";
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), func_name, cbScript, true);
}