123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace cuidian.Common
- {
- public class DocTypeConvert
- {
- /// <summary>
- /// 根据单据类型获得中文说明
- /// </summary>
- /// <param name="docType"></param>
- /// <returns></returns>
- 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;
- }
- /// <summary>
- /// 根据单据类型获得VoucherType
- /// </summary>
- /// <param name="docType"></param>
- /// <returns></returns>
- 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;
- }
- }
- }
|