///
///INTERFACE CLASS FOR TABLE t_wmslocation
///By wm with codesmith.
///on 05/02/2017
///
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using DeiNiu.Utils;
namespace DeiNiu.wms.Data.Model
{
[Serializable]
public class Wmslocation : WmsLocation_base
{
public Wmslocation()
{
}
public Wmslocation(SqlConnection _Conn):base(_Conn)
{
}
public Wmslocation(int id): base(id)
{
}
public Wmslocation(DataRow dr): base(dr)
{
}
public Wmslocation(String locationId)
{
cmdParameters[0] = locationId;
getModel(10);
}
public new int Add()
{
base.Add();
this.locationId128 = Util.getCode128(locationId + "");
Update();
return ID;
}
protected override void getImp()
{
model_imp = new Wmslocation_Imp();
}
//begin cust db operation, query, excute sql etc.
//public override DataSet Query()
//{
// return CustQuery(100);
//}
///
/// 清除空货位
///
///
public int freeLocations()
{
return CustOper(400);
}
///
/// get location info by locId
///
///
public DataTable getLocations(string locId)
{
cmdParameters[0] = locId;
return CustQuery(500).Tables[0];
}
public bool updateLocationStatus(string IDS, int status, int operId)
{
cmdParameters[0] = IDS;
cmdParameters[1] = status;
cmdParameters[2] = operId;
return CustOper(620) > 0;
}
public bool updateLocationLabelId(string IDs, LocStructs locs, int operId)
{
cmdParameters[0] = IDs;
cmdParameters[1] = locs.elabId;
cmdParameters[2] = operId;
return CustOper(640) > 0;
}
public int deleteLocations(string IDs)
{
cmdParameters[0] = IDs;
return CustOper(650) ;
}
///
/// query location percent data
///
///
public DataTable getLocationsUsedPercent()
{
return CustQuery(670).Tables[0];
}
internal bool updateLocationOwnerCode(string IDs, LocStructs locs, int operId)
{
cmdParameters[0] = IDs;
cmdParameters[1] = locs.ownerCode;
cmdParameters[2] = operId;
return CustOper(680) > 0;
}
}
}