dutydao.cs

来自「值班管理系统源码 net2005+sqlserver2005 ,三层模式」· CS 代码 · 共 49 行

CS
49
字号
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

/// <summary>
/// DutyDao 的摘要说明
/// </summary>
public class DutyDao
{
	public DutyDao()
	{
		//
		// TODO: 在此处添加构造函数逻辑
		//
	}

    public static DataSet dsDuty()
    {
        string sql = "select a.id,a.L_ZBB_dateBegin,a.L_ZBB_dateEnd,a.L_ZBB_BZ,b.L_KS_KSMC,c.L_user_name from LHB_Office_ZBB a ,LHB_Office_ZBB_KS b,LHB_Office_ZBB_USER c where a.L_ZBB_KS = b.id and a.L_ZBB_nameId=c.id";
        return ShareCommon.dsBySql(sql);
    }

    public static void insertDuty(DutyPO dp)
    {
        string sql = "insert into LHB_Office_ZBB (L_ZBB_KS,L_ZBB_nameId,L_ZBB_dateBegin,L_ZBB_dateEnd,L_ZBB_BZ) values("+dp.DepartId+","+dp.StaffId+",'"+dp.DutyDateBegin+"','"+dp.DutyDateEnd+"','"+dp.DutyComment+"')";
        ShareCommon.executeNonQuery(sql);

    }
    public static DataSet dsDuty(DateTime  date)
    {
        string sql = "select a.id,a.L_ZBB_dateBegin,a.L_ZBB_dateEnd,a.L_ZBB_BZ,b.L_KS_KSMC,c.L_user_name from LHB_Office_ZBB a ,LHB_Office_ZBB_KS b,LHB_Office_ZBB_USER c where a.L_ZBB_KS = b.id and a.L_ZBB_nameId=c.id and '" + date + "' between L_ZBB_dateBegin and L_ZBB_dateEnd";
        return ShareCommon.dsBySql(sql);
    }

    public static DataSet dsDuty(DateTime date1,DateTime date2)
    {
        string sql = "select a.id,a.L_ZBB_dateBegin,a.L_ZBB_dateEnd,a.L_ZBB_BZ,b.L_KS_KSMC,c.L_user_name from LHB_Office_ZBB a ,LHB_Office_ZBB_KS b,LHB_Office_ZBB_USER c where a.L_ZBB_KS = b.id and a.L_ZBB_nameId=c.id and L_ZBB_dateBegin >='" + date1 + "' and L_ZBB_dateEnd<='"+date2.AddDays(1)+"'";
        return ShareCommon.dsBySql(sql);
    }


}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?