using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace cuidian.Common { public class DocTypeConvert { /// /// 根据单据类型获得中文说明 /// /// /// public static string ConvertToDesc(EnumDocType docType ) { string desc = string.Empty; switch (docType) { case EnumDocType.SaleOrder: desc = "销售订单"; break; case EnumDocType.PurchaseOrder: desc = "采购订单"; break; case EnumDocType.TransVouch: desc = "调拨单"; break; case EnumDocType.CheckVouch: desc = "盘点单"; break; case EnumDocType.Assemble: desc = "组装单"; break; case EnumDocType.DisAssemble: desc = "拆卸单"; break; case EnumDocType.ArrivalVouch: desc = "采购到货单"; break; case EnumDocType.RedArrivalVouch: desc = "采购退货单"; break; case EnumDocType.RdRecord01: desc = "采购入库单"; break; case EnumDocType.RedRdRecord01: desc = "红字采购入库单"; break; case EnumDocType.RedDispatchlist: desc = "销售退货单"; break; case EnumDocType.Dispatchlist: desc = "销售发货单"; break; case EnumDocType.RdRecord32: desc = "销售出库单"; break; case EnumDocType.RedRdRecord32: desc = "红字销售出库单"; break; case EnumDocType.RdRecord08: desc = "其他入库单"; break; case EnumDocType.RdRecord09: desc = "其他出库单"; break; default: break; } return desc; } /// /// 根据单据类型获得VoucherType /// /// /// public static string ConvertToVoucherType(EnumDocType docType) { string voucherType = string.Empty; switch (docType) { case EnumDocType.SaleOrder: case EnumDocType.TransVouch: voucherType = "12"; break; case EnumDocType.PurchaseOrder: voucherType = "1"; break; case EnumDocType.CheckVouch: voucherType = "18"; break; case EnumDocType.Assemble: voucherType = "13"; break; case EnumDocType.DisAssemble: voucherType = "14"; break; case EnumDocType.ArrivalVouch: case EnumDocType.RedArrivalVouch: voucherType = "2"; break; case EnumDocType.RdRecord01: case EnumDocType.RedRdRecord01: voucherType = "01"; break; case EnumDocType.Dispatchlist: voucherType = "9"; break; case EnumDocType.RedDispatchlist: voucherType = "10"; break; case EnumDocType.RdRecord32: case EnumDocType.RedRdRecord32: voucherType = "32"; break; case EnumDocType.RdRecord08: voucherType = "08"; break; case EnumDocType.RdRecord09: voucherType = "09"; break; default: break; } return voucherType; } public static string ConvertToCardNum(EnumDocType docType) { string cardNum = string.Empty; switch (docType) { case EnumDocType.SaleOrder: cardNum = "17"; break; case EnumDocType.PurchaseOrder: cardNum = "88"; break; case EnumDocType.TransVouch: cardNum = "0304"; break; case EnumDocType.CheckVouch: cardNum = "0307"; break; case EnumDocType.Assemble: cardNum = "0308"; break; case EnumDocType.DisAssemble: cardNum = "0309"; break; case EnumDocType.ArrivalVouch: cardNum = "26"; break; case EnumDocType.RedArrivalVouch: cardNum = "r26"; break; case EnumDocType.RdRecord01: cardNum = "24"; break; case EnumDocType.RedRdRecord01: cardNum = "r24"; break; case EnumDocType.RedDispatchlist: cardNum = "r01"; break; case EnumDocType.Dispatchlist: cardNum = "01"; break; case EnumDocType.RdRecord32: cardNum = "0303"; break; case EnumDocType.RedRdRecord32: cardNum = "r0303"; break; case EnumDocType.RdRecord08: cardNum = "0301"; break; case EnumDocType.RdRecord09: cardNum = "0302"; break; default: break; } return cardNum; } } }