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); } /// /// 查询排班信息 /// /// 查询时间 /// 工种 /// 部门Id /// 关键字 /// 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); } } } }