/// <summary> /// 判读是否已经创建订单费用 /// </summary> /// <param name="sokey"></param> public string IsOrderCost(CreateOrderCost bpObj) { string StrMeg = string.Empty; List <FeeTypAmountDTO> dto = bpObj.FeeDTO; if (dto != null && dto.Count > 0) { using (ISession session = Session.Open()) { for (int i = 0; i < dto.Count; i++) { OrderCost cost = OrderCost.Finder.Find(string.Format("SellOrderID={0} and CostItem.Code={1}", bpObj.SoKeyID.ID, dto[i].FeeType.ID));//根据费用类型 销售订单号 if (cost == null) { //创建订单费用 SO s = bpObj.SoKeyID.GetEntity();//得到当前key的实体 if (s != null) { //国内运输费用、国际运输费用、国内其他费用、国际其他费用 费用项目取固定编码的U9标准产品费用项目档案 //根据不同的费用项目,生成不同的费用记录 long l = dto[i].FeeType.ID; if (l == 0010101) { //国内运输费 StrMeg = CreateOrderCost(s, long.Parse("0010101"), dto[i].FeeAmount); } else if (l == 0010102) { //国际运输费用 StrMeg = CreateOrderCost(s, long.Parse("0010102"), dto[i].FeeAmount); } else if (l == 0010103) { //国内其他费用 StrMeg = CreateOrderCost(s, long.Parse("0010103"), dto[i].FeeAmount); } else if (l == 0010104) { //国际其他费用 StrMeg = CreateOrderCost(s, long.Parse("0010104"), dto[i].FeeAmount); } } } } session.Commit(); } } return(StrMeg); }
public override object Do(object obj) { CreateOrderCost bpObj = (CreateOrderCost)obj; string StrMeg = string.Empty; bool IsTrue = false; if (bpObj != null) { SM.SO.SO.EntityKey sokey = bpObj.SoKeyID; StrMeg = IsOrderCost(bpObj); } if (string.IsNullOrEmpty(StrMeg)) { IsTrue = true; } return(IsTrue); }