コード例 #1
0
        int doDowunload()
        {
            try
            {
                //    SplashScreenManager.ShowForm(this, typeof(WaitForm1), true, true, false);

                System.Data.DataSet dsonline = new System.Data.DataSet();

                using (SqlConnection connect = new SqlConnection(Logic.ConnectionString))
                {
                    connect.Open();

                    command = new SqlCommand("doGetStationInfo", connect)
                    {
                        CommandType = CommandType.StoredProcedure, CommandTimeout = 0
                    };

                    using (System.Data.DataSet ds = new System.Data.DataSet())
                    {
                        adp = new SqlDataAdapter(command);

                        adp.SelectCommand.CommandTimeout = 0;

                        adp.Fill(ds);

                        Dts = ds.Tables[0];

                        connect.Close();

                        if (ds.Tables[0].Rows.Count < 1)
                        {
                            label7.Text = "Not Configured for this station";
                            return(0);
                        }
                        else
                        {
                            label5.Text = string.Format("Receipt Data Download [ {0} ]", ds.Tables[0].Rows[0]["StationName"]);

                            switch (Program.intCode)
                            {
                            case 13:    //Akwa Ibom state
                                using (var receiptAka = new AkwaIbomReceiptServices.ReceiptService())
                                {
                                    dataSet = receiptAka.DownloadData(ds, Program.stateCode);
                                }

                                if (dataSet.Tables.Count == 0)
                                {
                                    timer1.Stop(); timer1.Enabled = false;
                                    //btnStop.Visible = false; btnStart.Visible = true;
                                    return(0);
                                }
                                if (dataSet.Tables[0].Rows.Count < 1)
                                {
                                    label7.Text = String.Format("No More Records for the Station {0}", Program.stationName);
                                    timer1.Stop(); timer1.Enabled = false;
                                    //btnStop.Visible = false; btnStart.Visible = true;
                                    return(0);
                                }
                                else
                                {
                                    dataSet2 = InsertData(dataSet);
                                }

                                if (dataSet2.Tables[0].Rows[0]["returnCode"].ToString() == "-1")
                                {
                                    timer1.Stop();
                                    Common.setMessageBox(string.Format("{0}...Error Occur During Data Insert After download.... Insert Download", dataSet2.Tables[0].Rows[0]["returnMessage"]), Program.ApplicationName, 3);
                                    timer1.Stop();
                                    timer1.Enabled = false;
                                    return(0);
                                }
                                else
                                {
                                    dataSet3.Clear();
                                    using (var receiptAka = new AkwaIbomReceiptServices.ReceiptService())
                                    {
                                        dataSet3 = receiptAka.DownloadDataUpdate(dataSet2, Program.stationCode);
                                    }
                                }
                                break;

                            case 20:    //Delta State
                                using (var receiptDelta = new DeltaBir.ReceiptService())
                                {
                                    System.Data.DataSet dsnew = new System.Data.DataSet();
                                    //dsnew = Logic.GetMacAddress();
                                    //gridControl1.DataSource = dsnew.Tables[0];
                                    //gridControl1.DataSource = Logic.GetMacAddress();
                                    dataSet = receiptDelta.DownloadData(Logic.GetMacAddress(), Program.stationCode);
                                }

                                if (dataSet.Tables.Count == 0)
                                {
                                    timer1.Stop(); timer1.Enabled = false;
                                    //btnStop.Visible = false; btnStart.Visible = true;
                                    return(0);
                                }

                                if (dataSet.Tables[0].Rows[0]["returnCode"].ToString() == "-1")
                                {
                                    timer1.Stop();
                                    Common.setMessageBox(string.Format("{0}...Status Messages", dataSet.Tables[0].Rows[0]["returnMessage"]), Program.ApplicationName, 3);
                                    btnStart.Visible = true;
                                    timer1.Enabled   = false;
                                    return(0);
                                }
                                if (dataSet.Tables[1] != null && dataSet.Tables[1].Rows.Count < 1)
                                {
                                    label7.Text = String.Format("No More Records for the Station {0}", Program.stationName);
                                    timer1.Stop(); timer1.Enabled = false;
                                    btnStop.Visible = false; btnStart.Visible = true; btnStart.Enabled = true;
                                    return(0);
                                }
                                else
                                {
                                    dataSet2 = InsertData(dataSet);

                                    if (dataSet2.Tables[0].Rows[0]["returnCode"].ToString() == "-1")
                                    {
                                        Common.setMessageBox(string.Format("{0}...Error Occur During Data Insert After download.... Insert Download", dataSet2.Tables[0].Rows[0]["returnMessage"]), Program.ApplicationName, 3);
                                        timer1.Stop();
                                        timer1.Enabled = false;
                                        return(0);
                                    }
                                    else
                                    {
                                        dataSet3.Clear();

                                        //dsonline = dataSet2.Tables[1];

                                        DataTable dtt = new DataTable();
                                        dtt = dataSet2.Tables[1].Copy();

                                        //dtsoff = ds.Tables[2].DataSet;
                                        dsonline.Tables.Add(dtt);

                                        using (var receiptDelta = new DeltaBir.ReceiptService())
                                        {
                                            dataSet3 = receiptDelta.DownloadDataUpdate(dsonline, Program.stationCode);
                                        }
                                    }
                                }

                                break;

                            case 32:    //kogi state
                                break;

                            case 37:    //ogun state

                                using (var receiptsserv = new ReceiptService())
                                {
                                    System.Data.DataSet dsnew = new System.Data.DataSet();
                                    //dsnew = Logic.GetMacAddress();
                                    //gridControl1.DataSource = dsnew.Tables[0];
                                    dataSet = receiptsserv.DownloadData(Logic.GetMacAddress(), Program.stationCode);
                                }

                                if (dataSet.Tables[0].Rows[0]["returnCode"].ToString() == "-1")
                                {
                                    timer1.Stop();
                                    Common.setMessageBox(string.Format("{0}...Status Messages", dataSet.Tables[0].Rows[0]["returnMessage"]), Program.ApplicationName, 3);
                                    btnStart.Visible = true;
                                    timer1.Enabled   = false;
                                    return(0);
                                }

                                if (dataSet.Tables.Count == 0)
                                {
                                    timer1.Stop(); timer1.Enabled = false;
                                    //btnStop.Visible = false; btnStart.Visible = true;
                                    return(0);
                                }

                                if (dataSet.Tables[1] != null && dataSet.Tables[1].Rows.Count < 1)
                                {
                                    label7.Text = String.Format("No More Records for the Station {0}", Program.stationName);
                                    timer1.Stop(); timer1.Enabled = false;
                                    btnStop.Visible = false; btnStart.Visible = true; btnStart.Enabled = true;
                                    return(0);
                                }
                                else
                                {
                                    dataSet2 = InsertData(dataSet);

                                    if (dataSet2.Tables[0].Rows[0]["returnCode"].ToString() == "-1")
                                    {
                                        Common.setMessageBox(string.Format("{0}...Error Occur During Data Insert After download.... Insert Download", dataSet2.Tables[0].Rows[0]["returnMessage"]), Program.ApplicationName, 3);
                                        timer1.Stop();
                                        timer1.Enabled = false;
                                        return(0);
                                    }
                                    else
                                    {
                                        dataSet3.Clear();

                                        using (var receiptsserv = new ReceiptService())
                                        {
                                            dataSet3 = receiptsserv.DownloadDataUpdate(dataSet2, Program.stationCode);
                                        }
                                    }
                                }
                                break;

                            case 40:    //oyo state

                                using (var receiptsServices = new OyoReceiptServices.ReceiptService())
                                {
                                    System.Data.DataSet dsnew = new System.Data.DataSet();
                                    dsnew = Logic.GetMacAddress();
                                    gridControl1.DataSource = dsnew.Tables[0];
                                    dataSet = receiptsServices.DownloadData(Logic.GetMacAddress(), Program.stationCode);
                                }

                                if (dataSet.Tables[0].Rows[0]["returnCode"].ToString() == "-1")
                                {
                                    timer1.Stop();
                                    Common.setMessageBox(string.Format("{0}...Status Messages", dataSet.Tables[0].Rows[0]["returnMessage"]), Program.ApplicationName, 3);
                                    btnStart.Visible = true;
                                    timer1.Enabled   = false;
                                    return(0);
                                }

                                if (dataSet.Tables.Count == 0)
                                {
                                    timer1.Stop(); timer1.Enabled = false;
                                    //btnStop.Visible = false; btnStart.Visible = true;
                                    return(0);
                                }

                                if (dataSet.Tables[1] != null && dataSet.Tables[1].Rows.Count < 1)
                                {
                                    label7.Text = String.Format("No More Records for the Station {0}", Program.stationName);
                                    timer1.Stop(); timer1.Enabled = false;
                                    btnStop.Visible = false; btnStart.Visible = true; btnStart.Enabled = true;
                                    return(0);
                                }
                                else
                                {
                                    dataSet2 = InsertData(dataSet);

                                    if (dataSet2.Tables[0].Rows[0]["returnCode"].ToString() == "-1")
                                    {
                                        Common.setMessageBox(string.Format("{0}...Error Occur During Data Insert After download.... Insert Download", dataSet2.Tables[0].Rows[0]["returnMessage"]), Program.ApplicationName, 3);
                                        timer1.Stop();
                                        timer1.Enabled = false;
                                        return(0);
                                    }
                                    else
                                    {
                                        dataSet3.Clear();

                                        using (var receiptsServices = new OyoReceiptServices.ReceiptService())
                                        {
                                            dataSet3 = receiptsServices.DownloadDataUpdate(dataSet2, Program.stationCode);
                                        }
                                    }
                                }
                                break;

                            default:
                                break;
                            }
                            if (dataSet3.Tables[0].Rows[0]["returnCode"].ToString() == "00")
                            {
                                lblAll.Text = dataSet3.Tables[1].Rows[0]["ALLRecords"].ToString();

                                lblDownload.Text = dataSet3.Tables[2].Rows[0]["DownloadedRecords"].ToString();

                                lblRemain.Text = dataSet3.Tables[3].Rows[0]["RemainRecords"].ToString();

                                lblError.Text = dataSet3.Tables[4].Rows[0]["ErrorRecords"].ToString();

                                return(1);
                            }
                            else
                            {
                                timer1.Stop();
                                Common.setMessageBox(string.Format("{0}...Download Data to Local Station...", dataSet3.Tables[0].Rows[0]["returnMessage"]), Program.ApplicationName, 3);
                                timer1.Enabled = false;
                                //btnStop.Visible = false;
                                //btnStart.Visible = true;
                                return(0);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                timer1.Stop();
                Common.setMessageBox(String.Format("{0}----{1}...Do Download to Station,doDowunload", ex.Message, ex.StackTrace), Program.ApplicationName, 3); timer1.Stop(); timer1.Enabled = false;
                return(0);
            }
            finally
            {
                //SplashScreenManager.CloseForm(false);
            }
        }
コード例 #2
0
        void doUpload()
        {
            try
            {
                //SplashScreenManager.ShowForm(this, typeof(WaitForm1), true, true, false);

                using (SqlConnection connect = new SqlConnection(Logic.ConnectionString))
                {
                    connect.Open();

                    command = new SqlCommand("doGetStationPrintedReceipt", connect)
                    {
                        CommandType = CommandType.StoredProcedure
                    };

                    command.CommandTimeout = 0;

                    using (System.Data.DataSet ds = new System.Data.DataSet())
                    {
                        adp = new SqlDataAdapter(command);

                        adp.SelectCommand.CommandTimeout = 0;

                        adp.Fill(ds);

                        Dts = ds.Tables[0];

                        connect.Close();

                        if (ds.Tables[0].Rows.Count < 1)
                        {
                            //if (label8.InvokeRequired)
                            //{
                            //    label8.Invoke(new MethodInvoker(delegate { label7.Text = "No More Records to Upload"; }));
                            //}
                            //else
                            //{
                            label8.Text = "No More Records to Upload";
                            timer2.Stop(); timer2.Enabled = false;
                            //}
                            if (isTimer1Call)
                            {
                                lblStatus.Visible = false;
                            }
                            timer1.Enabled = true;
                            timer1.Start();

                            //label8.Text = "No More Records to Upload";

                            //m2_Worker.CancelAsync();
                            //btnStop.Visible = false; btnStartup.Visible = true;
                            return;
                        }
                        else
                        {
                            System.Data.DataSet dataSet = new System.Data.DataSet();

                            //gridControl2.BeginInvoke(new MethodInvoker(delegate
                            //{
                            //    gridControl2.DataSource = null;
                            //    gridControl2.DataSource = ds.Tables[0];
                            //    gridView2.BestFitColumns();
                            //}));

                            switch (Program.intCode)
                            {
                            case 13:    //Akwa Ibom state
                                using (var receiptAka = new AkwaIbomReceiptServices.ReceiptService())
                                {
                                    dataSet3 = receiptAka.UploadStationPrintedReceipts(ds, Program.stateCode);
                                }

                                break;

                            case 20:
                                using (var receiptDelta = new DeltaBir.ReceiptService())
                                {
                                    dataSet = receiptDelta.UploadStationPrintedReceipts(ds, Program.stateCode);
                                }
                                break;

                            case 32:    //kogi state
                                break;

                            case 37:    //ogun state
                                using (var receiptsserv = new ReceiptService())
                                {
                                    dataSet = receiptsserv.UploadStationPrintedReceipts(ds, Program.stateCode);
                                }
                                break;

                            case 40:    //oyo state
                                using (var receiptsServices = new OyoReceiptServices.ReceiptService())
                                {
                                    dataSet = receiptsServices.UploadStationPrintedReceipts(ds, Program.stateCode);
                                }
                                break;

                            default:
                                break;
                            }

                            //using (var recepservices = new ReceiptService())
                            //{
                            //dataSet = recepservices.UploadStationPrintedReceipts(ds, Program.stateCode);

                            if (String.Compare(dataSet.Tables[0].Rows[0]["rownumber"].ToString(), "-1", false) == 0)
                            {
                                timer2.Stop();
                                Common.setMessageBox((string)dataSet.Tables[0].Rows[0]["errorMessage"], Program.ApplicationName, 3);
                                timer2.Enabled = false;
                                //btnStop.Visible = false; btnStartup.Visible = true;
                                //m2_Worker.CancelAsync();
                                return;
                            }
                            else
                            {
                                UploadRecordsUpdate(dataSet);
                            }
                            //}
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                timer2.Stop();
                Common.setMessageBox(String.Format("{0}----{1}...Do upload from Station to Online", ex.StackTrace, ex.Message), Program.ApplicationName, 3); m2_Worker.CancelAsync();
                timer2.Enabled = false;
                //btnStop.Visible = false; btnStartup.Visible = true;
                return;
            }
            finally
            {
                //SplashScreenManager.CloseForm(false);
            }
        }
コード例 #3
0
        void btnGet_Click(object sender, EventArgs e)
        {
            try
            {
                SplashScreenManager.ShowForm(this, typeof(WaitForm1), true, true, false);

                switch (Program.intCode)
                {
                case 13:    //Akwa Ibom state
                    using (var receiptAka = new AkwaIbomReceiptServices.ReceiptService())
                    {
                        dsGetapp = receiptAka.GetReceiptReprintApproved(Program.stationCode);
                    }

                    break;

                case 20:    //Delta state
                    using (var receiptDelta = new DeltaBir.ReceiptService())
                    {
                        dsGetapp = receiptDelta.GetReceiptReprintApproved(Program.stationCode);
                    }
                    break;

                case 32:    //kogi state
                    break;

                case 37:    //ogun state
                    using (var receiptsserv = new ReceiptService())
                    {
                        dsGetapp = receiptsserv.GetReceiptReprintApproved(Program.stationCode);
                    }
                    break;

                case 40:    //oyo state
                    using (var receiptsserv = new OyoReceiptServices.ReceiptService())
                    {
                        dsGetapp = receiptsserv.GetReceiptReprintApproved(Program.stationCode);
                    }
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                Common.setMessageBox(ex.StackTrace, "Get Approval Record", 3); return;
            }
            finally
            {
                SplashScreenManager.CloseForm(false);
            }


            if (dsGetapp.Tables[0].Rows[0]["returncode"].ToString() == "-1")
            {
                Common.setMessageBox(dsGetapp.Tables[0].Rows[0]["returnmessage"].ToString(), Program.ApplicationName, 1);
                SetLoadData();
                return;
            }
            else
            {
                if (dsGetapp.Tables.Count == 0 || dsGetapp.Tables[0].Rows.Count < 1)
                {
                    Common.setMessageBox("No records have been approval yet", "Get Approval Record", 1);
                    return;
                }
                else
                {
                    //insert record into collection
                    dstretval = InsertData(dsGetapp);


                    try
                    {
                        SplashScreenManager.ShowForm(this, typeof(WaitForm1), true, true, false);
                        if (dstretval != null && dstretval.Tables[0].Rows.Count > 0)
                        {
                            switch (Program.intCode)
                            {
                            case 13:    //Akwa Ibom state
                                using (var receiptAka = new AkwaIbomReceiptServices.ReceiptService())
                                {
                                    dsGetappup = receiptAka.UpdateReceiptReprintApproved(dstretval);
                                }

                                break;

                            case 20:    //Delta state
                                using (var receiptDelta = new DeltaBir.ReceiptService())
                                {
                                    dsGetappup = receiptDelta.UpdateReceiptReprintApproved(dstretval);
                                }
                                break;

                            case 32:    //kogi state
                                break;

                            case 37:    //ogun state
                                using (var receiptsserv = new ReceiptService())
                                {
                                    dsGetappup = receiptsserv.UpdateReceiptReprintApproved(dstretval);
                                }
                                break;

                            case 40:    //oyo state
                                using (var receiptsserv = new OyoReceiptServices.ReceiptService())
                                {
                                    dsGetappup = receiptsserv.UpdateReceiptReprintApproved(dstretval);
                                }
                                break;

                            default:
                                break;
                            }
                        }
                        else
                        {
                            return;
                        }
                        //send return data online for update
                    }
                    catch (Exception ex)
                    {
                        Common.setMessageBox(ex.StackTrace, "Get Approval Record", 3); return;
                    }

                    finally
                    {
                        SplashScreenManager.CloseForm(false);
                    }

                    if (dsGetappup.Tables[0].Rows[0]["returnCode"].ToString() == "00")
                    {
                        //iTransType = TransactionTypeCode.Edit;
                        voidgetRec(dstretval);
                        OnFormLoad(null, null);
                        return;
                    }
                    else
                    {
                        Common.setMessageBox(string.Format("Error Updating Approval Record, {0}...", dsGetappup.Tables[0].Rows[0]["returnMessage"]), Program.ApplicationName, 3);
                        return;
                    }
                }
            }
        }
コード例 #4
0
        private int DownloadIssueReceipt()
        {
            try
            {
                using (SqlConnection connect = new SqlConnection(Logic.ConnectionString))
                {
                    connect.Open();

                    command = new SqlCommand("doGetStationInfo", connect)
                    {
                        CommandType = CommandType.StoredProcedure
                    };

                    command.CommandTimeout = 0;

                    using (System.Data.DataSet ds = new System.Data.DataSet())
                    {
                        adp = new SqlDataAdapter(command);

                        adp.SelectCommand.CommandTimeout = 0;

                        adp.Fill(ds);

                        Dts = ds.Tables[0];

                        connect.Close();

                        if (ds.Tables.Count < 1 && ds.Tables[0].Rows.Count < 1)
                        {
                            return(0);
                        }
                        else
                        {
                            System.Data.DataSet dataSet = new System.Data.DataSet();

                            switch (Program.intCode)
                            {
                            case 13:    //Akwa Ibom state
                                using (var receiptAka = new AkwaIbomReceiptServices.ReceiptService())
                                {
                                    dataSet = receiptAka.DownloadDataIssueReceipt(ds, Program.stateCode);
                                }
                                break;

                            case 20:
                                using (var receiptDelta = new DeltaBir.ReceiptService())
                                {
                                    dataSet = receiptDelta.DownloadDataIssueReceipt(ds, Program.stateCode);
                                }
                                break;

                            case 32:    //kogi state
                                break;

                            case 37:    //ogun state

                                using (var receiptsserv = new ReceiptService())
                                {
                                    dataSet = receiptsserv.DownloadDataIssueReceipt(ds, Program.stateCode);
                                }

                                break;

                            case 40:    //oyo state

                                using (var receiptsServices = new OyoReceiptServices.ReceiptService())
                                {
                                    dataSet = receiptsServices.DownloadDataIssueReceipt(ds, Program.stateCode);
                                }


                                break;

                            default:
                                break;
                            }

                            if (dataSet.Tables.Count < 1 && dataSet.Tables[0].Rows.Count < 1)
                            {
                                return(0);
                            }
                            else
                            {
                                System.Data.DataSet dataSet2 = new System.Data.DataSet();

                                dataSet2 = InsertDataIssueReceipt(dataSet);

                                switch (Program.intCode)
                                {
                                case 13:    //Akwa Ibom state
                                    using (var receiptAka = new AkwaIbomReceiptServices.ReceiptService())
                                    {
                                        dataSet2 = receiptAka.DownloadDataUpdateIssueReceipts(dataSet2, Program.stateCode);
                                    }
                                    break;

                                case 20:
                                    using (var receiptDelta = new DeltaBir.ReceiptService())
                                    {
                                        dataSet = receiptDelta.DownloadDataUpdateIssueReceipts(dataSet2, Program.stateCode);
                                    }
                                    break;

                                case 32:    //kogi state
                                    break;

                                case 37:    //ogun state

                                    using (var receiptsserv = new ReceiptService())
                                    {
                                        dataSet2 = receiptsserv.DownloadDataUpdateIssueReceipts(dataSet2, Program.stateCode);
                                    }

                                    break;

                                case 40:    //oyo state

                                    using (var receiptsServices = new OyoReceiptServices.ReceiptService())
                                    {
                                        dataSet2 = receiptsServices.DownloadDataUpdateIssueReceipts(dataSet2, Program.stateCode);
                                    }


                                    break;

                                default:
                                    break;
                                }

                                return(1);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                timer1.Stop();

                Common.setMessageBox(String.Format("{0}....{1}..Download Issues Reeipts to Station", ex.Message, ex.StackTrace), Program.ApplicationName, 3);

                timer2.Stop();
                timer2.Enabled   = false;
                btnStart.Visible = true; btnStart.Enabled = true;
                //btnStop.Visible = false;
                //btnStartup.Visible = true;
                //m_oWorker.CancelAsync();
                //bResponse=false;
                return(0);
            }
            //return bResponse;
        }
コード例 #5
0
ファイル: FrmFirstApproval.cs プロジェクト: leofemmy/TSS_Ogun
        void Processwork()
        {
            if (string.IsNullOrEmpty(selection.SelectedCount.ToString()) || selection.SelectedCount == 0)
            {
                Common.setMessageBox("No Record selected", "Receipt Reprint Approval", 1); return;
            }
            string str = string.Format("Do you really want to Approve this ({0}) number(s) of Reclassified Transaction", selection.SelectedCount);

            DialogResult results = MessageBox.Show(str, Program.ApplicationName, MessageBoxButtons.YesNo);

            if (results == DialogResult.Yes)
            {
                for (int i = 0; i < selection.SelectedCount; i++)
                {
                    //tableTrans.Rows.Add(new object[] { (selection.GetSelectedRow(i) as DataRowView)["ID"], (selection.GetSelectedRow(i) as DataRowView)["BSID"], (selection.GetSelectedRow(i) as DataRowView)["TransID"] });

                    switch (Program.intCode)
                    {
                    //case 13://Akwa Ibom state
                    //    using (var receiptAka = new AkwaIbomReceiptServices.ReceiptService())
                    //    {
                    //        dsreturn = receiptAka.LogReceiptsReprintRequest(String.Format("{0}", (selection.GetSelectedRow(i) as DataRowView)["EReceipts"]), String.Format("{0}", (selection.GetSelectedRow(i) as DataRowView)["PaymentRefNumber"]), null, Program.UserID, String.Format("{0}", (selection.GetSelectedRow(i) as DataRowView)["Comment"]), "NONE", null, null, null, null, null, null, Program.stationCode);
                    //    }
                    //    break;
                    case 20:    //Delta state
                        using (var receiptDelta = new DeltaBir.ReceiptService())
                        {
                            dsreturn = receiptDelta.LogReceiptsReprintRequest(String.Format("{0}", (selection.GetSelectedRow(i) as DataRowView)["EReceipts"]), String.Format("{0}", (selection.GetSelectedRow(i) as DataRowView)["PaymentRefNumber"]), null, Program.UserID, String.Format("{0}", (selection.GetSelectedRow(i) as DataRowView)["Comment"]), "NONE", null, null, null, null, null, null, Program.stationCode);
                        }
                        break;

                    case 32:    //kogi state
                        break;

                    case 37:    //ogun state
                    //using (var receiptsserv = new ReceiptService())
                    //{
                    //    dsreturn = receiptsserv.LogReceiptsReprintRequest(String.Format("{0}", row["EReceipts"]), String.Format("{0}", row["PaymentRefNumber"]), null, Program.UserID, txtReason.Text, "NONE", null, null, null, null, null, null, Program.stationCode);
                    //}
                    //break;
                    case 40:    //oyo state
                    //using (var receiptsServices = new OyoReceiptServices.ReceiptService())
                    //{
                    //    dsreturn = receiptsServices.LogReceiptsReprintRequest(String.Format("{0}", row["EReceipts"]), String.Format("{0}", row["PaymentRefNumber"]), null, Program.UserID, txtReason.Text, "NONE", null, null, null, null, null, null, Program.stationCode);
                    //}
                    //break;

                    default:
                        break;
                    }
                    if (dsreturn.Tables[0].Rows[0]["returnCode"].ToString() == "-1")
                    {
                        Common.setMessageBox(dsreturn.Tables[0].Rows[0]["returnmessage"].ToString(), Program.ApplicationName, 1);
                        return;
                    }
                    else
                    {
                        using (SqlConnection db = new SqlConnection(Logic.ConnectionString))
                        {
                            SqlTransaction transaction;

                            db.Open();

                            transaction = db.BeginTransaction();
                            try
                            {
                                string query1 = String.Format("UPDATE Receipt.tblReprintedReceipts SET FirstApprovalStatus = '{0}',FirstApprovalBy = '{1}', FirstApprovalDate = '{2}' WHERE PaymentRefNumber IN('{3}')", 1, Program.UserName, string.Format("{0:yyyy/MM/dd hh:mm:ss}", DateTime.Now), String.Format("{0}", (selection.GetSelectedRow(i) as DataRowView)["PaymentRefNumber"]));

                                using (SqlCommand sqlCommand = new SqlCommand(query1, db, transaction))
                                {
                                    sqlCommand.ExecuteNonQuery();
                                }
                            }
                            catch (Exception ex)
                            {
                                transaction.Rollback();
                                Tripous.Sys.ErrorBox(ex);
                                return;
                            }
                            transaction.Commit();

                            db.Close();
                        }
                    }
                }
                ///
                Common.setMessageBox("Request Sent for Approval,Please Click on Get Approval Record, if your Admin has approve the record....", Program.ApplicationName, 1);
                return;
            }
            else
            {
                return;
            }
        }
コード例 #6
0
        void doprocessing(DataTable dt)
        {
            if (cboSelect.SelectedValue.ToString() == "1") //Payer Address Change
            {
                try
                {
                    switch (Program.intCode)
                    {
                    case 13:     //Akwa Ibom state
                        using (var receiptAka = new AkwaIbomReceiptServices.ReceiptService())
                        {
                            dsreturn = receiptAka.LogReceiptsReprintRequest(strReceipt,
                                                                            dt.Rows[0]["PaymentRefNumber"].ToString(), strControlnum,
                                                                            Program.UserID, txtreason.Text, "ADD", null, null, null, null, null,
                                                                            txtpayaddress.Text.Trim().ToString(), Program.stationCode);
                        }
                        break;

                    case 20:     //Delta state
                        using (var receiptDelta = new DeltaBir.ReceiptService())
                        {
                            dsreturn = receiptDelta.LogReceiptsReprintRequest(strReceipt,
                                                                              dt.Rows[0]["PaymentRefNumber"].ToString(), strControlnum,
                                                                              Program.UserID, txtreason.Text, "ADD", null, null, null, null, null,
                                                                              txtpayaddress.Text.Trim().ToString(), Program.stationCode);
                        }
                        break;

                    case 32:     //kogi state
                        break;

                    case 37:     //ogun state
                        using (var receiptsserv = new ReceiptService())
                        {
                            dsreturn = receiptsserv.LogReceiptsReprintRequest(strReceipt,
                                                                              dt.Rows[0]["PaymentRefNumber"].ToString(), strControlnum,
                                                                              Program.UserID, txtreason.Text, "ADD", null, null, null, null, null,
                                                                              txtpayaddress.Text.Trim().ToString(), Program.stationCode);
                        }
                        break;

                    case 40:     //oyo state

                        using (var receiptsserv = new OyoReceiptServices.ReceiptService())
                        {
                            dsreturn = receiptsserv.LogReceiptsReprintRequest(strReceipt,
                                                                              dt.Rows[0]["PaymentRefNumber"].ToString(), strControlnum,
                                                                              Program.UserID, txtreason.Text, "ADD", null, null, null, null, null,
                                                                              txtpayaddress.Text.Trim().ToString(), Program.stationCode);
                        }

                        break;

                    default:
                        break;
                    }
                }
                catch (Exception ex)
                {
                    Common.setMessageBox(
                        string.Format("{0}----{1}..Sending Request Reprint of Receipt Failed", ex.Message,
                                      ex.StackTrace), Program.ApplicationName, 3);
                    return;
                }
            }
            else if (cboSelect.SelectedValue.ToString() == "2") //Payer Name Change
            {
                try
                {
                    switch (Program.intCode)
                    {
                    case 13:     //Akwa Ibom state
                        using (var receiptAka = new AkwaIbomReceiptServices.ReceiptService())
                        {
                            dsreturn = receiptAka.LogReceiptsReprintRequest(strReceipt,
                                                                            dt.Rows[0]["PaymentRefNumber"].ToString(), strControlnum,
                                                                            Program.UserID, txtreason.Text, "NAME", null, null, null, null,
                                                                            txtpayername.Text, null, Program.stationCode);
                        }
                        break;

                    case 20:     //Delta state
                        using (var receiptDelta = new DeltaBir.ReceiptService())
                        {
                            dsreturn = receiptDelta.LogReceiptsReprintRequest(strReceipt,
                                                                              dt.Rows[0]["PaymentRefNumber"].ToString(), strControlnum,
                                                                              Program.UserID, txtreason.Text, "NAME", null, null, null, null,
                                                                              txtpayername.Text, null, Program.stationCode);
                        }
                        break;

                    case 32:     //kogi state
                        break;

                    case 37:     //ogun state

                        using (var receiptsserv = new ReceiptService())
                        {
                            dsreturn = receiptsserv.LogReceiptsReprintRequest(strReceipt,
                                                                              dt.Rows[0]["PaymentRefNumber"].ToString(), strControlnum,
                                                                              Program.UserID, txtreason.Text, "NAME", null, null, null, null,
                                                                              txtpayername.Text, null, Program.stationCode);
                        }
                        break;

                    case 40:     //oyo state

                        using (var receiptsserv = new OyoReceiptServices.ReceiptService())
                        {
                            dsreturn = receiptsserv.LogReceiptsReprintRequest(strReceipt,
                                                                              dt.Rows[0]["PaymentRefNumber"].ToString(), strControlnum,
                                                                              Program.UserID, txtreason.Text, "NAME", null, null, null, null,
                                                                              txtpayername.Text, null, Program.stationCode);
                        }

                        break;

                    default:
                        break;
                    }
                }
                catch (Exception ex)
                {
                    Common.setMessageBox(
                        string.Format("{0}----{1}..Sending Request Reprint of Receipt Failed", ex.Message,
                                      ex.StackTrace), Program.ApplicationName, 3);
                    return;
                }
            }
            else if (cboSelect.SelectedValue.ToString() == "4") //Revenue Change
            {
                try
                {
                    switch (Program.intCode)
                    {
                    case 13:     //Akwa Ibom state
                        using (var receiptAka = new AkwaIbomReceiptServices.ReceiptService())
                        {
                            dsreturn = receiptAka.LogReceiptsReprintRequest(strReceipt,
                                                                            dt.Rows[0]["PaymentRefNumber"].ToString(), strControlnum,
                                                                            Program.UserID, txtreason.Text, "REV",
                                                                            cboRevenue.SelectedValue.ToString(), cboRevenue.Text, txtAgcode.Text,
                                                                            label7.Text, null, null, Program.stationCode);
                        }
                        break;

                    case 20:     //Delta state
                        using (var receiptDelta = new DeltaBir.ReceiptService())
                        {
                            dsreturn = receiptDelta.LogReceiptsReprintRequest(strReceipt,
                                                                              dt.Rows[0]["PaymentRefNumber"].ToString(), strControlnum,
                                                                              Program.UserID, txtreason.Text, "REV",
                                                                              cboRevenue.SelectedValue.ToString(), cboRevenue.Text, txtAgcode.Text,
                                                                              label7.Text, null, null, Program.stationCode);
                        }
                        break;

                    case 32:     //kogi state
                        break;

                    case 37:     //ogun state
                        using (var receiptsserv = new ReceiptService())
                        {
                            dsreturn = receiptsserv.LogReceiptsReprintRequest(strReceipt,
                                                                              dt.Rows[0]["PaymentRefNumber"].ToString(), strControlnum,
                                                                              Program.UserID, txtreason.Text, "REV",
                                                                              cboRevenue.SelectedValue.ToString(), cboRevenue.Text, txtAgcode.Text,
                                                                              label7.Text, null, null, Program.stationCode);
                        }
                        break;

                    case 40:     //oyo state
                        using (var receiptsserv = new OyoReceiptServices.ReceiptService())
                        {
                            dsreturn = receiptsserv.LogReceiptsReprintRequest(strReceipt,
                                                                              dt.Rows[0]["PaymentRefNumber"].ToString(), strControlnum,
                                                                              Program.UserID, txtreason.Text, "REV",
                                                                              cboRevenue.SelectedValue.ToString(), cboRevenue.Text, txtAgcode.Text,
                                                                              label7.Text, null, null, Program.stationCode);
                        }
                        break;

                    default:
                        break;
                    }
                }
                catch (Exception ex)
                {
                    Common.setMessageBox(
                        string.Format("{0}----{1}..Sending Request Reprint of Receipt Failed", ex.Message,
                                      ex.StackTrace), Program.ApplicationName, 3);
                    return;
                }
            }


            //return code from onliner base on the type sent
            if (dsreturn.Tables[0].Rows[0]["returnCode"].ToString() == "00")
            {
                //insert modife record
                using (SqlConnection db = new SqlConnection(Logic.ConnectionString))
                {
                    SqlTransaction transaction;

                    db.Open();

                    transaction = db.BeginTransaction();

                    try
                    {
                        string querys = string.Empty;

                        if (cboSelect.SelectedValue.ToString() == "1") //Payer Address Change
                        {
                            querys = string.Format(
                                "INSERT  INTO Receipt.tblReprintedReceipts    (PaymentRefNumber ,isPrinted ,IsPrintedDate ,PrintedBy ,ControlNumber ,ControlNumberBy ,ControlNumberDate ,BatchNumber ,RequestDate ,Description ,OldRecord ,NewRecord,TransType ) VALUES('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}',{12});",
                                dt.Rows[0]["PaymentRefNumber"], dt.Rows[0]["isPrinted"],
                                string.Format("{0:yyyy/MM/dd hh:mm:ss}", dt.Rows[0]["IsPrintedDate"]),
                                dt.Rows[0]["PrintedBY"], dt.Rows[0]["ControlNumber"],
                                dt.Rows[0]["ControlNumberBy"],
                                string.Format("{0:yyyy/MM/dd hh:mm:ss}", dt.Rows[0]["ControlNumberDate"]),
                                dt.Rows[0]["BatchNumber"],
                                string.Format("{0:yyyy/MM/dd hh:mm:ss}", DateTime.Now),
                                txtreason.Text.Trim(), dt.Rows[0]["PayerAddress"],
                                txtpayaddress.Text.Trim().ToString(), cboSelect.SelectedValue);
                        }
                        else if (cboSelect.SelectedValue.ToString() == "2") //Payer Name Change
                        {
                            querys = string.Format(
                                "INSERT  INTO Receipt.tblReprintedReceipts    (PaymentRefNumber ,isPrinted ,IsPrintedDate ,PrintedBy ,ControlNumber ,ControlNumberBy ,ControlNumberDate ,BatchNumber ,RequestDate ,Description ,OldRecord ,NewRecord,TransType ) VALUES('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}',{12});",
                                dt.Rows[0]["PaymentRefNumber"], dt.Rows[0]["isPrinted"],
                                string.Format("{0:yyyy/MM/dd hh:mm:ss}", dt.Rows[0]["IsPrintedDate"]),
                                dt.Rows[0]["PrintedBY"], dt.Rows[0]["ControlNumber"],
                                dt.Rows[0]["ControlNumberBy"],
                                string.Format("{0:yyyy/MM/dd hh:mm:ss}", dt.Rows[0]["ControlNumberDate"]),
                                dt.Rows[0]["BatchNumber"],
                                string.Format("{0:yyyy/MM/dd hh:mm:ss}", DateTime.Now),
                                txtreason.Text.Trim(), dt.Rows[0]["PayerName"],
                                txtpayername.Text.Trim().ToString(), cboSelect.SelectedValue);
                        }
                        else if (cboSelect.SelectedValue.ToString() == "4") //Revenue Change
                        {
                            querys = string.Format(
                                "INSERT  INTO Receipt.tblReprintedReceipts    (PaymentRefNumber ,isPrinted ,IsPrintedDate ,PrintedBy ,ControlNumber ,ControlNumberBy ,ControlNumberDate ,BatchNumber ,RequestDate ,Description ,OldRecord ,NewRecord,TransType ) VALUES('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}',{12});",
                                dt.Rows[0]["PaymentRefNumber"], dt.Rows[0]["isPrinted"],
                                string.Format("{0:yyyy/MM/dd hh:mm:ss}", dt.Rows[0]["IsPrintedDate"]),
                                dt.Rows[0]["PrintedBY"], dt.Rows[0]["ControlNumber"],
                                dt.Rows[0]["ControlNumberBy"],
                                string.Format("{0:yyyy/MM/dd hh:mm:ss}", dt.Rows[0]["ControlNumberDate"]),
                                dt.Rows[0]["BatchNumber"],
                                string.Format("{0:yyyy/MM/dd hh:mm:ss}", DateTime.Now),
                                txtreason.Text.Trim(), dt.Rows[0]["RevenueCode"], cboRevenue.SelectedValue,
                                cboSelect.SelectedValue);
                        }


                        using (SqlCommand sqlCommand2 = new SqlCommand(querys, db, transaction))
                        {
                            sqlCommand2.ExecuteNonQuery();
                        }
                        transaction.Commit();

                        db.Close();
                    }
                    catch (Exception ex)
                    {
                        Tripous.Sys.ErrorBox(ex + "Inserting record to reprinted table");
                        transaction.Rollback();
                        return;
                    }
                }

                Common.setMessageBox(
                    "Request Sent for Approval. Click on Get Approved for records approved by Admin personal..",
                    Program.ApplicationName, 1);
                return;
            }
            else
            {
                Common.setMessageBox(dsreturn.Tables[0].Rows[0]["returnMessage"].ToString(),
                                     Program.ApplicationName, 1);
                return;
            }
        }
コード例 #7
0
        void uploadReceipts()
        {
            using (SqlConnection connect = new SqlConnection(Logic.ConnectionString))
            {
                connect.Open();

                command = new SqlCommand("doGetReceiptIssue", connect)
                {
                    CommandType = CommandType.StoredProcedure, CommandTimeout = 0
                };

                try
                {
                    using (System.Data.DataSet ds = new System.Data.DataSet())
                    {
                        adp = new SqlDataAdapter(command);
                        adp.SelectCommand.CommandTimeout = 0;
                        adp.Fill(ds);
                        Dts = ds.Tables[0];
                        connect.Close();

                        //if (ds.Tables[0].Rows.Count > 0)
                        if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                        {
                            System.Data.DataSet dataSet = new System.Data.DataSet();

                            switch (Program.intCode)
                            {
                            case 13:    //Akwa Ibom state
                                using (var receiptAka = new AkwaIbomReceiptServices.ReceiptService())
                                {
                                    dataSet = receiptAka.uploadIssueReceipt(ds, Program.stateCode);
                                }
                                break;

                            case 20:    //Delta state
                                using (var receiptDelta = new DeltaBir.ReceiptService())
                                {
                                    dataSet = receiptDelta.uploadIssueReceipt(ds, Program.stateCode);
                                }
                                break;

                            case 32:    //kogi state
                                break;

                            case 37:    //ogun state
                                using (var receiptsserv = new ReceiptService())
                                {
                                    dataSet = receiptsserv.uploadIssueReceipt(ds, Program.stateCode);
                                }
                                break;

                            case 40:    //oyo state
                                using (var receiptsServices = new OyoReceiptServices.ReceiptService())
                                {
                                    dataSet = receiptsServices.uploadIssueReceipt(ds, Program.stateCode);
                                }
                                break;

                            default:
                                break;
                            }

                            UploadReceiptIssueUpdate(dataSet);
                        }
                        else
                        {
                            return;
                        }
                    }
                }
                catch (Exception e)
                {
                    timer1.Stop();
                    Common.setMessageBox(string.Format("{0}----{1} Error Occur Sending Record Online", e.Message, e.StackTrace), Program.ApplicationName, 3);
                    timer1.Enabled = false; btnStop.Visible = false; btnStart.Visible = true;
                    //m_oWorker.CancelAsync();
                    return;
                }
            }
        }
コード例 #8
0
        void doDownload()
        {
            try
            {
                switch (Program.intCode)
                {
                case 13:    //Akwa Ibom state
                    using (var receiptAka = new AkwaIbomReceiptServices.ReceiptService())
                    {
                        dataSet = receiptAka.DownloadDataCentral(Program.stateCode);
                    }

                    break;

                case 20:    //Delta state
                    using (var receiptDelta = new DeltaBir.ReceiptService())
                    {
                        dataSet = receiptDelta.DownloadDataCentral(Program.stateCode);
                    }
                    break;

                case 32:    //kogi state
                    using (var receiptservic = new Kogireceiptservice.ReceiptService())
                    {
                        dataSet = receiptservic.DownloadDataCentral(Program.stateCode);
                    }
                    break;

                case 37:    //ogun state
                    using (var receiptsserv = new ReceiptService())
                    {
                        dataSet = receiptsserv.DownloadDataCentral(Program.stateCode);
                    }
                    break;

                case 40:    //oyo state

                    using (var receiptsServices = new OyoReceiptServices.ReceiptService())
                    {
                        dataSet = receiptsServices.DownloadDataCentral(Program.stateCode);
                    }
                    break;

                //http://www.ogunstaterevenue.com/OGS_IPS/ReceiptService.asmx
                default:
                    break;
                }

                if (dataSet.Tables.Count > 0 && dataSet.Tables[0].Rows.Count > 0)
                {
                    #region
                    ////insert records into local tabale

                    //if (gridControl1.InvokeRequired)
                    //{
                    //    gridControl1.Invoke(new MethodInvoker(UpdateMainUI));
                    //}

                    ////gridControl1.RefreshDataSource();
                    //if (gridControl1.InvokeRequired)
                    //{
                    //    gridControl1.BeginInvoke(new MethodInvoker(delegate
                    //    {
                    //gridControl1.DataSource = null;
                    //gridControl1.DataSource = dataSet.Tables[0];
                    //gridView1.Columns["Amount"].DisplayFormat.FormatType = FormatType.Numeric;
                    //gridView1.Columns["Amount"].DisplayFormat.FormatString = "n2";
                    //gridView1.Columns["PaymentDate"].DisplayFormat.FormatType = DevExpress.Utils.FormatType.DateTime;
                    //gridView1.Columns["PaymentDate"].DisplayFormat.FormatString = "dd/MM/yyyy";
                    ////gridView1.Columns["Provider"].Visible = false;
                    ////gridView1.Columns["Channel"].Visible = false;
                    //gridView1.Columns["TelephoneNumber"].Visible = false;
                    //gridView1.Columns["ZoneCode"].Visible = false;
                    //gridView1.Columns["ZoneName"].Visible = false;
                    //gridView1.Columns["DateChequeReturned"].Visible = false;
                    //gridView1.Columns["DateValidatedAgainst"].Visible = false;
                    ////gridView1.Columns["PaymentRefNumber"].Visible = false;
                    //gridView1.Columns["DepositSlipNumber"].Visible = false;
                    //gridView1.Columns["PayerID"].Visible = false;
                    //gridView1.Columns["RevenueCode"].Visible = false;
                    //gridView1.Columns["Description"].Visible = false;
                    //gridView1.Columns["PaymentMethod"].Visible = false;
                    //gridView1.Columns["ChequeNumber"].Visible = false;
                    //gridView1.Columns["ChequeValueDate"].Visible = false;

                    //gridView1.Columns["ChequeBankCode"].Visible = false;
                    //gridView1.Columns["ChequeBankName"].Visible = false;
                    //gridView1.Columns["ChequeStatus"].Visible = false;
                    //gridView1.Columns["DateChequeReturned"].Visible = false;
                    //gridView1.Columns["AgencyName"].Visible = false;
                    //gridView1.Columns["AgencyCode"].Visible = false;
                    //gridView1.Columns["BankCode"].Visible = false;
                    //gridView1.Columns["BankName"].Visible = false;
                    //gridView1.Columns["BranchCode"].Visible = false;
                    //gridView1.Columns["BranchName"].Visible = false;
                    //gridView1.Columns["ReceiptNo"].Visible = false;
                    //gridView1.Columns["ReceiptDate"].Visible = false;
                    //gridView1.Columns["PayerAddress"].Visible = false;
                    ////gridView1.Columns["AmountWords"].Visible = false;
                    ////gridView1.Columns["GeneratedBy"].Visible = false;
                    //gridView1.Columns["DateValidatedAgainst"].Visible = false;
                    //gridView1.Columns["StationCode"].Visible = false;

                    //gridView1.BestFitColumns();
                    //    }));
                    //}
                    //gridControl1.RefreshDataSource();
                    #endregion

                    dataSet2 = InsertData(dataSet);

                    if (dataSet2.Tables.Count > 0 && dataSet2.Tables[0].Rows.Count > 0)
                    {
                        //if (dataSet2.Tables[0].Rows[0]["returnCode"].ToString() == "-1")
                        //{
                        //    Common.setMessageBox(string.Format("{0}...Error Occur During Data Insert After download.... Insert Download", dataSet2.Tables[0].Rows[0]["returnMessage"]), Program.ApplicationName, 3);

                        //    timer1.Stop();
                        //    timer1.Enabled = false;
                        //    btnStop.Enabled = false;
                        //    btnStart.Enabled = true;
                        //    //m_oWorker.CancelAsync();
                        //    return;
                        //}
                        //else
                        {
                            dataSet.Clear();
                            switch (Program.intCode)
                            {
                            case 13:    //Akwa Ibom state
                                using (var receiptAka = new AkwaIbomReceiptServices.ReceiptService())
                                {
                                    dataSet = receiptAka.DownloadDataUpdateCentral(dataSet2, Program.stateCode);
                                }
                                break;

                            case 20:    //Delta state
                                using (var receiptDelta = new DeltaBir.ReceiptService())
                                {
                                    dataSet = receiptDelta.DownloadDataUpdateCentral(dataSet2, Program.stateCode);
                                }
                                break;

                            case 32:    //kogi state
                                break;

                            case 37:    //ogun state

                                using (var receiptsserv = new ReceiptService())
                                {
                                    dataSet = receiptsserv.DownloadDataUpdateCentral(dataSet2, Program.stateCode);
                                }

                                break;

                            case 40:    //oyo state

                                using (var receiptsServices = new OyoReceiptServices.ReceiptService())
                                {
                                    dataSet = receiptsServices.DownloadDataUpdateCentral(dataSet2, Program.stateCode);
                                }


                                break;

                            default:
                                break;
                            }

                            if (dataSet.Tables.Count > 0 && dataSet.Tables[0].Rows.Count > 0)
                            {
                                label6.Text = "Download In Progress";

                                if (dataSet.Tables[0].Rows[0]["returnCode"].ToString() == "00")
                                {
                                    lblAll.Text = dataSet.Tables[1].Rows[0]["ALLRecords"].ToString();

                                    lblDownload.Text = dataSet.Tables[2].Rows[0]["DownloadedRecords"].ToString();

                                    lblRemain.Text = dataSet.Tables[3].Rows[0]["RemainRecords"].ToString();

                                    lblError.Text = dataSet.Tables[4].Rows[0]["ErrorRecords"].ToString();
                                }
                                else
                                {
                                    timer1.Stop();
                                    Common.setMessageBox(string.Format("{0}...Download Data to Local Station,Update Data Download", dataSet.Tables[0].Rows[0]["returnMessage"]), Program.ApplicationName, 3);
                                    timer1.Enabled = false;

                                    return;
                                }
                            }
                        }
                    }
                }
                else
                {
                    label6.Text = "No More Records to Download";


                    timer1.Stop();
                    timer1.Enabled = false;

                    return;
                }
            }
            catch (Exception e)
            {
                timer1.Stop();
                Common.setMessageBox(string.Format("{0}----{1}..Do Down load to station", e.Message, e.StackTrace), Program.ApplicationName, 3); timer1.Enabled = false;

                return;
            }
        }
コード例 #9
0
ファイル: FrmArmsApproval.cs プロジェクト: leofemmy/TSS_Ogun
        void doSending(System.Data.DataSet dst)
        {
            foreach (DataRow row in dst.Tables[1].Rows)
            {
                //Console.WriteLine(row["ImagePath"]);
                if (row != null)
                {
                    switch (Program.intCode)
                    {
                    case 13:    //Akwa Ibom state
                        using (var receiptAka = new AkwaIbomReceiptServices.ReceiptService())
                        {
                            dsreturn = receiptAka.LogReceiptsReprintRequest(String.Format("{0}", row["EReceipts"]), String.Format("{0}", row["PaymentRefNumber"]), null, Program.UserID, "Arms Records", "NONE", null, null, null, null, null, null, Program.stationCode);
                        }
                        break;

                    case 20:    //Delta state
                        using (var receiptDelta = new DeltaBir.ReceiptService())
                        {
                            dsreturn = receiptDelta.LogReceiptsReprintRequest(String.Format("{0}", row["EReceipts"]), String.Format("{0}", row["PaymentRefNumber"]), null, Program.UserID, "Arms Records", "NONE", null, null, null, null, null, null, Program.stationCode);
                        }
                        break;

                    case 32:    //kogi state
                        break;

                    case 37:    //ogun state
                        using (var receiptsserv = new ReceiptServices.ReceiptService())
                        {
                            dsreturn = receiptsserv.LogReceiptsReprintRequest(String.Format("{0}", row["EReceipts"]), String.Format("{0}", row["PaymentRefNumber"]), null, Program.UserID, "Arms Records", "NONE", null, null, null, null, null, null, Program.stationCode);
                        }
                        break;

                    case 40:    //oyo state
                        using (var receiptsServices = new OyoReceiptServices.ReceiptService())
                        {
                            dsreturn = receiptsServices.LogReceiptsReprintRequest(String.Format("{0}", row["EReceipts"]), String.Format("{0}", row["PaymentRefNumber"]), null, Program.UserID, "Arms Records", "NONE", null, null, null, null, null, null, Program.stationCode);
                        }
                        break;

                    default:
                        break;
                    }
                }
            }
            //call procedure for insert

            using (SqlConnection connect = new SqlConnection(Logic.ConnectionString))
            {
                connect.Open();
                _command = new SqlCommand("ArmsReprintInsert", connect)
                {
                    CommandType = CommandType.StoredProcedure
                };
                _command.Parameters.Add(new SqlParameter("@pTransaction", SqlDbType.Structured)).Value = dst.Tables[1];
                _command.CommandTimeout = 0;

                using (System.Data.DataSet ds = new System.Data.DataSet())
                {
                    ds.Clear();
                    adp = new SqlDataAdapter(_command);
                    adp.Fill(ds);
                    connect.Close();

                    if (ds.Tables[0].Rows[0]["returnCode"].ToString() == "00")
                    {
                        Common.setMessageBox(ds.Tables[0].Rows[0]["returnMessage"].ToString(), Program.ApplicationName, 2);
                        return;
                    }
                    else
                    {
                        Tripous.Sys.ErrorBox(String.Format("{0}", dts.Tables[0].Rows[0]["returnMessage"].ToString()));
                        return;
                    }
                }
            }
        }