public class Temporary
{
//public string Query_NAME { get; set; }
public long Te_TC { get; set; }
public long Te_MC { get; set; }
public long Te_QC { get; set; }
public long Te_WC { get; set; }
public long Te_CC { get; set; }
public long Te_EC { get; set; }
public long Te_PC { get; set; }
}
private DataServiceCollection temporary;
public DataServiceCollection<Temporary> AllTemporary
{
get { return temporary; }
set
{
if (temporary != value)
{
temporary = value;
this.OnPropertyChanged("AllTemporary");
}
}
}
public object QueryInventoryInfo(string areaId)
{
if (string.IsNullOrEmpty(areaId))
{
areaId = "";
}
string locType = "2";
for (int i = 0; i < Areas.Count; i++)
{
Temporary tem = new Temporary();
tem.Te_TC = this.WMSServiceContext.MD_LOCATION.Where(c => c.LOC_TYPE != locType && c.AREA_ID.StartsWith(areaId)).LongCount();
tem.Te_MC = this.WMSServiceContext.MD_LOCATION.Where(c => c.LOC_TYPE != locType && c.AREA_ID.StartsWith(areaId)
&& c.STATUS.Contains("m")).LongCount();
tem.Te_QC = this.WMSServiceContext.MD_LOCATION.Where(c => c.LOC_TYPE != locType && c.AREA_ID.StartsWith(areaId)
&& c.STATUS.Contains("q")).LongCount();
tem.Te_WC = this.WMSServiceContext.MD_LOCATION.Where(c => c.LOC_TYPE != locType && c.AREA_ID.StartsWith(areaId)
&& c.STATUS.Contains("w")).LongCount();
tem.Te_CC = this.WMSServiceContext.MD_LOCATION.Where(c => c.LOC_TYPE != locType && c.AREA_ID.StartsWith(areaId)
&& c.STATUS.Contains("c")).LongCount();
tem.Te_EC = this.WMSServiceContext.MD_LOCATION.Where(c => c.LOC_TYPE != locType && c.AREA_ID.StartsWith(areaId)
&& c.STATUS.Contains("e")).LongCount();
tem.Te_PC = this.WMSServiceContext.MD_LOCATION.Where(c => c.LOC_TYPE != locType && c.AREA_ID.StartsWith(areaId)
&& c.STATUS.Contains("p")).LongCount();
if (tem != null)
{
this.AllTemporary.Add(tem);
//此处报错
}
}
return AllTemporary;
}