/*************************************************************************** * * 功能: 持久层基类 * 作者: Siasun * 日期: 2013/4/11 * * 修改日期: * 修改人: * 修改内容: * * *************************************************************************/ namespace SiaSun.LMS.Persistence { using System; using System.Collections; using System.Collections.Generic; using IBatisNet.Common; using IBatisNet.DataMapper; using IBatisNet.Common.Exceptions; using SiaSun.LMS.Model; /// /// WH_CELL /// public class P_WH_CELL : P_Base_House { public P_WH_CELL () { // // TODO: 此处添加WH_CELL的构造函数 // } /// /// 得到列表 /// public IList GetList() { return ExecuteQueryForList("WH_CELL_SELECT",null); } /// /// 新建 /// public int Add(WH_CELL wh_cell) { //int id = this.GetPrimaryID("WH_CELL","WH_CELL_ID"); //wh_cell.CELL_ID = id; return ExecuteInsert("WH_CELL_INSERT",wh_cell); } /// /// 修改 /// public int Update(WH_CELL wh_cell) { return ExecuteUpdate("WH_CELL_UPDATE",wh_cell); } /// /// 得到明细 /// /// /// public WH_CELL GetModel(System.Int32 CELL_ID) { return ExecuteQueryForObject("WH_CELL_SELECT_BY_ID",CELL_ID); } /// /// 得到明细 /// /// /// public WH_CELL GetModel(int AREA_ID,string CELL_CODE) { Hashtable ht = new Hashtable(); ht.Add("AREA_ID", AREA_ID); ht.Add("CELL_CODE", CELL_CODE); return this.ExecuteQueryForObject("WH_CELL_SELECT_BY_AREA_ID_CELL_CODE", ht); } public WH_CELL GetModel(string CELL_CODE) { return this.ExecuteQueryForObject("WH_CELL_SELECT_BY_CELL_CODE", CELL_CODE); } /// /// 删除 /// /// public int Delete(System.Int32 CELL_ID) { return ExecuteDelete("WH_CELL_DELETE",CELL_ID); } public IList CELL_GetList_Z(int WAREHOUSE_ID,string CELL_Z) { Hashtable ht = new Hashtable(); ht.Add("WAREHOUSE_ID", WAREHOUSE_ID); ht.Add("CELL_Z", CELL_Z); return ExecuteQueryForList("WH_CELL_SELECT_BY_WAREHOUSE_ID_CELL_Z", ht); } public IList CELL_GetList(string AREA_ID, string CELL_Z) { Hashtable ht = new Hashtable(); ht.Add("AREA_ID", AREA_ID); ht.Add("CELL_Z", CELL_Z); return ExecuteQueryForList("WH_CELL_SELECT_BY_AREA_ID_CELL_Z", ht); } public int CellInAllocate(string START_DEVICE_CODE, string CELL_MODEL, int MANAGE_ID, int FORK_COUNT, out string sResult) { try { sResult = string.Empty; Hashtable ht = new Hashtable(); ht.Add("STARTDEVICECODE", START_DEVICE_CODE); ht.Add("CELLMODE", CELL_MODEL); ht.Add("MANAGEID", MANAGE_ID); ht.Add("FORKCOUNT", FORK_COUNT); ht.Add("ENDCELLID", 0); ht.Add("RESULTMESSAGE", string.Empty); _sqlMap.QueryForList("CellInAllocate", ht); sResult = ht["RESULTMESSAGE"].ToString(); return ht["ENDCELLID"] == null ? 0 : (int)ht["ENDCELLID"]; } catch (Exception e) { throw (e); } } } }