Exemple #1
0
        /// <summary>
        /// 删除承运单位结算记录数据
        /// </summary>
        /// <param name="nId"></param>
        /// <param name="nOpStaffId"></param>
        /// <param name="strOpStaffName"></param>
        /// <param name="strErrText"></param>
        /// <returns></returns>
        public bool DeleteCarrierTransportChargesSettlement(long nId, long nOpStaffId, string strOpStaffName, out string strErrText)
        {
            try
            {
                using (TransactionScope transScope = new TransactionScope(TransactionScopeOption.Required, new TimeSpan(2, 0, 0)))
                {
                    using (SettlementDAO dao = new SettlementDAO())
                    {
                        if (!dao.DeleteCarrierTransportChargesSettlement(nId, nOpStaffId, strOpStaffName, out strErrText))
                        {
                            return(false);
                        }

                        if (!dao.DeleteCarrierTransportChargesSettlementDetails(nId, nOpStaffId, strOpStaffName, out strErrText))
                        {
                            return(false);
                        }
                    }
                    transScope.Complete();
                }
                return(true);
            }
            catch (Exception e)
            {
                strErrText = e.Message;
                return(false);
            }
        }
Exemple #2
0
        /// <summary>
        /// 新增承运单位结算记录
        /// </summary>
        /// <param name="data"></param>
        /// <param name="listDetail"></param>
        /// <param name="nOpStaffId"></param>
        /// <param name="strOpStaffName"></param>
        /// <param name="strErrText"></param>
        /// <returns></returns>
        public long InsertCarrierTransportChargesSettlement(CarrierTransportChargesSettlement data, List <CarrierTransportChargesSettlementDetail> listDetail, long nOpStaffId, string strOpStaffName, out string strErrText)
        {
            long nCarrierTransportChargesSettlementId = 0;

            try
            {
                using (TransactionScope transScope = new TransactionScope(TransactionScopeOption.Required, new TimeSpan(2, 0, 0)))
                {
                    using (SettlementDAO dao = new SettlementDAO())
                    {
                        //新增结算数据
                        nCarrierTransportChargesSettlementId = dao.InsertCarrierTransportChargesSettlement(data, nOpStaffId, strOpStaffName, out strErrText);
                        if (nCarrierTransportChargesSettlementId <= 0)
                        {
                            return(0);
                        }

                        //新增结算明细数据
                        foreach (CarrierTransportChargesSettlementDetail detail in listDetail)
                        {
                            detail.CarrierTransportChargesSettlementId = nCarrierTransportChargesSettlementId;

                            if (!dao.InsertCarrierTransportChargesSettlementDetail(detail, nOpStaffId, strOpStaffName, out strErrText))
                            {
                                return(0);
                            }
                        }
                    }
                    transScope.Complete();
                }
                return(nCarrierTransportChargesSettlementId);
            }
            catch (Exception e)
            {
                strErrText = e.Message;
                return(0);
            }
        }
Exemple #3
0
        /// <summary>
        /// 根据综合条件读取发票数据
        /// </summary>
        /// <param name="strStartTime"></param>
        /// <param name="strEndTime"></param>
        /// <param name="strInvoiceNo"></param>
        /// <param name="strDeliverBillNo"></param>
        /// <param name="strCustomerName"></param>
        /// <param name="nOpStaffId"></param>
        /// <param name="strOpStaffName"></param>
        /// <param name="strErrText"></param>
        /// <returns></returns>
        public List <CustomerTransportChargesSettlement> LoadCustomerTransportChargesSettlementsByConditions(string strStartTime, string strEndTime, string strInvoiceNo, string strDeliverBillNo, string strCustomerName, long nOpStaffId, string strOpStaffName, out string strErrText)
        {
            try
            {
                List <CustomerTransportChargesSettlement> dataResult = null;
                strErrText = String.Empty;

                using (TransactionScope transScope = new TransactionScope(TransactionScopeOption.Required, new TimeSpan(2, 0, 0)))
                {
                    using (SettlementDAO dao = new SettlementDAO())
                    {
                        dataResult = dao.LoadCustomerTransportChargesSettlementsByConditions(strStartTime, strEndTime, strInvoiceNo, strDeliverBillNo, strCustomerName, nOpStaffId, strOpStaffName, out strErrText);
                    }
                    transScope.Complete();
                }
                return(dataResult);
            }
            catch (Exception e)
            {
                strErrText = e.Message;
                return(null);
            }
        }
Exemple #4
0
 /// <summary>
 /// 新增特殊承运价格数据
 /// </summary>
 /// <param name="data"></param>
 /// <param name="nOpStaffId"></param>
 /// <param name="strOpStaffName"></param>
 /// <param name="strErrText"></param>
 /// <returns></returns>
 public bool InsertDeliverBillCarrierTransportPrice(DeliverBillCarrierTransportPrice data, long nOpStaffId, string strOpStaffName, out string strErrText)
 {
     try
     {
         using (TransactionScope transScope = new TransactionScope(TransactionScopeOption.Required, new TimeSpan(2, 0, 0)))
         {
             using (SettlementDAO dao = new SettlementDAO())
             {
                 if (!dao.InsertDeliverBillCarrierTransportPrice(data, nOpStaffId, strOpStaffName, out strErrText))
                 {
                     return(false);
                 }
             }
             transScope.Complete();
         }
         return(true);
     }
     catch (Exception e)
     {
         strErrText = e.Message;
         return(false);
     }
 }
Exemple #5
0
        /// <summary>
        /// 读取指定送货单编码的特殊承运价格记录
        /// </summary>
        /// <param name="nDeliverBillId"></param>
        /// <param name="nOpStaffId"></param>
        /// <param name="strOpStaffName"></param>
        /// <param name="strErrText"></param>
        /// <returns></returns>
        public DeliverBillCarrierTransportPrice LoadDeliverBillCarrierTransportPriceByDeliverBillId(long nDeliverBillId, long nOpStaffId, string strOpStaffName, out string strErrText)
        {
            try
            {
                DeliverBillCarrierTransportPrice dataResult = null;
                strErrText = String.Empty;

                using (TransactionScope transScope = new TransactionScope(TransactionScopeOption.Required, new TimeSpan(2, 0, 0)))
                {
                    using (SettlementDAO dao = new SettlementDAO())
                    {
                        dataResult = dao.LoadDeliverBillCarrierTransportPriceByDeliverBillId(nDeliverBillId, nOpStaffId, strOpStaffName, out strErrText);
                    }
                    transScope.Complete();
                }
                return(dataResult);
            }
            catch (Exception e)
            {
                strErrText = e.Message;
                return(null);
            }
        }
Exemple #6
0
        /// <summary>
        /// 根据条件读取客户对帐单数据
        /// </summary>
        /// <param name="strStartTime"></param>
        /// <param name="strEndTime"></param>
        /// <param name="strPayerName"></param>
        /// <param name="strReceiverName"></param>
        /// <param name="strStartCountry"></param>
        /// <param name="strStartProvince"></param>
        /// <param name="strStartCity"></param>
        /// <param name="strDestCountry"></param>
        /// <param name="strDestProvince"></param>
        /// <param name="strDestCity"></param>
        /// <param name="strCarrierName"></param>
        /// <param name="strCarNo"></param>
        /// <param name="strGoodsName"></param>
        /// <param name="strAllowStatementWhenConsignedDeliverPlanNotCompleted"></param>
        /// <param name="nOpStaffId"></param>
        /// <param name="strOpStaffName"></param>
        /// <param name="strErrText"></param>
        /// <returns></returns>
        public List <CustomerStatement> LoadCustomerStatementByConditions(string strStartTime, string strEndTime, string strPayerName, string strReceiverName, string strStartCountry, string strStartProvince, string strStartCity, string strDestCountry, string strDestProvince, string strDestCity, string strCarrierName, string strCarNo, string strGoodsName, string strAllowStatementWhenConsignedDeliverPlanNotCompleted, long nOpStaffId, string strOpStaffName, out string strErrText)
        {
            try
            {
                List <CustomerStatement> dataResult = null;
                strErrText = String.Empty;

                using (TransactionScope transScope = new TransactionScope(TransactionScopeOption.Required, new TimeSpan(2, 0, 0)))
                {
                    using (SettlementDAO dao = new SettlementDAO())
                    {
                        dataResult = dao.LoadCustomerStatementByConditions(strStartTime, strEndTime, strPayerName, strReceiverName, strStartCountry, strStartProvince, strStartCity, strDestCountry, strDestProvince, strDestCity, strCarrierName, strCarNo, strGoodsName, strAllowStatementWhenConsignedDeliverPlanNotCompleted, nOpStaffId, strOpStaffName, out strErrText);
                    }
                    transScope.Complete();
                }
                return(dataResult);
            }
            catch (Exception e)
            {
                strErrText = e.Message;
                return(null);
            }
        }
Exemple #7
0
        /// <summary>
        /// 读取指定承运单位结算记录明细数据
        /// </summary>
        /// <param name="nCarrierTransportChargesSettlementId"></param>
        /// <param name="nOpStaffId"></param>
        /// <param name="strOpStaffName"></param>
        /// <param name="strErrText"></param>
        /// <returns></returns>
        public List <CarrierTransportChargesSettlementDetail> LoadCarrierTransportChargesSettlementDetails(long nCarrierTransportChargesSettlementId, long nOpStaffId, string strOpStaffName, out string strErrText)
        {
            try
            {
                List <CarrierTransportChargesSettlementDetail> dataResult = null;
                strErrText = String.Empty;

                using (TransactionScope transScope = new TransactionScope(TransactionScopeOption.Required, new TimeSpan(2, 0, 0)))
                {
                    using (SettlementDAO dao = new SettlementDAO())
                    {
                        dataResult = dao.LoadCarrierTransportChargesSettlementDetails(nCarrierTransportChargesSettlementId, nOpStaffId, strOpStaffName, out strErrText);
                    }
                    transScope.Complete();
                }
                return(dataResult);
            }
            catch (Exception e)
            {
                strErrText = e.Message;
                return(null);
            }
        }