Beispiel #1
0
        private void btnApprove_Click(object sender, EventArgs e)
        {
            try
            {
                Settlement_InfoController STMCtrl = new Settlement_InfoController();
                MemberBankDetailTransactionInfoCollections MBStmColl = new MemberBankDetailTransactionInfoCollections();
                MemberBankDetailTransactionInfoInfo        MBInfo;

                for (int i = 0; i < dgvRefundLog.Rows.Count; i++)
                {
                    string hostname = Dns.GetHostName();
                    string myIP     = Dns.GetHostEntry(hostname).AddressList[0].ToString();

                    if (Convert.ToString(dgvRefundLog.Rows[i].Cells["Approve"].Value) == "1" && Convert.ToString(dgvRefundLog.Rows[i].Cells["FileType"].Value) == "MBA")
                    {
                        MBInfo     = new MemberBankDetailTransactionInfoInfo();
                        MBInfo.PAN = Convert.ToString(dgvRefundLog.Rows[i].Cells["PAN"].Value);
                        MBInfo.settlementAmount  = Convert.ToDecimal(dgvRefundLog.Rows[i].Cells["settlementAmount"].Value);
                        MBInfo.transAmount       = Convert.ToDecimal(dgvRefundLog.Rows[i].Cells["transAmount"].Value);
                        MBInfo.ServiceFeeReceive = Convert.ToDecimal(dgvRefundLog.Rows[i].Cells["ServiceFeeReceive"].Value);
                        MBInfo.ServiceFeePayable = Convert.ToDecimal(dgvRefundLog.Rows[i].Cells["ServiceFeePayable"].Value);
                        MBInfo.FILENAME          = Convert.ToString(dgvRefundLog.Rows[i].Cells["FILENAME"].Value);
                        MBInfo.RefundStatus      = "A";
                        MBInfo.FileType          = Convert.ToString(dgvRefundLog.Rows[i].Cells["FileType"].Value);
                        MBInfo.SETTLEMENTDATE    = DateTime.Parse(dgvRefundLog.Rows[i].Cells["SETTLEMENTDATE"].Value.ToString());
                        MBStmColl.Add(MBInfo);
                    }
                    else if (Convert.ToString(dgvRefundLog.Rows[i].Cells["Approve"].Value) == "1" && Convert.ToString(dgvRefundLog.Rows[i].Cells["FileType"].Value) == "MBI")
                    {
                        MBInfo     = new MemberBankDetailTransactionInfoInfo();
                        MBInfo.PAN = Convert.ToString(dgvRefundLog.Rows[i].Cells["PAN"].Value);
                        MBInfo.settlementAmount  = Convert.ToDecimal(dgvRefundLog.Rows[i].Cells["settlementAmount"].Value);
                        MBInfo.transAmount       = Convert.ToDecimal(dgvRefundLog.Rows[i].Cells["transAmount"].Value);
                        MBInfo.ServiceFeeReceive = Convert.ToDecimal(dgvRefundLog.Rows[i].Cells["ServiceFeeReceive"].Value);
                        MBInfo.ServiceFeePayable = Convert.ToDecimal(dgvRefundLog.Rows[i].Cells["ServiceFeePayable"].Value);
                        MBInfo.FILENAME          = Convert.ToString(dgvRefundLog.Rows[i].Cells["FILENAME"].Value);
                        MBInfo.RefundStatus      = "A";
                        MBInfo.FileType          = Convert.ToString(dgvRefundLog.Rows[i].Cells["FileType"].Value);
                        MBInfo.SETTLEMENTDATE    = DateTime.Parse(dgvRefundLog.Rows[i].Cells["SETTLEMENTDATE"].Value.ToString());
                        MBStmColl.Add(MBInfo);
                    }
                } //end of for loop

                if (MBStmColl.Count > 0)
                {
                    STMCtrl.UpdateRefundStatus(MBStmColl); // Update Refund Status
                }
                if (MBStmColl.Count <= 0)
                {
                    MessageBox.Show("There is no row to process.");
                }
                DataRetrieve();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Beispiel #2
0
        private void btnReject_Click(object sender, EventArgs e)
        {
            try
            {
                Settlement_InfoController  STMCtrl   = new Settlement_InfoController();
                Settlement_InfoCollections MBStmColl = new Settlement_InfoCollections();
                Settlement_InfoCollections MCStmColl = new Settlement_InfoCollections();
                Settlement_InfoInfo        MerchantStmInfo;
                Settlement_InfoInfo        MemberStmInfo;

                string hostname = Dns.GetHostName();
                string myIP     = Dns.GetHostByName(hostname).AddressList[0].ToString();

                for (int i = 0; i < dgvSettlementLog.Rows.Count; i++)
                {
                    if (Convert.ToString(dgvSettlementLog.Rows[i].Cells["Approve"].Value) == "1" && Convert.ToString(dgvSettlementLog.Rows[i].Cells["FileType"].Value) == "MC")
                    {
                        MerchantStmInfo = new Settlement_InfoInfo();
                        MerchantStmInfo.MerchantCode   = Convert.ToString(dgvSettlementLog.Rows[i].Cells["MerchantCode"].Value);
                        MerchantStmInfo.FileType       = Convert.ToString(dgvSettlementLog.Rows[i].Cells["FileType"].Value);
                        MerchantStmInfo.SettlementDate = Convert.ToDateTime(dgvSettlementLog.Rows[i].Cells["SettlementDate"].Value);
                        MerchantStmInfo.Status         = "R";
                        MerchantStmInfo.RejectBy       = "";
                        MerchantStmInfo.RejectFrom     = myIP;
                        MCStmColl.Add(MerchantStmInfo);
                    }
                    else if (Convert.ToString(dgvSettlementLog.Rows[i].Cells["Approve"].Value) == "1" && Convert.ToString(dgvSettlementLog.Rows[i].Cells["FileType"].Value) == "MB")
                    {
                        MemberStmInfo                = new Settlement_InfoInfo();
                        MemberStmInfo.MPUDfCode      = Convert.ToString(dgvSettlementLog.Rows[i].Cells["MPUDfCode"].Value);
                        MemberStmInfo.FileType       = Convert.ToString(dgvSettlementLog.Rows[i].Cells["FileType"].Value);
                        MemberStmInfo.SettlementDate = Convert.ToDateTime(dgvSettlementLog.Rows[i].Cells["SettlementDate"].Value);
                        MemberStmInfo.Status         = "R";
                        MemberStmInfo.RejectBy       = "";
                        MemberStmInfo.RejectFrom     = myIP;
                        MBStmColl.Add(MemberStmInfo);
                        MPUSettlementStatusRecord(i, MemberStmInfo.Status);
                    }
                }
                if (MBStmColl.Count > 0)
                {
                    STMCtrl.UpdateByMemberCode(MBStmColl);
                }
                if (MCStmColl.Count > 0)
                {
                    STMCtrl.UpdateByMerchantCode(MCStmColl);
                }
                if (MCStmColl.Count <= 0 && MBStmColl.Count <= 0)
                {
                    MessageBox.Show("There is no row to process.");
                }
                DataRetrieve();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Beispiel #3
0
 private void DataRetrieve()
 {
     try
     {
         Settlement_InfoController STFCtrl = new Settlement_InfoController();
         dgvRefundLog.AutoGenerateColumns = false;
         _dataSource             = STFCtrl.SelectRefundList(clsGlobal.vSTFDate.ToString("yyyy/MM/dd"));
         dgvRefundLog.DataSource = _dataSource;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Beispiel #4
0
        private void btnApprove_Click(object sender, EventArgs e)
        {
            try
            {
                Settlement_InfoController  STMCtrl   = new Settlement_InfoController();
                Settlement_InfoCollections MBStmColl = new Settlement_InfoCollections();
                Settlement_InfoCollections MCStmColl = new Settlement_InfoCollections();
                Settlement_InfoInfo        MerchantStmInfo;
                Settlement_InfoInfo        MemberStmInfo;

                for (int i = 0; i < dgvSettlementLog.Rows.Count; i++)
                {
                    string hostname = Dns.GetHostName();
                    string myIP     = Dns.GetHostEntry(hostname).AddressList[0].ToString();

                    if (Convert.ToString(dgvSettlementLog.Rows[i].Cells["Approve"].Value) == "1" && Convert.ToString(dgvSettlementLog.Rows[i].Cells["FileType"].Value) == "MC")
                    {
                        MerchantStmInfo = new Settlement_InfoInfo();
                        MerchantStmInfo.MerchantCode   = Convert.ToString(dgvSettlementLog.Rows[i].Cells["MerchantCode"].Value);
                        MerchantStmInfo.Status         = "A";
                        MerchantStmInfo.ApproveBy      = "";
                        MerchantStmInfo.ApproveFrom    = myIP;
                        MerchantStmInfo.FileType       = Convert.ToString(dgvSettlementLog.Rows[i].Cells["FileType"].Value);
                        MerchantStmInfo.SettlementDate = Convert.ToDateTime(dgvSettlementLog.Rows[i].Cells["SettlementDate"].Value);
                        MCStmColl.Add(MerchantStmInfo);
                    }
                    else if (Convert.ToString(dgvSettlementLog.Rows[i].Cells["Approve"].Value) == "1" && Convert.ToString(dgvSettlementLog.Rows[i].Cells["FileType"].Value) == "MB")
                    {
                        if (dgvSettlementLog.Rows[i].ErrorText != string.Empty)
                        {
                            if (MessageBox.Show(dgvSettlementLog.Rows[i].ErrorText + Environment.NewLine + "Do you want to do it?", this.Text, MessageBoxButtons.YesNo) == DialogResult.No)
                            {
                                break;
                            }
                        }
                        MemberStmInfo                = new Settlement_InfoInfo();
                        MemberStmInfo.MPUDfCode      = Convert.ToString(dgvSettlementLog.Rows[i].Cells["MPUDfCode"].Value);
                        MemberStmInfo.Status         = "A";
                        MemberStmInfo.ApproveBy      = "";
                        MemberStmInfo.ApproveFrom    = myIP;
                        MemberStmInfo.FileType       = Convert.ToString(dgvSettlementLog.Rows[i].Cells["FileType"].Value);
                        MemberStmInfo.SettlementDate = Convert.ToDateTime(dgvSettlementLog.Rows[i].Cells["SettlementDate"].Value);
                        MBStmColl.Add(MemberStmInfo);
                        MPUSettlementStatusRecord(i, MemberStmInfo.Status);
                    }
                }

                if (MBStmColl.Count > 0)
                {
                    STMCtrl.UpdateByMemberCode(MBStmColl);
                    DataRetrieve();
                    MerchantSettlementFieldsShow();
                }

                if (MCStmColl.Count > 0)
                {
                    STMCtrl.UpdateByMerchantCode(MCStmColl);
                    DataRetrieve();
                    MemberBankSettlementFieldsShow();
                }

                if (MCStmColl.Count <= 0 && MBStmColl.Count <= 0)
                {
                    MessageBox.Show("There is no row to process.");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }