示例#1
0
        /// <summary>
        /// 创建销售订单费用
        /// </summary>
        public static void CreateFee(SO so)
        {
            List <FeeTypAmountDTOData> FeeList = GetFeeList(so);

            if (FeeList.Count > 0)
            {
                //调用生成订单费用的BP
                CreateOrderCostProxy Proxy = new CreateOrderCostProxy();
                Proxy.SoKeyID = so.ID;//销售订单ID
                Proxy.FeeDTO  = FeeList;
                Proxy.Do();
            }
        }
        /// <summary>
        /// 生成订单费用
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAgain_Click_Extend(object sender, EventArgs e)
        {
            List <FeeTypAmountDTOData> dtoData = this.CurrentState["LsitDTO"] as List <FeeTypAmountDTOData>;

            if (dtoData != null && dtoData.Count > 0)
            {
                CreateOrderCostProxy proxy = new CreateOrderCostProxy();
                proxy.SoKeyID = long.Parse(this.CurrentState["So_ID"] + "");//销售订单ID;

                proxy.FeeDTO = this.CurrentState["LsitDTO"] as List <FeeTypAmountDTOData>;
                bool IsTrue = proxy.Do();
                if (!IsTrue)
                {
                    throw new Exception("费用档案中没找到与销售订单费用相对应的费用类型,生成订单费用失败!");
                }
            }
            else
            {
                throw new Exception("销售订单或者费用为空,未能生成订单费用!");
            }

            btnAgain_Click_DefaultImpl(sender, e);
        }