本文整理汇总了C#中SQLDB类的典型用法代码示例。如果您正苦于以下问题:C# SQLDB类的具体用法?C# SQLDB怎么用?C# SQLDB使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SQLDB类属于命名空间,在下文中一共展示了SQLDB类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: lnkbtn_calStandard_Click
//查詢標準型態資料
protected void lnkbtn_calStandard_Click(object sender, EventArgs e)
{
string vd = ddlst_Device.SelectedValue;
SQLDB _operator = new SQLDB("VD_STANDARD", "KPT");
DataSet vdStandard = _operator.Select("Vdid = '" + vd + "' AND Vsrdir = '" + ddlst_Vsrdir.SelectedValue + "'", "Vdid , TypeName,Week,Hours", "VD_STANDARD");
RunChart(vdStandard);
}
开发者ID:hiway86,项目名称:PRS_KAO,代码行数:8,代码来源:App_Web_djbxjoer.9.cs
示例2: GridView1_RowUpdating
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
SQLDB db = new SQLDB();
string deviceKind = gv.Rows[e.RowIndex].Cells[1].Text;
TextBox checkcycle;
checkcycle = (TextBox)gv.Rows[e.RowIndex].Cells[2].Controls[0];
if (!IsNumeric(checkcycle.Text))
{
ShowMsg2(UpdatePanel1, "請輸入數字");
return;
}
//檢查更新是否成功
string updatestring = "Update CD_CheckCycle set cycle= '" + checkcycle.Text + "' where Devicekind = '" + deviceKind + "'";
if (db.ExecuteStatement(updatestring))
{
ShowMsg2(UpdatePanel1, "更新成功");
}
else
{
ShowMsg2(UpdatePanel1, "更新失敗");
}
gv.EditIndex = -1;
InitData();
SearchData();
}
开发者ID:hiway86,项目名称:PRS_KAO,代码行数:28,代码来源:App_Web_jkbqqdxf.3.cs
示例3: submit_Click
protected void submit_Click(object sender, EventArgs e)
{
Auth auth = new Auth();
SQLDB db = new SQLDB();
string netname_user = "";
string user = User.Identity.Name.ToUpper();
if (user.Contains("\\"))
netname_user = user.Substring(user.IndexOf('\\') + 1, user.Length - user.IndexOf('\\') - 1);
if (db.isAccessAllowed(netname_user))
{
string netname = Netname.Text.ToUpper();
string login = Login.Text.ToUpper();
string password = Password.Text;
if (netname.Length < 3)
{
MessageBox.Show("Сотрудник не найден!");
return;
}
Employee employee = auth.Authentication(netname, login, password);
if (employee != null)
Response.Redirect("Default.aspx?netname=" + employee.Netname);
else
MessageBox.Show("Сотрудник не найден!");
}
else
{
MessageBox.Show("У вас недостаточно прав доступа для входа!");
}
}
开发者ID:ROLF-IT-Department,项目名称:it-timeboard,代码行数:30,代码来源:CheckEmployees.aspx.cs
示例4: DelMaterial
public bool DelMaterial(string materialid)
{
bool suc = false;
SQLDB _operator = new SQLDB();
string deletestring = "DELETE ICS_Material where NO= '" + materialid + "'";
suc = _operator.ExecuteStatement(deletestring);
return suc;
}
开发者ID:hiway86,项目名称:PRS_KAO,代码行数:8,代码来源:MISWebService.cs
示例5: InitData
protected override void InitData()
{
//BindDropDownListData(ddl_department, (DataSet)Application["App_Systm_Department"], "DepartmentName", "DepartmentID");
SQLDB db = new SQLDB();
DataSet ds = db.Select("", "", "role");
this.gv.DataSource = ds;
this.gv.DataBind();
}
开发者ID:hiway86,项目名称:PRS_KAO,代码行数:8,代码来源:AuthManage.aspx.cs
示例6: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
string html = "";
int month = 0;
int year = 0;
int person_id = 0;
SQLDB sql = new SQLDB();
Date dt = new Date();
MonthDB mdb = new MonthDB();
if (Request.QueryString["month"] != null)
month = Convert.ToInt32(Request.QueryString["month"]);
if (Request.QueryString["year"] != null)
year = Convert.ToInt32(Request.QueryString["year"]);
if (Request.QueryString["id"] != null)
person_id = Convert.ToInt32(Request.QueryString["id"]);
Employee emp = sql.getEmployee(person_id);
lbEmployeeName.Text = emp.FIO;
lbPeriodName.Text = mdb.getMonthName(month).ToUpper() + " " + year.ToString();
string start_period = dt.getDataToSAP(1, month, year);
List<CheckedHours> hours = sql.getCheckedSchedule(start_period, person_id);
if (hours.Count > 0)
{
html = @"<table cellpadding='0' cellspacing='0' class='main_table' width='270px'>
<tr style='background: url(App_Resources/header.bmp) repeat-x;' >
<td class='header_table' width='70px' style='border-left: solid 1px #999999; border-top: solid 1px #999999;' >Дата</td>
<td class='header_table' width='100px' style='border-top: solid 1px #999999;'>IT</td>
<td class='header_table' width='100px' style='border-top: solid 1px #999999;'>SAP</td>
</tr>";
foreach (CheckedHours ch in hours)
{
html += "<tr><td width='70px' style='border-left: solid 1px #999999;'>" + ch.DayDate + "</td><td width='100px'>" + ch.IT_Hours.ToString() + "</td><td width='100px'>" + ch.SAP_Hours.ToString() + "</td><tr>";
}
html += "</table>";
}
else
{
string msg = "";
if (dt.isOpen(month, year))
msg = "Введенный график совпадает с графиком SAP";
else
msg = "Нет данных";
html = "<div class='check_personal' style='width: 270px; height:50px; color: DarkRed;'>" + msg + "</div>";
}
lbTable.Text = html;
}
开发者ID:ROLF-IT-Department,项目名称:it-timeboard,代码行数:56,代码来源:Check.aspx.cs
示例7: DelProject
public bool DelProject(string projectno)
{
bool suc = false;
SQLDB _operator = new SQLDB("ICS_Project");
suc = _operator.Delete("ProjectNO='" + projectno + "'");
//if (suc)
//{
// Application["App_Mis_Company"] = CommonLib.GetCompany();
//}
return suc;
}
开发者ID:hiway86,项目名称:PRS_KAO,代码行数:11,代码来源:MISWebService.cs
示例8: InitData
protected override void InitData()
{
SQLDB _operator = new SQLDB("VD_Info", "KPT");
string query = "select vdid from VD_Info group by vdid";
DataSet ds = _operator.SelectQuery(query);
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
ListItem vditem = new ListItem();
vditem.Value = ds.Tables[0].Rows[i]["vdid"].ToString();
vditem.Text = ds.Tables[0].Rows[i]["vdid"].ToString();
ddlst_Device.Items.Add(vditem);
}
}
开发者ID:hiway86,项目名称:PRS_KAO,代码行数:13,代码来源:App_Web_djbxjoer.7.cs
示例9: SearchData
protected void SearchData()
{
SQLDB db = new SQLDB();
StringBuilder selectquery = new StringBuilder("select * " +
" from View_DeviceConfig v left join ( " +
" select Device_ID,MAX(ChecKDate) ChecKDate " +
" FROM CD_DeviceCheckDate " +
" where checkdate < GETDATE() " +
" group by Device_ID " +
" ) t on v.Device_ID = t.device_ID ");
string conditionName = ddlst_SearchType.SelectedValue;
StringBuilder condition = new StringBuilder();
//若查詢日期則把模糊查詢like改為=
if (conditionName == "ContractStartDate" || conditionName == "ContractEndDate" || conditionName == "CheckDate")
{
if (txt_StartDate.Text.Length > 0 && txt_EndDate.Text.Length > 0)
{
condition.Append(conditionName + "> '" + txt_StartDate.Text + "' AND " + conditionName + "< '" + txt_EndDate.Text + "'");
}
else
{
if (txt_StartDate.Text.Length > 0)
{
condition.Append(conditionName + "> '" + txt_StartDate.Text + "'");
}
if (txt_EndDate.Text.Length > 0)
{
condition.Append(conditionName + "< '" + txt_EndDate.Text + "'");
}
}
}
else
{
condition.Append(txt_Query_Reason.Text.Trim().Length > 0 ? " " + conditionName + " like '%" + txt_Query_Reason.Text.Trim() + "%' " : "");
}
if (condition.Length > 0)
{
selectquery.Append(" WHERE " + condition);
}
DataSet ds = db.SelectQuery(selectquery.ToString());
Session["DS_MIS"] = ds;
gv.DataSource = ds;
gv.DataBind();
if (ds.Tables[0].Rows.Count == 0)
{
ShowMsg2(UpdatePanel1, "查詢無資料");
}
}
开发者ID:hiway86,项目名称:PRS_KAO,代码行数:51,代码来源:App_Web_nswlffpv.21.cs
示例10: GetCallbackResult
// процедура обработки ajax вызова - формирование списка сотрудников
public string GetCallbackResult()
{
string argum = eventArgument;
string date = argum.Substring(0, 10);
string text = argum.Substring(10);
DateTime dt = DateTime.Parse(date);
SQLDB sql = new SQLDB();
sql.insertNotes(employee_id, text, Convert.ToInt32(user.TabNum), role_id, dt);
string url = "Bookmark.aspx?eid=" + employee_id.ToString() + "&rid=" + role_id.ToString();
return url;
}
开发者ID:ROLF-IT-Department,项目名称:timeboard,代码行数:16,代码来源:Bookmark.aspx.cs
示例11: SearchData
protected void SearchData()
{
SQLDB _operator = new SQLDB("DeviceKind");
string conditionName = ddlst_SearchType.SelectedValue;
string condition = (txt_Query_Reason.Text.Trim().Length > 0 ? " " + conditionName + " like '%" + txt_Query_Reason.Text.Trim() + "%' " : "");
//condition += query_company;
DataSet ds = _operator.Select(condition);
Session["DS_MIS"] = ds;
gv.DataSource = ds;
gv.DataBind();
if (ds.Tables[0].Rows.Count == 0)
{
ShowMsg2(UpdatePanel1, "查詢無資料");
}
}
开发者ID:hiway86,项目名称:PRS_KAO,代码行数:15,代码来源:KindsOfEquipmentList.aspx.cs
示例12: LoadData
private bool LoadData()
{
bool suc = false;
SQLDB db = new SQLDB("CD_MaterialOfDevice");
DataSet ds = new DataSet();
ds = db.Select("Device_ID = '"+hidden_DeviceID.Value+"'","","CD_MaterialOfDevice");
if (ds.Tables[0].Rows.Count > 0)
{
suc = true;
gv_Material.DataSource = ds;
gv_Material.DataBind();
Session["MIS_Material"] = ds;
}
return suc;
}
开发者ID:hiway86,项目名称:PRS_KAO,代码行数:15,代码来源:MatrialOfDevceManage.aspx.cs
示例13: 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);
}
开发者ID:ROLF-IT-Department,项目名称:timeboard,代码行数:48,代码来源:Bookmark.aspx.cs
示例14: File_Upload
protected void File_Upload(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e)
{
string filename = e.FileName;
string strDestPath = Server.MapPath("../Temp/");
//將資料存到網站
AjaxFileUpload1.SaveAs(@strDestPath + filename);
//將資料存到DB
SQLDB _operator = new SQLDB();
DataSet ds = _operator.Select("1=0", "", "StudyFileUpload");
DataRow dr = ds.Tables[0].NewRow();
dr["FileName"] = filename;
dr["UpdateTime"] = DateTime.Now;
ds.Tables[0].Rows.Add(dr);
DataSet DSChange = ds.GetChanges();
_operator.Insert(DSChange);
}
开发者ID:hiway86,项目名称:PRS_KAO,代码行数:17,代码来源:StudyFileUpload_A.aspx.cs
示例15: SearchData
protected void SearchData()
{
gv.DataSource = null;
gv.DataBind();
SQLDB db = new SQLDB();
StringBuilder query = new StringBuilder(" select * from ");
query.Append(" (SELECT DeviceID,COUNT(*) as counts ");
query.Append(" FROM WarrantyNotify ");
string conditionName = ddlst_SearchType.SelectedValue;
if (txt_startDateTime.Text.Length > 0 || txt_endDateTime.Text.Length > 0)
{
query.Append(" WHERE ");
if (txt_startDateTime.Text.Length > 0 && txt_endDateTime.Text.Length > 0)
{
query.Append(" NotifyDate >= '" + txt_startDateTime.Text + "' and NotifyDate <= '" + txt_endDateTime.Text + "' ");
}
else if (txt_startDateTime.Text.Length > 0)
{
query.Append(" NotifyDate >= '" + txt_startDateTime.Text + "' ");
}
else if (txt_endDateTime.Text.Length > 0)
{
query.Append(" NotifyDate <= '" + txt_endDateTime.Text + "' ");
}
}
query.Append(" GROUP BY deviceid) w left join View_DeviceConfig d on w.deviceid = d.Device_ID ");
if (txt_Query_Reason.Text.Trim().Length > 0)
{
query.Append(" where "+conditionName + " like '%" + txt_Query_Reason.Text.Trim() + "%' ");
}
query.Append("order by counts desc");
DataSet ds = db.SelectQuery(query.ToString());
//Session["DS_MIS"] = ds;
gv.DataSource = ds;
gv.DataBind();
if (ds.Tables[0].Rows.Count == 0)
{
ShowMsg2(UpdatePanel1, "查詢無資料");
}
}
开发者ID:hiway86,项目名称:PRS_KAO,代码行数:45,代码来源:App_Web_adghwhjp.1.cs
示例16: SearchData
protected void SearchData()
{
//string query_company = GetCompanyScope();
StringBuilder query = new StringBuilder("select * from ICS_Material m left join ICS_Material_Type mt on m.MaterialTypeID = mt.MaterialTypeID left join ICS_Stock_QuantityNow sq on m.NO = sq.MaterialID");
SQLDB _operator = new SQLDB();
if (txt_Query_Reason.Text.Trim().Length > 0)
{
query.Append(" WHERE " + ddlst_SearchType.SelectedValue + " like '%" + txt_Query_Reason.Text.Trim() + "%'");
}
DataSet ds = _operator.SelectQuery(query.ToString());
Session["DS_MIS"] = ds;
gv.DataSource = ds;
gv.DataBind();
if (ds.Tables[0].Rows.Count == 0)
{
ShowMsg2(UpdatePanel1, "查詢無資料");
}
}
开发者ID:hiway86,项目名称:PRS_KAO,代码行数:19,代码来源:App_Web_0jpjlz4f.9.cs
示例17: SearchData
protected void SearchData()
{
gv.DataSource = null;
gv.DataBind();
SQLDB db = new SQLDB();
StringBuilder query = new StringBuilder(" SELECT WarrantyCompany,CONVERT(float, AVG(datediff(MINUTE,NotifyDate,RepairDate)))/1440 as avgtime FROM WarrantyNotify ");
query.Append(" where NotifyDate is not null and RepairDate is not null and datediff(MINUTE,NotifyDate,RepairDate)> 0 ");
string conditionName = ddlst_SearchType.SelectedValue;
StringBuilder condition = new StringBuilder();
bool isquery = false;
if (txt_Query_Reason.Text.Trim().Length > 0)
{
condition.Append( conditionName + " like '%" + txt_Query_Reason.Text.Trim() + "%' and");
isquery = true;
}
if (txt_startDateTime.Text.Length > 0)
{
condition.Append(" NotifyDate >= '" + txt_startDateTime.Text + "' and");
isquery = true;
}
if (txt_endDateTime.Text.Length > 0)
{
condition.Append(" NotifyDate <= '" + txt_endDateTime.Text + "' and");
isquery = true;
}
if (isquery)
{
query.Append(" and "+ condition.ToString().Substring(0, condition.ToString().Length - 3));
}
query.Append(" GROUP BY WarrantyCompany order by avgtime desc");
DataSet ds = db.SelectQuery(query.ToString());
//Session["DS_MIS"] = ds;
gv.DataSource = ds;
gv.DataBind();
if (ds.Tables[0].Rows.Count == 0)
{
ShowMsg2(UpdatePanel1, "查詢無資料");
}
}
开发者ID:hiway86,项目名称:PRS_KAO,代码行数:43,代码来源:RepairEfficiency_Q.aspx.cs
示例18: LoadData
private bool LoadData()
{
txt_MaterialName.Enabled = false;
SQLDB _operator = new SQLDB("ICS_Material");
bool suc = false;
string query = "select * from ICS_Material m left join ICS_Material_Type mt on m.MaterialTypeID = mt.MaterialTypeID where NO = '" + hidden_Materialid.Value + "'";
DataSet ds2 = _operator.SelectQuery(query);
if (ds2.Tables[0].Rows.Count == 1)
{
suc = true;
DataTable dt = ds2.Tables[0];
DataRow dr = dt.Rows[0];
txt_MaterialName.Text = dr["MaterialName"].ToString();
cbo_materialType.SelectedValue = dr["MaterialTypeID"].ToString();
txt_MaterialSafeQuantity.Text = dr["MaterialSafeQuantity"].ToString();
txt_MaterialUnit.Text = dr["MaterialUnit"].ToString();
}
return suc;
}
开发者ID:hiway86,项目名称:PRS_KAO,代码行数:19,代码来源:Inventoryadd_A.aspx.cs
示例19: SearchData
protected void SearchData()
{
gv.DataSource = null;
gv.DataBind();
SQLDB db = new SQLDB();
StringBuilder query = new StringBuilder(" select * ");
query.Append(" from View_ICS_InventoryCost ");
string conditionName = ddlst_SearchType.SelectedValue;
StringBuilder condition = new StringBuilder();
bool isquery = false;
if (txt_Query_Reason.Text.Trim().Length > 0)
{
condition.Append(conditionName + " like '%" + txt_Query_Reason.Text.Trim() + "%' and");
isquery = true;
}
if (txt_startDateTime.Text.Length > 0)
{
condition.Append(" si.UpdateTime >= '" + txt_startDateTime.Text + "' and");
isquery = true;
}
if (txt_endDateTime.Text.Length > 0)
{
condition.Append(" si.UpdateTime <= '" + txt_endDateTime.Text + "' and");
isquery = true;
}
if (isquery)
{
query.Append(" WHERE " + condition.ToString().Substring(0, condition.ToString().Length - 3));
}
DataSet ds = db.SelectQuery(query.ToString());
//Session["DS_MIS"] = ds;
gv.DataSource = ds;
gv.DataBind();
if (ds.Tables[0].Rows.Count == 0)
{
ShowMsg2(UpdatePanel1, "查詢無資料");
}
}
开发者ID:hiway86,项目名称:PRS_KAO,代码行数:42,代码来源:InventoryCost_Q.aspx.cs
示例20: LoadData
//修改模式載入資料
private bool LoadData()
{
bool suc = false;
SQLDB _operator = new SQLDB();
if (hidden_Caseid.Value != null )
{
DataSet ds = new DataSet();
ds = _operator.Select("caseid = '" + hidden_Caseid.Value + "'", "", "WarrantyNotify");
if (ds.Tables[0].Rows.Count > 0)
{
suc = true;
DataRow dr = ds.Tables[0].Rows[0];
DropDownList_DeviceID.SelectedValue = dr["DeviceID"].ToString();
TextBox_DeviceID_add.Text = dr["DeviceID"].ToString();
//找出保固廠商的廠商編號,因為資料庫只有紀錄廠商名稱
if (dr["WarrantyCompany"].ToString().Length > 0)
{
DataSet ds_company = (DataSet)Application["App_Mis_Company"];
DataRow[] dr_company = ds_company.Tables[0].Select("CompanyName = '" + dr["WarrantyCompany"].ToString() + "'");
DropDownList_WarrantyCompany_add.SelectedValue = dr_company[0]["CompanyID"].ToString();
}
DropDownList_WarrantyContract_add.SelectedValue = dr["WarrantyContract"].ToString();
DropDownList_FaultModel_add.SelectedValue = dr["FaultModel"].ToString();
TextBox_FaultDescribe_add.Text = dr["FaultDescribe"].ToString();
DropDownList_ContractCombineNum.SelectedValue = dr["ContractCombineNum"].ToString();
if (dr["NotifyDate"].ToString().Length > 0)
TextBox_NotifyDate_add.Text = Convert.ToDateTime(dr["NotifyDate"].ToString()).ToString("yyyy-MM-dd HH:mm:ss");
if (dr["RepairDeadline"].ToString().Length > 0)
{
TextBox_RepairDeadline_add.Text = Convert.ToDateTime(dr["RepairDeadline"].ToString()).ToString("yyyy-MM-dd HH:mm:ss");
}
DropDownList_RepairDateOption_add.SelectedValue = dr["RepairDateOption"].ToString();
//併案編號
DropDownList_ContractCombineNum.SelectedValue = dr["ContractCombineNum"].ToString();
//重複通知說明
TextBox_RepeatNotify_add.Text = dr["RepeatNotify"].ToString();
}
}
return suc;
}
开发者ID:hiway86,项目名称:PRS_KAO,代码行数:43,代码来源:App_Web_yxas322n.3.cs
注:本文中的SQLDB类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论