燃油汇总相关的写法-PageTipGet
2017-04-15 11:48:42 访问(1570) 赞(0) 踩(0)
/// <summary>
///
/// </summary>
/// <param name="xdbHelper"></param>
/// <returns></returns>
protected string PageTipGet
(
eKing.SzdfLib.Business.VGAS.UTB_SZDF_VGAS_ITEM bll,
eKing.SzdfLib.Entity.VGAS.UTB_SZDF_VGAS_ITEM entity,
eKing.SzdfLib.Items.ModelContainers.VGAS.VgasItemModelContainer BMC,
DBHelper xdbHelper
)
{
ISelectDriver iselect = entity;
IOrderByDriver iorder = entity;
iselect.ClearAllISelectItem();
iorder.ClearAllIOrderByItem();
iselect.AddISelectItemWithEntityFieldInfo(entity._OilType_Id);
iselect.AddISelectItemWithSQL("sum(" + entity._RefuelAmount._Name + ") as " + entity._RefuelAmount._Name);
iselect.AddISelectItemWithSQL("sum(" + entity._TotallPrice._Name + ") as " + entity._TotallPrice._Name);
IQueryDriver iq = entity;
IGroupByDriver igroup = entity;
igroup.AddIGroupByItemWithEntityFieldInfo(entity._OilType_Id);
List<BaseModel> theList
=
bll.ListBaseModel(entity, xdbHelper);
VGasTotal VGT = new VGasTotal();
eKing.SzdfLib.Model.VB.UTB_SZDF_VB_OIL vbOil = null;
eKing.SzdfLib.Enums.OilType.EmOilType emOilTypeV = eKing.SzdfLib.Enums.OilType.EmOilType.柴油;
foreach (eKing.SzdfLib.Model.VGAS.UTB_SZDF_VGAS_ITEM model in theList)
{
vbOil = BMC.VbOilGet(model.OilType_Id, xdbHelper);
if (vbOil == null)
{
throw new Exception
(
"方法:"
+ MethodBase.GetCurrentMethod().ReflectedType.FullName
+ " "
+ MethodBase.GetCurrentMethod().ToString()
+ " 发生异常:没有找到(ID=" + model.OilType_Id.ToString() + ")对应的燃油类型。"
);
}
emOilTypeV = eKing.SzdfLib.Enums.OilType.GetEmByInt(vbOil.EmOilTypeV);
switch (emOilTypeV)
{
case eKing.SzdfLib.Enums.OilType.EmOilType.柴油:
VGT.CYJE += model.TotallPrice;
VGT.CYSL += model.RefuelAmount;
break;
case eKing.SzdfLib.Enums.OilType.EmOilType.汽油:
VGT.QYJE += model.TotallPrice;
VGT.QYSL += model.RefuelAmount;
break;
default:
throw new Exception
(
"方法:"
+ MethodBase.GetCurrentMethod().ReflectedType.FullName
+ " "
+ MethodBase.GetCurrentMethod().ToString()
+ " 发生异常:"
+ "枚举("
+ emOilTypeV.GetType().FullName
+ "."
+ emOilTypeV.ToString()
+ ")未知,对应的代码尚未实现。"
);
}
}
string theResult = "<img src=\""+ strPhyPath + "/Content/icon/qy.png\" border=\"0\" alt=\"\" />"
+ "升数:" + VGT.QyslToString() + "升" + ";"
+ " " + "金额:" + VGT.QyjeToString() + "元" + ";"
+ " "
+ "<img src=\"" + strPhyPath + "/Content/icon/cy.png\" border=\"0\" alt=\"\" />"
+ "升数:" + VGT.CyslToString() + "升" + ";"
+ " " + "金额:" + VGT.CyjeToString() + "元" + ";"
+ " "
+ "<img src=\"" + strPhyPath + "/Content/icon/z.png\" border=\"0\" alt=\"\" />"
+ "总升数:" + VGT.ZslToString() + "升" + ";"
+ " "
+ "总金额:" + VGT.ZjeToString() + "元";
return theResult;
}
标签:
燃油汇总相关的写法-PageTipGet 


上一条:
下一条:
相关评论
发表评论