Ejemplo n.º 1
0
        /// <summary>
        /// Delete data in billing temp when data is send
        /// </summary>
        /// <param name="ContractCode"></param>
        /// <returns></returns>
        public List <tbt_BillingTemp> DeleteAllSendData(string ContractCode)
        {
            try
            {
                //Validate data input
                //1.1	ContractCode is required.
                doBillingTempData billing = new doBillingTempData();
                billing.ContractCode = ContractCode;
                ApplicationErrorException.CheckMandatoryField(billing);

                //Delete data from DB
                List <tbt_BillingTemp> deletedList = base.DeleteAllSendData(ContractCode, BillingTemp.C_BILLINGTEMP_FLAG_KEEP);

                //Insert Log
                if (deletedList.Count > 0)
                {
                    doTransactionLog logData = new doTransactionLog();
                    logData.TransactionType = doTransactionLog.eTransactionType.Delete;
                    logData.TableName       = TableName.C_TBL_NAME_BILLING_TEMP;
                    logData.TableData       = CommonUtil.ConvertToXml(deletedList);
                    ILogHandler hand = ServiceContainer.GetService <ILogHandler>() as ILogHandler;
                    hand.WriteTransactionLog(logData);
                }

                return(deletedList);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 2
0
        ///// <summary>
        ///// Get billing temp from specified fee type
        ///// </summary>
        ///// <param name="contractCode"></param>
        ///// <param name="occ"></param>
        ///// <param name="billingType"></param>
        ///// <param name="billingTiming"></param>
        ///// <returns></returns>
        //public List<tbt_BillingTemp> GetFee(string contractCode, string occ, string billingType, string billingTiming)
        //{
        //    try
        //    {
        //        //ApplicationErrorException.CheckMandatoryField(billing);
        //        return new List<tbt_BillingTemp>();
        //    }
        //    catch (Exception)
        //    {
        //        throw;
        //    }
        //}

        /// <summary>
        /// Update flag in billing temp when already send to billing module
        /// </summary>
        /// <param name="ContractCode"></param>
        /// <param name="SequenceNo"></param>
        /// <param name="OCC"></param>
        /// <returns></returns>
        public List <tbt_BillingTemp> UpdateSendFlag(string ContractCode, int SequenceNo, string OCC) //Add OCC by Jutarat A. on 05102012
        {
            try
            {
                //Validate data input
                //1.1	ContractCode is required.
                doBillingTempData billing = new doBillingTempData();
                billing.ContractCode = ContractCode;
                ApplicationErrorException.CheckMandatoryField(billing);

                //2.	Update billing temp data.
                //Update data to DB
                List <tbt_BillingTemp> updatedList = base.UpdateSendFlag(ContractCode, SequenceNo, OCC, //Add OCC by Jutarat A. on 05102012
                                                                         BillingTemp.C_BILLINGTEMP_FLAG_SENT,
                                                                         CommonUtil.dsTransData.dtOperationData.ProcessDateTime,
                                                                         CommonUtil.dsTransData.dtUserData.EmpNo);

                //Insert Log
                if (updatedList.Count > 0)
                {
                    doTransactionLog logData = new doTransactionLog();
                    logData.TransactionType = doTransactionLog.eTransactionType.Update;
                    logData.TableName       = TableName.C_TBL_NAME_BILLING_TEMP;
                    logData.TableData       = CommonUtil.ConvertToXml(updatedList);
                    ILogHandler hand = ServiceContainer.GetService <ILogHandler>() as ILogHandler;
                    hand.WriteTransactionLog(logData);
                }

                return(updatedList);
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Get billing detail data from billing temp
        /// </summary>
        /// <param name="ContractCode"></param>
        /// <param name="OCC"></param>
        /// <param name="BillingTypeList"></param>
        /// <param name="BillingTimingList"></param>
        /// <returns></returns>
        public List <doBillingTempDetail> GetBillingDetailData(string ContractCode, string OCC, List <string> BillingTypeList, List <string> BillingTimingList)
        {
            try
            {
                //Validate data input
                //1.1	ContractCode is required.
                doBillingTempData billing = new doBillingTempData();
                billing.ContractCode = ContractCode;
                ApplicationErrorException.CheckMandatoryField(billing);

                string strBillingType = null;
                if (BillingTypeList != null)
                {
                    strBillingType = CommonUtil.CreateCSVString(BillingTypeList);
                }

                string strBillingTiming = null;
                if (BillingTimingList != null)
                {
                    strBillingTiming = CommonUtil.CreateCSVString(BillingTimingList);
                }

                //Get data from DB
                List <doBillingTempDetail> detailList
                    = base.GetBillingDetailData(
                          ContractCode, OCC, strBillingType, strBillingTiming, BillingTemp.C_BILLINGTEMP_FLAG_KEEP);

                return(detailList);
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Get billing basic data from billing temp
        /// </summary>
        /// <param name="ContractCode"></param>
        /// <param name="OCC"></param>
        /// <param name="BillingTypeList"></param>
        /// <param name="BillingTimingList"></param>
        /// <returns></returns>
        public List <doBillingTempBasic> GetBillingBasicData(string ContractCode, string OCC, List <string> BillingTypeList, List <string> BillingTimingList)
        {
            try
            {
                //Validate data input
                //1.1	ContractCode is required.
                doBillingTempData billing = new doBillingTempData();
                billing.ContractCode = ContractCode;
                ApplicationErrorException.CheckMandatoryField(billing);

                string strBillingType = null;
                if (BillingTypeList != null)
                {
                    strBillingType = CommonUtil.CreateCSVString(BillingTypeList);
                }

                string strBillingTiming = null;
                if (BillingTimingList != null)
                {
                    strBillingTiming = CommonUtil.CreateCSVString(BillingTimingList);
                }

                //Get data from DB
                List <doBillingTempBasic> basicList
                    = base.GetBillingBasicData(
                          ContractCode, OCC, strBillingType, strBillingTiming
                          //, SECOM_AJIS.Common.Util.ConstantValue.ContractBillingType.C_CONTRACT_BILLING_TYPE_SALE_PRICE
                          , SECOM_AJIS.Common.Util.ConstantValue.ContractBillingType.C_CONTRACT_BILLING_TYPE_PRODUCT_PRICE
                          , BillingTemp.C_BILLINGTEMP_FLAG_KEEP
                          , SECOM_AJIS.Common.Util.ConstantValue.CurrencyUtil.C_CURRENCY_LOCAL);

                return(basicList);
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// For change billing target from CTS130: CP-16 change customer name and address
        /// </summary>
        /// <param name="strContractCode"></param>
        /// <param name="strOldBillingClientCode"></param>
        /// <param name="strOldBillingOfficeCode"></param>
        /// <param name="strOldBillingTargetCode"></param>
        /// <param name="strNewBillingClientCode"></param>
        /// <param name="strNewBillingOfficeCode"></param>
        /// <param name="strNewBillingTargetCode"></param>
        /// <returns></returns>
        public List <tbt_BillingTemp> UpdateBillingTempByBillingTarget(string ContractCode, string strOldBillingClientCode, string strOldBillingOfficeCode, string strOldBillingTargetCode, string strNewBillingClientCode, string strNewBillingOfficeCode, string strNewBillingTargetCode)
        {
            try
            {
                //Validate data input
                //1.1	ContractCode is required.
                doBillingTempData billing = new doBillingTempData();
                billing.ContractCode = ContractCode;
                ApplicationErrorException.CheckMandatoryField(billing);

                //Update data to DB
                List <tbt_BillingTemp> updatedList
                    = base.UpdateTbt_BillingTemp_ByBillingTarget(
                          strNewBillingClientCode, strNewBillingOfficeCode, strNewBillingTargetCode,
                          strOldBillingClientCode, strOldBillingOfficeCode, strOldBillingTargetCode, ContractCode,
                          CommonUtil.dsTransData.dtOperationData.ProcessDateTime,
                          CommonUtil.dsTransData.dtUserData.EmpNo,
                          BillingTemp.C_BILLINGTEMP_FLAG_KEEP);

                //Insert Log
                if (updatedList.Count > 0)
                {
                    doTransactionLog logData = new doTransactionLog();
                    logData.TransactionType = doTransactionLog.eTransactionType.Update;
                    logData.TableName       = TableName.C_TBL_NAME_BILLING_TEMP;
                    logData.TableData       = CommonUtil.ConvertToXml(updatedList);
                    ILogHandler hand = ServiceContainer.GetService <ILogHandler>() as ILogHandler;
                    hand.WriteTransactionLog(logData);
                }

                return(updatedList);
            }
            catch (Exception)
            {
                throw;
            }
        }