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


C# SQLDB类代码示例

本文整理汇总了C#中SQLDB的典型用法代码示例。如果您正苦于以下问题:C# SQLDB类的具体用法?C# SQLDB怎么用?C# SQLDB使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SQLDB类属于命名空间,在下文中一共展示了SQLDB类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 + "&nbsp;&nbsp;" + 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'>&nbsp;</td><td class='notes-field-fio'>Роль:&nbsp;" + role + "</td><td class='notes-field-date-record'>Срок:&nbsp;" + 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


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