92 lines
2.7 KiB
C#
92 lines
2.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Data;
|
|
using System.Windows.Forms;
|
|
using System.Data.SqlClient;
|
|
using HelperDB;
|
|
|
|
namespace AIMS.PublicUI.BLL
|
|
{
|
|
public class Person
|
|
{
|
|
public static void Add(Model.Person PersonObj)
|
|
{
|
|
try
|
|
{
|
|
new DAL.PersonDB().Add(PersonObj);
|
|
MessageBox.Show("增加成功!");
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MessageBox.Show("增加失败!" + ex.Message);
|
|
}
|
|
}
|
|
|
|
public static void Update(Model.Person PersonObj)
|
|
{
|
|
try
|
|
{
|
|
new DAL.PersonDB().Update(PersonObj);
|
|
MessageBox.Show("修改成功!");
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MessageBox.Show("修改失败!" + ex.Message);
|
|
}
|
|
}
|
|
|
|
public static Model.Person GetModel(int Id)
|
|
{
|
|
return new DAL.PersonDB().GetModel(Id); ;
|
|
}
|
|
|
|
public static DataTable GetPersonDataTable()
|
|
{
|
|
return new DAL.PersonDB().GetPersonDataTable();
|
|
}
|
|
public static DataTable GetPersonDataTable(string name,string DeptName)
|
|
{
|
|
return new DAL.PersonDB().GetPersonDataTable(name,DeptName);
|
|
}
|
|
public static bool Login(string No, string PassWord)
|
|
{
|
|
return new DAL.PersonDB().Login(No, PassWord);
|
|
}
|
|
public static Model.Person GetModelByNo(string No)
|
|
{
|
|
return new DAL.PersonDB().GetModelByNo(No);
|
|
}
|
|
|
|
|
|
public static DataTable GetPersonDataTableByDepId(int DepId, string HelpCode, string PersonType)
|
|
{
|
|
return new DAL.PersonDB().GetPersonDataTableByDepId(DepId, HelpCode,PersonType);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 查询排班信息
|
|
/// </summary>
|
|
/// <param name="time"> 查询时间</param>
|
|
/// <param name="workerType">工种</param>
|
|
/// <param name="depId">部门Id</param>
|
|
/// <param name="keyName">关键字</param>
|
|
/// <returns></returns>
|
|
public static DataTable GetSchedulingForSelect(DateTime time, string workerType )//int depId,
|
|
{
|
|
try
|
|
{
|
|
string sql = string.Empty;
|
|
sql = "EXEC usp_GetSchedulingForSelect @DateTime = '" + time +
|
|
"', @WorkerType= '" + workerType + "'";//, @DepId= " + depId
|
|
return DBHelper.GetDataTable(sql);
|
|
}
|
|
catch (SqlException ex)
|
|
{
|
|
throw new Exception(ex.Message);
|
|
}
|
|
}
|
|
}
|
|
}
|