Beispiel #1
0
        //public DateTime getCreditPurcEndDateToProcess(CreditType CreditType)
        //{
        //    try
        //    {
        //        MySqlCommand cmd = new MySqlCommand();
        //        cmd.CommandType = System.Data.CommandType.Text;

        //        string SQL = "SELECT CreditPurcEndDateToProcess FROM tblCardTypes WHERE CardTypeCode = (SELECT ConfigValue FROM sysCreditConfig WHERE ConfigName = 'IndividualCardTypeCode') ";

        //        // do an override
        //        if (CreditType == RetailPlus.CreditType.Group)
        //            SQL = "SELECT CreditPurcEndDateToProcess FROM tblCardTypes WHERE CardTypeCode = (SELECT ConfigValue FROM sysCreditConfig WHERE ConfigName = 'GroupCardTypeCode') ";

        //        cmd.CommandText = SQL;
        //        string strDataTableName = "tbl" + this.GetType().FullName.Split(new Char[] { '.' })[this.GetType().FullName.Split(new Char[] { '.' }).Length - 1]; System.Data.DataTable dt = new System.Data.DataTable(strDataTableName);
        //        base.MySqlDataAdapterFill(cmd, dt);

        //        DateTime dteRetValue = DateTime.MaxValue;
        //        foreach(System.Data.DataRow dr in dt.Rows)
        //        {
        //            dteRetValue = DateTime.Parse(dr["CreditPurcEndDateToProcess"].ToString());
        //        }

        //        return dteRetValue;
        //    }
        //    catch (Exception ex)
        //    {
        //        throw base.ThrowException(ex);
        //    }
        //}

        //public DateTime getBillingDate(CreditType CreditType)
        //{
        //    try
        //    {
        //        MySqlCommand cmd = new MySqlCommand();
        //        cmd.CommandType = System.Data.CommandType.Text;

        //        string SQL = "SELECT BillingDate FROM tblCardTypes WHERE CardTypeCode = (SELECT ConfigValue FROM sysCreditConfig WHERE ConfigName = 'IndividualCardTypeCode') ";

        //        // do an override if group
        //        if (CreditType == RetailPlus.CreditType.Group)
        //            SQL = "SELECT BillingDate FROM tblCardTypes WHERE CardTypeCode = (SELECT ConfigValue FROM sysCreditConfig WHERE ConfigName = 'GroupCardTypeCode') ";

        //        cmd.CommandText = SQL;
        //        string strDataTableName = "tbl" + this.GetType().FullName.Split(new Char[] { '.' })[this.GetType().FullName.Split(new Char[] { '.' }).Length - 1]; System.Data.DataTable dt = new System.Data.DataTable(strDataTableName);
        //        base.MySqlDataAdapterFill(cmd, dt);

        //        DateTime dteRetValue = Constants.C_DATE_MIN_VALUE;
        //        foreach (System.Data.DataRow dr in dt.Rows)
        //        {
        //            dteRetValue = DateTime.Parse(dr["BillingDate"].ToString());
        //        }

        //        return dteRetValue;
        //    }
        //    catch (Exception ex)
        //    {
        //        throw base.ThrowException(ex);
        //    }
        //}

        //public CardTypeDetails getCreditCardTypeInfo(CreditType CreditType)
        //{
        //    try
        //    {
        //        MySqlCommand cmd = new MySqlCommand();
        //        cmd.CommandType = System.Data.CommandType.Text;

        //        string SQL = "SELECT ConfigValue FROM sysCreditConfig WHERE ConfigName = 'IndividualCardTypeCode' ";

        //        // do an override if group
        //        if (CreditType == RetailPlus.CreditType.Group)
        //            SQL = "SELECT ConfigValue FROM sysCreditConfig WHERE ConfigName = 'GroupCardTypeCode' ";

        //        cmd.CommandText = SQL;
        //        string strDataTableName = "tbl" + this.GetType().FullName.Split(new Char[] { '.' })[this.GetType().FullName.Split(new Char[] { '.' }).Length - 1]; System.Data.DataTable dt = new System.Data.DataTable(strDataTableName);
        //        base.MySqlDataAdapterFill(cmd, dt);

        //        string strCardTypeCode = string.Empty;
        //        foreach (System.Data.DataRow dr in dt.Rows)
        //        {
        //            strCardTypeCode = dr["ConfigValue"].ToString();
        //            return new CardType(base.Connection, base.Transaction).Details(strCardTypeCode);
        //        }

        //        return new CardTypeDetails();
        //    }
        //    catch (Exception ex)
        //    {
        //        throw base.ThrowException(ex);
        //    }
        //}

        private BillingDetails setDetails(System.Data.DataRow dr)
        {
            try
            {
                BillingDetails Details = new BillingDetails();

                Details.CreditBillHeaderID  = Convert.ToInt64(dr["CreditBillHeaderID"]);
                Details.ContactID           = Convert.ToInt64(dr["ContactID"]);
                Details.CrediLimit          = Convert.ToDecimal(dr["CreditLimit"]);
                Details.RunningCreditAmt    = Convert.ToDecimal(dr["RunningCreditAmt"]);
                Details.CurrMonthCreditAmt  = Convert.ToDecimal(dr["CurrMonthCreditAmt"]);
                Details.CurrMonthAmountPaid = Convert.ToDecimal(dr["CurrMonthAmountPaid"]);
                Details.TotalBillCharges    = Convert.ToDecimal(dr["TotalBillCharges"]);
                Details.CurrentDueAmount    = Convert.ToDecimal(dr["CurrentDueAmount"]);
                Details.MinimumAmountDue    = Convert.ToDecimal(dr["MinimumAmountDue"]);

                Details.Prev1MoCurrentDueAmount    = Convert.ToDecimal(dr["Prev1MoCurrentDueAmount"]);
                Details.Prev1MoMinimumAmountDue    = Convert.ToDecimal(dr["Prev1MoMinimumAmountDue"]);
                Details.Prev1MoCurrMonthAmountPaid = Convert.ToDecimal(dr["Prev1MoCurrMonthAmountPaid"]);
                Details.Prev2MoCurrentDueAmount    = Convert.ToDecimal(dr["Prev2MoCurrentDueAmount"]);
                Details.CurrentPurchaseAmt         = decimal.Parse(dr["CurrentPurchaseAmt"].ToString());
                Details.BeginningBalance           = decimal.Parse(dr["BeginningBalance"].ToString());
                Details.EndingBalance = decimal.Parse(dr["EndingBalance"].ToString());

                Details.CreditCutOffDate     = DateTime.Parse(dr["CreditCutOffDate"].ToString());
                Details.CreditPaymentDueDate = DateTime.Parse(dr["CreditPaymentDueDate"].ToString());
                Details.BillingDate          = DateTime.Parse(dr["BillingDate"].ToString());

                Details.CreditPurcStartDateToProcess = DateTime.Parse(dr["CreditPurcStartDateToProcess"].ToString());
                Details.CreditPurcEndDateToProcess   = DateTime.Parse(dr["CreditPurcEndDateToProcess"].ToString());

                // need an override to eliminate reporting issue
                // '0001-01-01' is not accepted by Crystal
                Details.CreditPurcStartDateToProcess = Details.CreditPurcStartDateToProcess == DateTime.MinValue ? Constants.C_DATE_MIN_VALUE : Details.CreditPurcStartDateToProcess;
                Details.CreditPurcEndDateToProcess   = Details.CreditPurcEndDateToProcess == DateTime.MinValue ? Constants.C_DATE_MIN_VALUE : Details.CreditPurcEndDateToProcess;

                Details.BillingFile   = dr["BillingFile"].ToString();
                Details.isBillPrinted = bool.Parse(dr["isBillPrinted"].ToString());

                Customer clsCustomer = new Customer(base.Connection, base.Transaction);
                Details.CustomerDetails = clsCustomer.Details(Details.ContactID);

                return(Details);
            }
            catch (Exception ex)
            {
                throw base.ThrowException(ex);
            }
        }
		private void CreateDetails(int iRow)
		{
			mDetails = new ContactDetails();
			Customer clsCustomer = new Customer();
			mDetails = clsCustomer.Details(Convert.ToInt64(dgContacts[iRow, 0].ToString()));
			clsCustomer.CommitAndDispose();

			////int iRow = dgContacts.CurrentRowIndex;

			//mDetails.ContactID = Convert.ToInt64(dgContacts[iRow, 0].ToString());
			//mDetails.ContactCode = dgContacts[iRow, 1].ToString();
			//mDetails.ContactName = dgContacts[iRow, 2].ToString();
			//mDetails.Debit = Convert.ToDecimal(dgContacts[iRow, 3].ToString());
			//mDetails.Credit = Convert.ToDecimal(dgContacts[iRow, 4].ToString());
			//mDetails.CreditLimit = Convert.ToDecimal(dgContacts[iRow, 5].ToString());
			//mDetails.IsCreditAllowed = Convert.ToInt16(dgContacts[iRow, 6].ToString());
			//mDetails.PositionName = dgContacts[iRow, 7].ToString();
			//mDetails.DepartmentName = dgContacts[iRow, 8].ToString();
		}
Beispiel #3
0
        //public DateTime getCreditPurcEndDateToProcess(CreditType CreditType)
        //{
        //    try
        //    {
        //        MySqlCommand cmd = new MySqlCommand();
        //        cmd.CommandType = System.Data.CommandType.Text;

        //        string SQL = "SELECT CreditPurcEndDateToProcess FROM tblCardTypes WHERE CardTypeCode = (SELECT ConfigValue FROM sysCreditConfig WHERE ConfigName = 'IndividualCardTypeCode') ";

        //        // do an override
        //        if (CreditType == RetailPlus.CreditType.Group)
        //            SQL = "SELECT CreditPurcEndDateToProcess FROM tblCardTypes WHERE CardTypeCode = (SELECT ConfigValue FROM sysCreditConfig WHERE ConfigName = 'GroupCardTypeCode') ";

        //        cmd.CommandText = SQL;
        //        string strDataTableName = "tbl" + this.GetType().FullName.Split(new Char[] { '.' })[this.GetType().FullName.Split(new Char[] { '.' }).Length - 1]; System.Data.DataTable dt = new System.Data.DataTable(strDataTableName);
        //        base.MySqlDataAdapterFill(cmd, dt);

        //        DateTime dteRetValue = DateTime.MaxValue;
        //        foreach(System.Data.DataRow dr in dt.Rows)
        //        {
        //            dteRetValue = DateTime.Parse(dr["CreditPurcEndDateToProcess"].ToString());
        //        }

        //        return dteRetValue;
        //    }
        //    catch (Exception ex)
        //    {
        //        throw base.ThrowException(ex);
        //    }
        //}

        //public DateTime getBillingDate(CreditType CreditType)
        //{
        //    try
        //    {
        //        MySqlCommand cmd = new MySqlCommand();
        //        cmd.CommandType = System.Data.CommandType.Text;

        //        string SQL = "SELECT BillingDate FROM tblCardTypes WHERE CardTypeCode = (SELECT ConfigValue FROM sysCreditConfig WHERE ConfigName = 'IndividualCardTypeCode') ";

        //        // do an override if group
        //        if (CreditType == RetailPlus.CreditType.Group)
        //            SQL = "SELECT BillingDate FROM tblCardTypes WHERE CardTypeCode = (SELECT ConfigValue FROM sysCreditConfig WHERE ConfigName = 'GroupCardTypeCode') ";

        //        cmd.CommandText = SQL;
        //        string strDataTableName = "tbl" + this.GetType().FullName.Split(new Char[] { '.' })[this.GetType().FullName.Split(new Char[] { '.' }).Length - 1]; System.Data.DataTable dt = new System.Data.DataTable(strDataTableName);
        //        base.MySqlDataAdapterFill(cmd, dt);

        //        DateTime dteRetValue = Constants.C_DATE_MIN_VALUE;
        //        foreach (System.Data.DataRow dr in dt.Rows)
        //        {
        //            dteRetValue = DateTime.Parse(dr["BillingDate"].ToString());
        //        }

        //        return dteRetValue;
        //    }
        //    catch (Exception ex)
        //    {
        //        throw base.ThrowException(ex);
        //    }
        //}

        //public CardTypeDetails getCreditCardTypeInfo(CreditType CreditType)
        //{
        //    try
        //    {
        //        MySqlCommand cmd = new MySqlCommand();
        //        cmd.CommandType = System.Data.CommandType.Text;

        //        string SQL = "SELECT ConfigValue FROM sysCreditConfig WHERE ConfigName = 'IndividualCardTypeCode' ";

        //        // do an override if group
        //        if (CreditType == RetailPlus.CreditType.Group)
        //            SQL = "SELECT ConfigValue FROM sysCreditConfig WHERE ConfigName = 'GroupCardTypeCode' ";

        //        cmd.CommandText = SQL;
        //        string strDataTableName = "tbl" + this.GetType().FullName.Split(new Char[] { '.' })[this.GetType().FullName.Split(new Char[] { '.' }).Length - 1]; System.Data.DataTable dt = new System.Data.DataTable(strDataTableName);
        //        base.MySqlDataAdapterFill(cmd, dt);

        //        string strCardTypeCode = string.Empty;
        //        foreach (System.Data.DataRow dr in dt.Rows)
        //        {
        //            strCardTypeCode = dr["ConfigValue"].ToString();
        //            return new CardType(base.Connection, base.Transaction).Details(strCardTypeCode);
        //        }

        //        return new CardTypeDetails();
        //    }
        //    catch (Exception ex)
        //    {
        //        throw base.ThrowException(ex);
        //    }
        //}

        private BillingDetails setDetails(System.Data.DataRow dr)
        {
            try
            {
                BillingDetails Details = new BillingDetails();

                Details.CreditBillHeaderID = Convert.ToInt64(dr["CreditBillHeaderID"]);
                Details.ContactID = Convert.ToInt64(dr["ContactID"]);
                Details.CrediLimit = Convert.ToDecimal(dr["CreditLimit"]);
                Details.RunningCreditAmt = Convert.ToDecimal(dr["RunningCreditAmt"]);
                Details.CurrMonthCreditAmt = Convert.ToDecimal(dr["CurrMonthCreditAmt"]);
                Details.CurrMonthAmountPaid = Convert.ToDecimal(dr["CurrMonthAmountPaid"]);
                Details.TotalBillCharges = Convert.ToDecimal(dr["TotalBillCharges"]);
                Details.CurrentDueAmount = Convert.ToDecimal(dr["CurrentDueAmount"]);
                Details.MinimumAmountDue = Convert.ToDecimal(dr["MinimumAmountDue"]);

                Details.Prev1MoCurrentDueAmount = Convert.ToDecimal(dr["Prev1MoCurrentDueAmount"]);
                Details.Prev1MoMinimumAmountDue = Convert.ToDecimal(dr["Prev1MoMinimumAmountDue"]);
                Details.Prev1MoCurrMonthAmountPaid = Convert.ToDecimal(dr["Prev1MoCurrMonthAmountPaid"]);
                Details.Prev2MoCurrentDueAmount = Convert.ToDecimal(dr["Prev2MoCurrentDueAmount"]);
                Details.CurrentPurchaseAmt = decimal.Parse(dr["CurrentPurchaseAmt"].ToString());
                Details.BeginningBalance = decimal.Parse(dr["BeginningBalance"].ToString());
                Details.EndingBalance = decimal.Parse(dr["EndingBalance"].ToString());

                Details.CreditCutOffDate = DateTime.Parse(dr["CreditCutOffDate"].ToString());
                Details.CreditPaymentDueDate = DateTime.Parse(dr["CreditPaymentDueDate"].ToString());
                Details.BillingDate = DateTime.Parse(dr["BillingDate"].ToString());

                Details.CreditPurcStartDateToProcess = DateTime.Parse(dr["CreditPurcStartDateToProcess"].ToString());
                Details.CreditPurcEndDateToProcess = DateTime.Parse(dr["CreditPurcEndDateToProcess"].ToString());

                // need an override to eliminate reporting issue
                // '0001-01-01' is not accepted by Crystal
                Details.CreditPurcStartDateToProcess = Details.CreditPurcStartDateToProcess == DateTime.MinValue ? Constants.C_DATE_MIN_VALUE : Details.CreditPurcStartDateToProcess;
                Details.CreditPurcEndDateToProcess = Details.CreditPurcEndDateToProcess == DateTime.MinValue ? Constants.C_DATE_MIN_VALUE : Details.CreditPurcEndDateToProcess;

                Details.BillingFile = dr["BillingFile"].ToString();
                Details.isBillPrinted = bool.Parse(dr["isBillPrinted"].ToString());

                Customer clsCustomer = new Customer(base.Connection, base.Transaction);
                Details.CustomerDetails = clsCustomer.Details(Details.ContactID);

                return Details;
            }
            catch (Exception ex)
            {
                throw base.ThrowException(ex);
            }
        }
Beispiel #4
0
        public BillingDetails Details(Int64 CustomerID, DateTime LastBillingDate, bool CheckIsBillPrinted = false, bool IsBillPrinted = false)
        {
            try
            {
                MySqlCommand cmd = new MySqlCommand();
                cmd.CommandType = System.Data.CommandType.Text;

                string SQL = SQLSelect();
                SQL += "WHERE 1=1 ";

                SQL += CheckIsBillPrinted ? (IsBillPrinted ? "AND IsBillPrinted = 1 " : "AND IsBillPrinted = 0 ") : "";

                if (LastBillingDate == Constants.C_DATE_MIN_VALUE)
                {
                    SQL += "AND CBL.BillingDate = (SELECT MAX(BillingDate) FROM tblCreditBills) ";
                }
                else
                {
                    SQL += "AND CBL.BillingDate = @BillingDate ";
                    cmd.Parameters.AddWithValue("BillingDate", LastBillingDate);
                }
                if (CustomerID != 0)
                {
                    SQL += "AND CUS.ContactID = @ContactID ";
                    cmd.Parameters.AddWithValue("ContactID", CustomerID);
                }

                cmd.CommandText = SQL;
                string strDataTableName = "tbl" + this.GetType().FullName.Split(new Char[] { '.' })[this.GetType().FullName.Split(new Char[] { '.' }).Length - 1]; System.Data.DataTable dt = new System.Data.DataTable(strDataTableName);
                base.MySqlDataAdapterFill(cmd, dt);

                BillingDetails Details = new BillingDetails();
                foreach (System.Data.DataRow dr in dt.Rows)
                {
                    Details.CreditBillHeaderID = Int64.Parse(dr["CreditBillHeaderID"].ToString());
                    Details.ContactID = Int64.Parse(dr["ContactID"].ToString());
                    Details.CrediLimit = decimal.Parse(dr["CreditLimit"].ToString());
                    Details.RunningCreditAmt = decimal.Parse(dr["RunningCreditAmt"].ToString());
                    Details.CurrMonthCreditAmt = decimal.Parse(dr["CurrMonthCreditAmt"].ToString());
                    Details.CurrMonthAmountPaid = decimal.Parse(dr["CurrMonthAmountPaid"].ToString());
                    Details.TotalBillCharges = decimal.Parse(dr["TotalBillCharges"].ToString());
                    Details.CurrentDueAmount = decimal.Parse(dr["CurrentDueAmount"].ToString());
                    Details.MinimumAmountDue = decimal.Parse(dr["MinimumAmountDue"].ToString());

                    Details.Prev1MoCurrentDueAmount = decimal.Parse(dr["Prev1MoCurrentDueAmount"].ToString());
                    Details.Prev1MoMinimumAmountDue = decimal.Parse(dr["Prev1MoMinimumAmountDue"].ToString());
                    Details.Prev1MoCurrMonthAmountPaid = decimal.Parse(dr["Prev1MoCurrMonthAmountPaid"].ToString());
                    Details.Prev2MoCurrentDueAmount = decimal.Parse(dr["Prev2MoCurrentDueAmount"].ToString());
                    Details.CurrentPurchaseAmt = decimal.Parse(dr["CurrentPurchaseAmt"].ToString());
                    Details.BeginningBalance = decimal.Parse(dr["BeginningBalance"].ToString());
                    Details.EndingBalance = decimal.Parse(dr["EndingBalance"].ToString());

                    Details.CreditCutOffDate = DateTime.Parse(dr["CreditCutOffDate"].ToString());
                    Details.CreditPaymentDueDate = DateTime.Parse(dr["CreditPaymentDueDate"].ToString());
                    Details.BillingDate = DateTime.Parse(dr["BillingDate"].ToString());
                    Details.CreditPurcStartDateToProcess = DateTime.Parse(dr["CreditPurcStartDateToProcess"].ToString());
                    Details.CreditPurcEndDateToProcess = DateTime.Parse(dr["CreditPurcEndDateToProcess"].ToString());
                    Details.BillingFile = dr["BillingFile"].ToString();
                    Details.isBillPrinted = bool.Parse(dr["isBillPrinted"].ToString());

                    Details.CardTypeDetails = new Data.CardTypeDetails()
                    {
                        CardTypeID = Int16.Parse(dr["CreditCardTypeID"].ToString()),
                        CardTypeCode = dr["CardTypeCode"].ToString(),
                        CardTypeName = dr["CardTypeName"].ToString(),
                        CreditFinanceCharge = decimal.Parse(dr["CreditFinanceCharge"].ToString()),
                        CreditLatePenaltyCharge = decimal.Parse(dr["CreditLatePenaltyCharge"].ToString()),
                        CreditMinimumAmountDue = decimal.Parse(dr["CreditMinimumAmountDue"].ToString()),
                        CreditMinimumPercentageDue = decimal.Parse(dr["CreditMinimumPercentageDue"].ToString()),
                        CreditFinanceCharge15th = decimal.Parse(dr["CreditFinanceCharge15th"].ToString()),
                        CreditLatePenaltyCharge15th = decimal.Parse(dr["CreditLatePenaltyCharge15th"].ToString()),
                        CreditMinimumAmountDue15th = decimal.Parse(dr["CreditMinimumAmountDue15th"].ToString()),
                        CreditMinimumPercentageDue15th = decimal.Parse(dr["CreditMinimumPercentageDue15th"].ToString()),
                        CreditPurcStartDateToProcess = DateTime.Parse(dr["CreditPurcStartDateToProcess"].ToString()),
                        CreditPurcEndDateToProcess = DateTime.Parse(dr["CreditPurcEndDateToProcess"].ToString()),
                        CreditCutOffDate = DateTime.Parse(dr["CreditCutOffDate"].ToString()),
                        CreditCardType = (CreditCardTypes)Enum.Parse(typeof(CreditCardTypes), dr["CreditCardType"].ToString()),
                        WithGuarantor = bool.Parse(dr["WithGuarantor"].ToString()),
                        BillingDate = DateTime.Parse(dr["BillingDate"].ToString())
                    };


                    Customer clsCustomer = new Customer(base.Connection, base.Transaction);
                    Details.CustomerDetails = clsCustomer.Details(Details.ContactID);
                }

                return Details;
            }
            catch (Exception ex)
            {
                throw base.ThrowException(ex);
            }
        }
Beispiel #5
0
        public BillingDetails Details(Int64 CustomerID, DateTime LastBillingDate, bool CheckIsBillPrinted = false, bool IsBillPrinted = false)
        {
            try
            {
                MySqlCommand cmd = new MySqlCommand();
                cmd.CommandType = System.Data.CommandType.Text;

                string SQL = SQLSelect();
                SQL += "WHERE 1=1 ";

                SQL += CheckIsBillPrinted ? (IsBillPrinted ? "AND IsBillPrinted = 1 " : "AND IsBillPrinted = 0 ") : "";

                if (LastBillingDate == Constants.C_DATE_MIN_VALUE)
                {
                    SQL += "AND CBL.BillingDate = (SELECT MAX(BillingDate) FROM tblCreditBills) ";
                }
                else
                {
                    SQL += "AND CBL.BillingDate = @BillingDate ";
                    cmd.Parameters.AddWithValue("BillingDate", LastBillingDate);
                }
                if (CustomerID != 0)
                {
                    SQL += "AND CUS.ContactID = @ContactID ";
                    cmd.Parameters.AddWithValue("ContactID", CustomerID);
                }

                cmd.CommandText = SQL;
                string strDataTableName = "tbl" + this.GetType().FullName.Split(new Char[] { '.' })[this.GetType().FullName.Split(new Char[] { '.' }).Length - 1]; System.Data.DataTable dt = new System.Data.DataTable(strDataTableName);
                base.MySqlDataAdapterFill(cmd, dt);

                BillingDetails Details = new BillingDetails();
                foreach (System.Data.DataRow dr in dt.Rows)
                {
                    Details.CreditBillHeaderID  = Int64.Parse(dr["CreditBillHeaderID"].ToString());
                    Details.ContactID           = Int64.Parse(dr["ContactID"].ToString());
                    Details.CrediLimit          = decimal.Parse(dr["CreditLimit"].ToString());
                    Details.RunningCreditAmt    = decimal.Parse(dr["RunningCreditAmt"].ToString());
                    Details.CurrMonthCreditAmt  = decimal.Parse(dr["CurrMonthCreditAmt"].ToString());
                    Details.CurrMonthAmountPaid = decimal.Parse(dr["CurrMonthAmountPaid"].ToString());
                    Details.TotalBillCharges    = decimal.Parse(dr["TotalBillCharges"].ToString());
                    Details.CurrentDueAmount    = decimal.Parse(dr["CurrentDueAmount"].ToString());
                    Details.MinimumAmountDue    = decimal.Parse(dr["MinimumAmountDue"].ToString());

                    Details.Prev1MoCurrentDueAmount    = decimal.Parse(dr["Prev1MoCurrentDueAmount"].ToString());
                    Details.Prev1MoMinimumAmountDue    = decimal.Parse(dr["Prev1MoMinimumAmountDue"].ToString());
                    Details.Prev1MoCurrMonthAmountPaid = decimal.Parse(dr["Prev1MoCurrMonthAmountPaid"].ToString());
                    Details.Prev2MoCurrentDueAmount    = decimal.Parse(dr["Prev2MoCurrentDueAmount"].ToString());
                    Details.CurrentPurchaseAmt         = decimal.Parse(dr["CurrentPurchaseAmt"].ToString());
                    Details.BeginningBalance           = decimal.Parse(dr["BeginningBalance"].ToString());
                    Details.EndingBalance = decimal.Parse(dr["EndingBalance"].ToString());

                    Details.CreditCutOffDate             = DateTime.Parse(dr["CreditCutOffDate"].ToString());
                    Details.CreditPaymentDueDate         = DateTime.Parse(dr["CreditPaymentDueDate"].ToString());
                    Details.BillingDate                  = DateTime.Parse(dr["BillingDate"].ToString());
                    Details.CreditPurcStartDateToProcess = DateTime.Parse(dr["CreditPurcStartDateToProcess"].ToString());
                    Details.CreditPurcEndDateToProcess   = DateTime.Parse(dr["CreditPurcEndDateToProcess"].ToString());
                    Details.BillingFile                  = dr["BillingFile"].ToString();
                    Details.isBillPrinted                = bool.Parse(dr["isBillPrinted"].ToString());

                    Details.CardTypeDetails = new Data.CardTypeDetails()
                    {
                        CardTypeID                     = Int16.Parse(dr["CreditCardTypeID"].ToString()),
                        CardTypeCode                   = dr["CardTypeCode"].ToString(),
                        CardTypeName                   = dr["CardTypeName"].ToString(),
                        CreditFinanceCharge            = decimal.Parse(dr["CreditFinanceCharge"].ToString()),
                        CreditLatePenaltyCharge        = decimal.Parse(dr["CreditLatePenaltyCharge"].ToString()),
                        CreditMinimumAmountDue         = decimal.Parse(dr["CreditMinimumAmountDue"].ToString()),
                        CreditMinimumPercentageDue     = decimal.Parse(dr["CreditMinimumPercentageDue"].ToString()),
                        CreditFinanceCharge15th        = decimal.Parse(dr["CreditFinanceCharge15th"].ToString()),
                        CreditLatePenaltyCharge15th    = decimal.Parse(dr["CreditLatePenaltyCharge15th"].ToString()),
                        CreditMinimumAmountDue15th     = decimal.Parse(dr["CreditMinimumAmountDue15th"].ToString()),
                        CreditMinimumPercentageDue15th = decimal.Parse(dr["CreditMinimumPercentageDue15th"].ToString()),
                        CreditPurcStartDateToProcess   = DateTime.Parse(dr["CreditPurcStartDateToProcess"].ToString()),
                        CreditPurcEndDateToProcess     = DateTime.Parse(dr["CreditPurcEndDateToProcess"].ToString()),
                        CreditCutOffDate               = DateTime.Parse(dr["CreditCutOffDate"].ToString()),
                        CreditCardType                 = (CreditCardTypes)Enum.Parse(typeof(CreditCardTypes), dr["CreditCardType"].ToString()),
                        WithGuarantor                  = bool.Parse(dr["WithGuarantor"].ToString()),
                        BillingDate                    = DateTime.Parse(dr["BillingDate"].ToString())
                    };


                    Customer clsCustomer = new Customer(base.Connection, base.Transaction);
                    Details.CustomerDetails = clsCustomer.Details(Details.ContactID);
                }

                return(Details);
            }
            catch (Exception ex)
            {
                throw base.ThrowException(ex);
            }
        }