首页 新闻 会员 周边 捐助

我是缺少引用什么了吗

0
[已解决问题] 解决于 2017-01-10 14:23

错误提示: 当前上下文中不存在名称“SvcUtils”

我想问一下SvcUtils

//条码名字
private static List<HisFeeDto> fees;
private static Dictionary<string, HisDrugDto> dicDrug;
private static Dictionary<string, HisFeeDto> dicFee;
private static Dictionary<string, HisUndrugDto> dicUndrug;
private static Dictionary<string, UserDto> dicUser;
private static object drugLock = new object();
private static List<HisDrugDto> drugs;
private static object feeLock = new object();
private static List<HisUndrugDto> undrugs;
private static List<UserDto> users;

private static object userLock = new object();
private static object undrugLock = new object();
private static Dictionary<int, HisItemDto> dicHisItem;
private static List<HisItemDto> hisItems;


private static object hisItemLock = new object();

public static Dictionary<string, UserDto> UserDic
{
get
{
lock (userLock)
{
if (dicUser != null)
return dicUser;
if (users == null)
{
users = SvcUtils.GetSyncDataWithUpdate<UserDto>("hds_user");
}
dicUser = new Dictionary<string, UserDto>();
users.ForEach(u =>
{
if (!dicUser.ContainsKey(u.EmployeeID))
{
dicUser.Add(u.EmployeeID, u);
}
});
return dicUser;
}
}
}
public static Dictionary<int, HisItemDto> HisItemDic
{
get
{
lock (hisItemLock)
{
if (dicHisItem != null)
return dicHisItem;
if (hisItems == null)
{
hisItems = SvcUtils.GetSyncDataWithUpdate<HisItemDto>("hds_his_item");
}
dicHisItem = new Dictionary<int, HisItemDto>();
hisItems.ForEach(i =>
{
if (!dicHisItem.ContainsKey(i.HisItemID))
{
dicHisItem.Add(i.HisItemID, i);
}
});
return dicHisItem;
}
}
}


public static IList<HisDrugDto> Drugs
{
get
{
lock (drugLock)
{
if (drugs != null)
return drugs;
drugs = SvcUtils.GetSyncDataWithUpdate<HisDrugDto>("hds_drug");
return drugs;
}
}
}

public static Dictionary<string, HisDrugDto> DrugDic
{
get
{
lock (drugLock)
{
if (dicDrug != null)
return dicDrug;
if (drugs == null)
{
drugs = SvcUtils.GetSyncDataWithUpdate<HisDrugDto>("hds_drug");
}
dicDrug = new Dictionary<string, HisDrugDto>();
drugs.ForEach(d =>
{
if (!dicDrug.ContainsKey(d.DrugTermID))
{
dicDrug.Add(d.DrugTermID, d);
}
});
return dicDrug;
}
}
}

public static IList<HisUndrugDto> Undrugs
{
get
{
lock (undrugLock)
{
if (undrugs != null)
return undrugs;
undrugs = SvcUtils.GetSyncDataWithUpdate<HisUndrugDto>("hds_undrug");
return undrugs;
}
}
}

public static Dictionary<string, HisUndrugDto> UndrugDic
{
get
{
lock (undrugLock)
{
if (dicUndrug != null)
return dicUndrug;
if (undrugs == null)
{
undrugs = SvcUtils.GetSyncDataWithUpdate<HisUndrugDto>("hds_undrug");
}
dicUndrug = new Dictionary<string, HisUndrugDto>();
undrugs.ForEach(u =>
{
if (!dicUndrug.ContainsKey(u.TermID))
{
dicUndrug.Add(u.TermID, u);
}
});
return dicUndrug;
}
}
}

public static IList<HisFeeDto> Fees
{
get
{
lock (feeLock)
{
if (fees != null)
return fees;
fees = SvcUtils.GetSyncDataWithUpdate<HisFeeDto>("hds_fee");
return fees;
}
}
}

public static Dictionary<string, HisFeeDto> FeeDic
{
get
{
lock (feeLock)
{
if (dicFee != null)
return dicFee;
if (fees == null)
{
fees = SvcUtils.GetSyncDataWithUpdate<HisFeeDto>("hds_fee");
}
dicFee = new Dictionary<string, HisFeeDto>();
fees.ForEach(u =>
{
if (!dicFee.ContainsKey(u.ItemCode))
{
dicFee.Add(u.ItemCode, u);
}
});
return dicFee;
}
}
}

public static string GetHisItemName(HisItemDto hisItem)
{
switch (hisItem.ItemType)
{
case ItemTypeEnum.Drug:
if (DrugDic.ContainsKey(hisItem.ReferenceKey))
{
//return string.Format("[{0}]{1}", DrugDic[hisItem.ReferenceKey].DrugTermID, DrugDic[hisItem.ReferenceKey].TradeName);
return DrugDic[hisItem.ReferenceKey].TradeName;
}
else
{
return string.Empty;
}
case ItemTypeEnum.Undrug:
if (UndrugDic.ContainsKey(hisItem.ReferenceKey))
{
//return string.Format("[{0}]{1}", UndrugDic[hisItem.ReferenceKey].TermID, UndrugDic[hisItem.ReferenceKey].TermName);
return UndrugDic[hisItem.ReferenceKey].TermName;
}
else
{
return string.Empty;
}
case ItemTypeEnum.Fee:
if (FeeDic.ContainsKey(hisItem.ReferenceKey))
{
//return string.Format("[{0}]{1}", FeeDic[hisItem.ReferenceKey].ItemCode, FeeDic[hisItem.ReferenceKey].ItemName);
return FeeDic[hisItem.ReferenceKey].ItemName;
}
else
{
return string.Empty;
}
default:
return string.Empty;
}
}

 


}
}

糯米好吃的主页 糯米好吃 | 初学一级 | 园豆:64
提问于:2016-12-29 10:13
< >
分享
最佳答案
0

加我qq:2375287790,我在线帮你看看,在这也说不明白

奖励园豆:5
~扎克伯格 | 小虾三级 |园豆:1923 | 2016-12-29 12:30

晚上回去的  公司上不了qq什么的

糯米好吃 | 园豆:64 (初学一级) | 2016-12-29 13:10

@糯米好吃: 你手机加我吧!在线跟你说快点。

~扎克伯格 | 园豆:1923 (小虾三级) | 2016-12-29 13:12

@~扎克伯格: 多谢大哥

糯米好吃 | 园豆:64 (初学一级) | 2017-01-05 08:54
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册