Example #1
0
        public bool Save()
        {
            dbConnect con = new dbConnect();
            bool      ret = false;

            try
            {
                int id = this.ELoadTrans_Id;
                ret = con.SaveELoad(this, ref id);
                this.ELoadTrans_Id = id;
                if (ret)
                {
                    clsLoadAccount load = clsLoadAccount.GetLoadAccount(this.Load_Id);
                    if (load != null)
                    {
                        clsReloadHistory reload = new clsReloadHistory();
                        reload.Load_Id           = this.Load_Id;
                        reload.RefNum            = this.RefNum;
                        reload.Timestamp         = DateTime.Now;
                        reload.UserId            = this.userid;
                        reload.EcashTransId      = this.ELoadTrans_Id;
                        reload.Amount            = -this.Transaction_Amount;
                        reload.TransactionAmount = this.amountdue;

                        reload.RemainingBalance = dbConnect.GetRemainingLoadBalance(this.Load_Id) + reload.Amount;
                        reload.Remarks          = string.Format("Eload (Load Account:{0} Amount:{1:0.00} Remaining Balance:{2:0.00})", load.AccountNum, reload.Amount, reload.RemainingBalance);
                        reload.Save();

                        reload.Amount            = this.Rebate;
                        reload.Remarks           = "Rebate";
                        reload.TransactionAmount = 0;
                        reload.RemainingBalance  = dbConnect.GetRemainingLoadBalance(this.Load_Id) + reload.Amount;
                        reload.Remarks           = string.Format("Rebate (Load Account:{0} Amount:{1:0.00} Remaining Balance:{2:0.00})", load.AccountNum, reload.Amount, reload.RemainingBalance);
                        reload.Save();

                        load.CurrentBalance   = dbConnect.GetRemainingLoadBalance(this.Load_Id);
                        load.AvailableBalance = load.CurrentBalance;
                        load.Save();
                    }
                }
            }
            catch { }
            con.Close();
            return(ret);
        }
Example #2
0
        public bool Save()
        {
            dbConnect con = new dbConnect();
            bool      ret = false;

            try
            {
                int id = this.LoadwalletTransId;
                ret = con.SaveLoadWallet(this, ref id);
                this.LoadwalletTransId = id;
                if (ret)
                {
                    clsLoadAccount load = clsLoadAccount.GetLoadAccount(this.Load_Id);
                    if (load != null)
                    {
                        clsReloadHistory reload = new clsReloadHistory();
                        reload.Load_Id           = this.Load_Id;
                        reload.Timestamp         = DateTime.Now;
                        reload.UserId            = this.UserId;
                        reload.EcashTransId      = this.LoadwalletTransId;
                        reload.Amount            = -this.LoadAmount;
                        reload.TransactionAmount = this.AmtDue;

                        reload.RemainingBalance = dbConnect.GetRemainingLoadBalance(this.Load_Id) + reload.Amount;
                        reload.Save();

                        load.CurrentBalance   = dbConnect.GetRemainingLoadBalance(this.Load_Id);
                        load.AvailableBalance = load.CurrentBalance;
                        load.Save();
                    }
                }
            }
            catch { }
            con.Close();
            return(ret);
        }
Example #3
0
        public bool Save()
        {
            dbConnect con = new dbConnect();
            bool      ret = false;

            try
            {
                int id = this.SCashTransId;
                ret = con.SaveSCash(this, ref id);
                this.SCashTransId = id;
                if (ret)
                {
                    clsLoadAccount load = clsLoadAccount.GetLoadAccount(this.Load_Id);
                    if (load != null)
                    {
                        clsReloadHistory reload = new clsReloadHistory();
                        reload.Load_Id      = this.Load_Id;
                        reload.RefNum       = this.refNum;
                        reload.Timestamp    = DateTime.Now;
                        reload.UserId       = this.userid;
                        reload.EcashTransId = this.SCashTransId;
                        reload.Remarks      = this.Remarks;
                        switch (TransType)
                        {
                        case SCashTranstype.SEND:
                            reload.Amount            = Properties.Settings.Default.SmartPadalaSendSvc ? -(this.TransAmount + this.SvcFeeAmount) : -this.TransAmount;
                            reload.RemainingBalance  = dbConnect.GetRemainingLoadBalance(this.Load_Id) + reload.Amount;
                            reload.TransactionAmount = (this.TransAmount + this.SvcFeeAmount);
                            reload.Save();

                            if (Properties.Settings.Default.SmartPadalaSendRebate && this.Rebate > 0)
                            {
                                reload.Amount            = this.Rebate;
                                reload.Remarks           = "Rebate";
                                reload.RemainingBalance  = dbConnect.GetRemainingLoadBalance(this.Load_Id) + reload.Amount;
                                reload.TransactionAmount = 0;
                                reload.ReloadType        = (int)ReloadType.REBATE;
                                reload.Save();
                            }
                            break;

                        case SCashTranstype.ENCASH:

                            reload.Amount            = this.TransAmount;// + this.SvcFeeAmount;
                            reload.RemainingBalance  = dbConnect.GetRemainingLoadBalance(this.Load_Id) + reload.Amount;
                            reload.TransactionAmount = -(this.TransAmount - this.SvcFeeAmount);
                            reload.Save();

                            //if (Properties.Settings.Default.SmartPadalaIncashRebate && this.Rebate > 0)
                            //{
                            //    reload.Amount = this.Rebate;
                            //    reload.RemainingBalance = dbConnect.GetRemainingLoadBalance(this.Load_Id) + reload.Amount;
                            //    reload.Remarks = "Rebate";
                            //    reload.TransactionAmount = 0;
                            //    reload.ReloadType = (int)ReloadType.REBATE;
                            //    reload.Save();
                            //}
                            break;
                        }
                        load.CurrentBalance   = dbConnect.GetRemainingLoadBalance(this.Load_Id);
                        load.AvailableBalance = load.CurrentBalance;
                        load.Save();
                    }
                }
            }
            catch { }
            con.Close();
            return(ret);
        }
Example #4
0
        public bool Save()
        {
            dbConnect con = new dbConnect();
            bool      ret = false;

            try
            {
                int id = this.GCashtTransId;
                ret = con.SaveGCash(this, ref id);
                this.GCashtTransId = id;
                if (ret)
                {
                    clsLoadAccount load = clsLoadAccount.GetLoadAccount(this.Load_Id);
                    if (load != null)
                    {
                        clsReloadHistory reload = new clsReloadHistory();
                        reload.Load_Id      = this.Load_Id;
                        reload.RefNum       = this.refNum;
                        reload.Timestamp    = DateTime.Now;
                        reload.UserId       = this.userid;
                        reload.EcashTransId = this.GCashtTransId;
                        reload.Remarks      = this.Remarks;
                        switch (TransactionType)
                        {
                        case GCashTransType.CashIn:
                            reload.Amount            = Properties.Settings.Default.CashInSvc ? -(this.TransAmount + this.SvcFeeAmount) : -this.TransAmount;
                            reload.RemainingBalance  = dbConnect.GetRemainingLoadBalance(this.Load_Id) + reload.Amount;
                            reload.TransactionAmount = (this.TransAmount + this.SvcFeeAmount);
                            reload.Save();

                            if (Properties.Settings.Default.CashInRebate && this.Rebate > 0)
                            {
                                reload.Amount            = this.Rebate;
                                reload.Remarks           = string.Format("Rebate from Refnum:{0}", reload.RefNum);
                                reload.RemainingBalance  = dbConnect.GetRemainingLoadBalance(this.Load_Id) + reload.Amount;
                                reload.TransactionAmount = 0;
                                reload.ReloadType        = (int)ReloadType.REBATE;
                                reload.Save();
                            }
                            break;

                        case GCashTransType.SendToOthers:
                            reload.Amount            = Properties.Settings.Default.SendToOthersSvc ? -(this.TransAmount + this.SvcFeeAmount) : -this.TransAmount;
                            reload.RemainingBalance  = dbConnect.GetRemainingLoadBalance(this.Load_Id) + reload.Amount;
                            reload.TransactionAmount = (this.TransAmount + this.SvcFeeAmount);
                            reload.Save();

                            if (Properties.Settings.Default.SendToOthersRebate && this.Rebate > 0)
                            {
                                reload.Amount            = this.Rebate;
                                reload.RemainingBalance  = dbConnect.GetRemainingLoadBalance(this.Load_Id) + reload.Amount;
                                reload.Remarks           = "Rebate";
                                reload.TransactionAmount = 0;
                                reload.ReloadType        = (int)ReloadType.REBATE;
                                reload.Save();
                            }
                            break;

                        case GCashTransType.CashOut:
                            reload.Amount            = Properties.Settings.Default.CashOutSvc ? (this.TransAmount - this.SvcFeeAmount) : this.TransAmount;
                            reload.RemainingBalance  = dbConnect.GetRemainingLoadBalance(this.Load_Id) + reload.Amount;
                            reload.TransactionAmount = -(this.TransAmount - this.SvcFeeAmount);
                            reload.Save();
                            if (Properties.Settings.Default.CashOutRebate && this.Rebate > 0)
                            {
                                reload.Amount            = this.Rebate;
                                reload.RemainingBalance  = dbConnect.GetRemainingLoadBalance(this.Load_Id) + reload.Amount;
                                reload.Remarks           = "Rebate";
                                reload.TransactionAmount = 0;
                                reload.ReloadType        = (int)ReloadType.REBATE;
                                reload.Save();
                            }
                            break;

                        case GCashTransType.IntCashPickUp:
                            reload.Amount            = Properties.Settings.Default.IntCashPickUpSvc ? (this.TransAmount + this.SvcFeeAmount) : this.transAmount;
                            reload.RemainingBalance  = dbConnect.GetRemainingLoadBalance(this.Load_Id) + reload.Amount;
                            reload.TransactionAmount = -(this.TransAmount);
                            reload.Save();
                            if (Properties.Settings.Default.IntCashPickUpRebate && this.Rebate > 0)
                            {
                                reload.Amount            = this.Rebate;
                                reload.RemainingBalance  = dbConnect.GetRemainingLoadBalance(this.Load_Id) + reload.Amount;
                                reload.Remarks           = "Rebate";
                                reload.TransactionAmount = 0;
                                reload.ReloadType        = (int)ReloadType.REBATE;
                                reload.Save();
                            }
                            break;

                        case GCashTransType.DomCashPickup:
                            reload.Amount            = Properties.Settings.Default.DomCashPickupSvc ? (this.TransAmount + this.SvcFeeAmount) : this.TransAmount;
                            reload.RemainingBalance  = dbConnect.GetRemainingLoadBalance(this.Load_Id) + reload.Amount;
                            reload.TransactionAmount = -(this.TransAmount);
                            reload.Save();
                            if (Properties.Settings.Default.DomCashPickupRebate && this.Rebate > 0)
                            {
                                reload.Amount            = this.Rebate;
                                reload.RemainingBalance  = dbConnect.GetRemainingLoadBalance(this.Load_Id) + reload.Amount;
                                reload.Remarks           = "Rebate";
                                reload.TransactionAmount = 0;
                                reload.ReloadType        = (int)ReloadType.REBATE;
                                reload.Save();
                            }
                            break;

                        case GCashTransType.RemitSend:
                            reload.Amount            = Properties.Settings.Default.RemitSendSvc ? -(this.TransAmount + this.SvcFeeAmount) : -this.TransAmount;
                            reload.RemainingBalance  = dbConnect.GetRemainingLoadBalance(this.Load_Id) + reload.Amount;
                            reload.TransactionAmount = (this.TransAmount + this.SvcFeeAmount);
                            reload.Save();
                            if (Properties.Settings.Default.RemitSendRebate && this.Rebate > 0)
                            {
                                reload.Amount            = this.Rebate;
                                reload.RemainingBalance  = dbConnect.GetRemainingLoadBalance(this.Load_Id) + reload.Amount;
                                reload.Remarks           = "Rebate";
                                reload.TransactionAmount = 0;
                                reload.ReloadType        = (int)ReloadType.REBATE;
                                reload.Save();
                            }
                            break;

                        case GCashTransType.RemitCancel:
                            reload.Amount            = Properties.Settings.Default.RemitCancelSvc ? (this.TransAmount + this.SvcFeeAmount) : this.TransAmount;
                            reload.RemainingBalance  = dbConnect.GetRemainingLoadBalance(this.Load_Id) + reload.Amount;
                            reload.TransactionAmount = Properties.Settings.Default.ChargeServiceFeeOnCancelRemittance ? -(this.TransAmount - this.SvcFeeAmount) : -this.TransAmount;

                            reload.Save();
                            if (Properties.Settings.Default.RemitCancelRebate && this.Rebate > 0)
                            {
                                reload.Amount            = this.Rebate;
                                reload.RemainingBalance  = dbConnect.GetRemainingLoadBalance(this.Load_Id) + reload.Amount;
                                reload.Remarks           = "Rebate";
                                reload.TransactionAmount = 0;
                                reload.ReloadType        = (int)ReloadType.REBATE;
                                reload.Save();
                            }
                            break;
                        }
                        load.CurrentBalance   = dbConnect.GetRemainingLoadBalance(this.Load_Id);
                        load.AvailableBalance = load.CurrentBalance;
                        load.Save();
                    }
                }
            }
            catch { }
            con.Close();
            return(ret);
        }