Exemplo n.º 1
0
        private void btnLoad_Click(object sender, EventArgs e)
        {
            if (ValidateInput())
            {
                clsSubDAccount subd = clsSubDAccount.GetSubDAccount(txtMobileNum.Text);

                clsLoadWalletTransaction wallet = new clsLoadWalletTransaction();
                wallet.Load_Id            = m_LoadAccount.LoadId;
                wallet.UserId             = myPosWide.m_user.UserId;
                wallet.SubDId             = subd != null ? subd.Id_subdAccounts : 0;
                wallet.Timestamp          = DateTime.Now;
                wallet.LoadAmount         = double.Parse(txtLoadAmount.Text);
                wallet.MobileNum          = txtMobileNum.Text;
                wallet.DiscountPercentage = double.Parse(txtDisCount.Text);
                wallet.AmtDue             = double.Parse(txtAmtDue.Text);

                frmInput input     = new frmInput();
                double   amountdue = wallet.AmtDue;
                input.Title   = "Payment";
                input.Value   = amountdue.ToString("0.00");
                input.Caption = "Enter Tendered Amount";

                if (input.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    if (Convert.ToDouble(input.Value) >= amountdue)
                    {
                        wallet.TenderedAmount = Convert.ToDouble(input.Value);
                        if (wallet.Save())
                        {
                            Clear();
                            m_LoadAccount = clsLoadAccount.GetLoadAccount(m_LoadAccount.LoadId);
                            wallet.PrintReceipt();
                            RefreshAccount();
                        }
                        else
                        {
                            MessageBox.Show("Transaction not saved.", "Payment", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                    }
                    else
                    {
                        if (MessageBox.Show("Amount entered is less than the Amount Due. Charge to Sub-D Account?", "Payment", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == System.Windows.Forms.DialogResult.Yes)
                        {
                            wallet.TenderedAmount = Convert.ToDouble(input.Value);
                            if (wallet.Save())
                            {
                                Clear();
                                m_LoadAccount = clsLoadAccount.GetLoadAccount(m_LoadAccount.LoadId);
                                wallet.PrintReceipt();
                                RefreshAccount();
                            }
                            else
                            {
                                MessageBox.Show("Transaction not saved.", "Payment", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
 private void btnInputForm_Click(object sender, EventArgs e)
 {
     frmInput oInputForm = new frmInput();
     this.Hide();
     oInputForm.ShowDialog();
     this.Close();
 }
Exemplo n.º 3
0
        [STAThread] //Runs faster with the tag, but seems to have some issue with exiting
        static void Main(string[] args)
        {
            string xmlInputFile;
            string mapOutputDirectory;
            string textOutputDir;
            string xmlBackup;

#if DEBUG
            Console.WriteLine("calling check license");
#endif

            CheckLicense();
            frmInput f = new frmInput();

#if DEBUG
            Console.WriteLine("calling LoadArgs");
#endif
            LoadArgs(args, out xmlInputFile, out mapOutputDirectory, out textOutputDir, out xmlBackup);
#if DEBUG
            Console.WriteLine("Calling DoBackUpLoad");
#endif
            BackUpParams backupParms = DoBackUpLoad(args, mapOutputDirectory, textOutputDir);
#if DEBUG
            Console.WriteLine("Calling DoRun");
#endif
            f.doRun(xmlInputFile, mapOutputDirectory, textOutputDir, xmlBackup, backupParms);

            //ESRI.ArcGIS.ADF.COMSupport.AOUninitialize.Shutdown();
            System.Environment.Exit(0);

            //thisProc.Kill();
            //Console.WriteLine("End of program");
        }
Exemplo n.º 4
0
 public static string show_out(string defText)
 {
     frmInput fi = new frmInput();
     fi.input = defText;
     fi.textBoxX1.Text = defText;
     fi.ShowDialog();
     return (fi.input);
 }
Exemplo n.º 5
0
        public void doTestCheckPoint(frmInput inForm)
        {
            bool ans = AnimalManager.save("animalmanager.dat", mAnimalManager);

            if (!ans)
            {
                Console.WriteLine("Failed to serialize");
            }
        }
Exemplo n.º 6
0
 public frmTabControl()
 {
     InitializeComponent();
     fInput         = new frmInput();
     dtCombo        = new DataTable();
     dtDgv          = new DataTable();
     dtProvider     = new DataTable();
     myItemList     = new List <Model.Item>();
     myProviderList = new List <Provider>();
     myBillInList   = new List <BillIn>();
 }
Exemplo n.º 7
0
        /********************************************************************************
         *  Function name   : doSimulation
         *  Description     :
         *  Return type     : void
         * *******************************************************************************/
        public void doSimulation(frmInput inForm)
        {
            mLog.Debug("inside sim manager do simulation calling initialize daily sim");
            initializeSimulation();

            this.currTime = this.mStartSeasonDate;                                                  // not  on restart.

            this.currTime = this.currTime.AddHours(this.AnimalManager.AnimalAttributes.WakeUpTime); // not on restart

            this.MapManager.CurrTime = this.currTime;

            mLog.Debug("now start the big loop for the sim");
            // note currSeason could be chk boundary.
            // really is number of years.
            for (int currSeason = 0; currSeason < this.mNumSeasons; currSeason++)
            {
                mLog.Debug("starting a season");
                mLog.Debug("currDate is " + this.currTime.ToShortDateString());
                mLog.Debug("end season date is " + this.EndSeasonDate.ToShortDateString());
                while (currTime < this.EndSeasonDate)
                {
                    this.doTimeStep();   // changes the modifiers, update animal manager.
                    this.currTimeStep++; // used for progress bar update.
                    // t = t + dt
                    this.currTime = this.currTime.AddMinutes(this.mElapsedTimeBetweenTimeStep);
                    if (currTime.Hour == 0)
                    {
                        initializeDailySimulation(); // does nothing
                        //this.upDateForm(ref inForm); // does nothing
                    }
                }

                //now reset the year and advance by a year
                mLog.Debug("done with one season now addvance throuout the year");
                mLog.Debug("currDate is " + this.currTime.ToShortDateString());
                this.currTime      = this.mStartSeasonDate.AddYears(currSeason + 1);
                this.currTime      = this.currTime.AddHours(this.AnimalManager.AnimalAttributes.WakeUpTime);
                this.EndSeasonDate = this.EndSeasonDate.AddYears(1);
                mLog.Debug("now the currDate is " + this.currTime.ToShortDateString());
                mLog.Debug("calling initialize yearly sim");
                initializeYearlySimulation();
                mLog.Debug("done with initializing yearly sim");
                mLog.Debug("");
                mLog.Debug("Curr season is " + currSeason);
                mLog.Debug("NumSeasons is " + mNumSeasons);
                mLog.Debug("");
            }
            // this.mMapManager.removeExtraFiles();

            //System.Windows.Forms.MessageBox.Show("done");

            mLog.Debug("FINISHED SIM LOOP!");
        }
Exemplo n.º 8
0
        public static string ShowInput(string instructions)
        {
            string retVal = null;

              using (var form = new frmInput()) {
            form.lbInstructions.Text = instructions;

            if (form.ShowDialog() == DialogResult.OK)
              retVal = form.txInput.Text;
              }

              return retVal;
        }
Exemplo n.º 9
0
        static void Main(string[] args)
        {
            /*Console.WriteLine("3526432463");
            Console.WriteLine(BigNumbers.BigNumber.Parse("3526432463", 16));

            Console.WriteLine("5600 + 493");
            Console.WriteLine(BigNumbers.BigNumber.Parse("5600", 16) + BigNumbers.BigNumber.Parse("493", 16));

            Console.WriteLine("28147497671065700000000000000000");
            Console.WriteLine(BigNumbers.BigNumber.Parse("28147497671065700000000000000000", 16));
            Console.WriteLine("281474976710655");
            Console.WriteLine(BigNumbers.BigNumber.Parse("281474976710655", 16));

            Console.WriteLine("Using 16 digits (base 100) max value is: 99999999999999999999999999999999");
            Console.WriteLine(BigNumbers.BigNumber.Parse("99999999999999999999999999999999", 16));
            Console.WriteLine("Max value of 64bit int is: " + long.MaxValue);

            Console.WriteLine("Using 32 digits (base 100) max value is: 9999999999999999999999999999999999999999999999999999999999999999");
            Console.WriteLine(BigNumbers.BigNumber.Parse("9999999999999999999999999999999999999999999999999999999999999999", 32));

            Console.ReadKey(true);
            return;*/

            frmInput input = new frmInput();
            Application.Run(input);
            //return;

            /*var r = new StreamReader("test.txt");
            Scanner s = new Scanner(r);
            var context = new EvalContext();
            StatementList stmts = new StatementList();
            List<Token[]> tl = new List<Token[]>();
            while (r.Peek() != -1)
            {
                var tokens = s.ReadStatement();
                if (tokens.Length == 0)
                    continue;

                //var stmt = StatementBuilder.Build(tokens);
                //stmt.Evaluate(context);
                tl.Add(tokens);
                //var expr = new Expression(tokens);
                //expr.Evaluate(new EvalContext());
            }
            stmts = StatementBuilder.Build(tl.ToArray());
            stmts.Excecute(context);
            r.Close();
            //Console.WriteLine(expr.Evaluate(new EvalContext()));*/
        }
Exemplo n.º 10
0
        private void txtInput_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                e.SuppressKeyPress = true;
                ValidateInput();
            }
            else
            {
                switch (e.KeyCode)
                {
                case Keys.F1: RetrieveOrder();
                    frmInput input = new frmInput();
                    if (mReceipt != null)
                    {
                        input.Caption    = "Customer:";
                        input.InputValue = mReceipt.CustomerName;
                        input.ShowDialog();
                        mReceipt.CustomerName = input.InputValue;
                        cboName.SelectedItem  = input.InputValue;
                        mReceipt.Save();
                    }
                    break;

                case Keys.F2: NewCustomer(); break;

                case Keys.F3: AcceptOrder(); break;

                case Keys.F4: ValidateOrder(true); break;

                case Keys.F5: RetrieveOrder(); break;

                case Keys.F6: mAddItem = true; AddRemoveItem(); break;

                case Keys.F7: mAddItem = false; AddRemoveItem(); break;

                case Keys.F8: Setup(); break;

                case Keys.F9: Summary(); break;

                case Keys.F10: Print(); break;

                case Keys.F11: Settings(); break;
                }
            }
        }
Exemplo n.º 11
0
        private void btnFundTransfer_Click(object sender, EventArgs e)
        {
            if (!clsUtil.GetApproval(m_user, UserAccess.Supervisor))
            {
                return;
            }
            clsLoadAccount acc = GetSelAccount();

            if (acc != null)
            {
                frmInput input = new frmInput();
                input.withDecimal   = true;
                input.IsNumericOnly = true;
                input.Value         = "";
                input.Title         = "Fund Transfer";
                input.Caption       = "Enter amount to transfer";
                if (input.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    clsReloadHistory reload = new clsReloadHistory();
                    reload.Amount            = Convert.ToDouble(input.Value);
                    reload.Load_Id           = acc.LoadId;
                    reload.RefNum            = string.Format("FUNDTRANS{0:yyyyMMddHHssmm}", DateTime.Now);
                    reload.Timestamp         = DateTime.Now;
                    reload.UserId            = m_user.UserId;
                    reload.Remarks           = "Fund Transfer";
                    reload.TransactionAmount = 0;
                    reload.RemainingBalance  = acc.CurrentBalance - Convert.ToDouble(input.Value);
                    if (reload.Save())
                    {
                        acc.CurrentBalance   = reload.RemainingBalance;
                        acc.AvailableBalance = reload.RemainingBalance;
                        if (acc.Save())
                        {
                            reload.PrintReceipt(acc);
                            ReloadAccounts();
                        }
                        else
                        {
                            MessageBox.Show("Fund Transfer Failed!", "Fund Transfer", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                    }
                }
            }
        }
        private void lblThu2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            try
            {
                string lbl = ((LinkLabel)sender).Name;
                if (lbl == "lbl0")
                {
                    thu = Thu.Thu2;
                }
                else if (lbl == "lbl1")
                {
                    thu = Thu.Thu3;
                }
                else if (lbl == "lbl2")
                {
                    thu = Thu.Thu4;
                }
                else if (lbl == "lbl3")
                {
                    thu = Thu.Thu5;
                }
                else if (lbl == "lbl4")
                {
                    thu = Thu.Thu6;
                }
                else if (lbl == "lbl5")
                {
                    thu = Thu.Thu7;
                }
                else
                {
                    thu = Thu.ChuNhat;
                }

                frmInput frm = new frmInput();
                frm.Text    = thu.ToString();
                frm.truyen += new frmInput.TruyenMatKhau(NhanDuLieu);
                frm.ShowDialog();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 13
0
        private void btnLoad_Click(object sender, EventArgs e)
        {
            if (ValidateInput())
            {
                clsEloadTransaction eload = new clsEloadTransaction();
                eload.Load_Id            = m_LoadAccount.LoadId;
                eload.Timestamp          = DateTime.Now;
                eload.AmountDue          = double.Parse(txtAmtDue.Text.Trim());
                eload.Rebate             = double.Parse(txtRebate.Text.Trim());
                eload.Transaction_Amount = double.Parse(txtTransAmount.Text);
                eload.MobileNum          = txtMobile.Text;
                eload.ELoadName          = cmbLoadAmt.Text;
                eload.UserId             = myPosWide.m_user.UserId;
                eload.Remarks            = cmbLoadAmt.Text;
                frmInput input     = new frmInput();
                double   amountdue = eload.AmountDue;
                input.Title   = "Payment";
                input.Value   = amountdue.ToString("0.00");
                input.Caption = "Enter Tendered Amount";

                if (input.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    if (Convert.ToDouble(input.Value) >= amountdue)
                    {
                        eload.TenderedAmount = Convert.ToDouble(input.Value);
                        if (eload.Save())
                        {
                            Clear();
                            m_LoadAccount = clsLoadAccount.GetLoadAccount(m_LoadAccount.LoadId);
                            eload.PrintReceipt();
                            RefreshAccount();
                        }
                        else
                        {
                            MessageBox.Show("Transaction not saved.", "Payment", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                    }
                    else
                    {
                        MessageBox.Show("Amount entered is less than the Amount Due", "Payment", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
            }
        }
Exemplo n.º 14
0
        private void btnRecompute_Click(object sender, EventArgs e)
        {
            frmInput frm = new frmInput();

            frm.Title         = "Recompute Service Fee";
            frm.Caption       = "Enter Service Fee %:";
            frm.Value         = "2";
            frm.IsNumericOnly = true;
            frm.withDecimal   = true;
            if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                if (Convert.ToDouble(frm.Value) > 5)
                {
                    MessageBox.Show("Invalid Service Fee Percentage. Must be less than 5");
                }
                else
                {
                    txtCSSvcFee.Text = (Convert.ToDouble(txtCSAmount.Text) * (Convert.ToDouble(frm.Value) / 100)).ToString("0.00");
                }
            }
        }
 private void tsbPointcutNew_Click(object sender, EventArgs e)
 {
     if (existAdvice())
     {
         frmInput inp = new frmInput(frmInput.FormType.mdPointcut, frmInput.FormMode.mdInsert);
         inp.ShowDialog();
         if (inp.DialogResult == System.Windows.Forms.DialogResult.OK)
         {
             aspects[gvAspect.CurrentRow.Index].Advices[gvAdvice.CurrentRow.Index].addPointcut(
                 new Pointcut(frmInput.text1, frmInput.text2, frmInput.text3)
                 );
             updateGridViewPointcut();
         }
     }
 }
Exemplo n.º 16
0
 private void upDateForm(ref frmInput inForm)
 {
     inForm.updateProgressBar(this.currTimeStep / this.mNumTotalTimeSteps);
 }
Exemplo n.º 17
0
        private void nhậpKhoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmInput frm = new frmInput();

            frm.ShowDialog();
        }
Exemplo n.º 18
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     frmInput frm = new frmInput();
     frm.Show();
 }
Exemplo n.º 19
0
        private void saveListToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (Settings.CurrentFileName == "")
            {
                if (lstList.Items.Count > 0)
                {
                    frmInput fi = new frmInput();
                    fi.Caption = Settings.ApplicationName;
                    fi.Label = "Please enter list name";
                    if (fi.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                    {
                        Settings.CurrentFileName = fi.Value;
                        if (Settings.Names.IndexOf(Settings.CurrentFileName) < 0)
                        {
                            Settings.Names.Add(Settings.CurrentFileName);
                        }
                        SaveConfig();
                        SaveWordsToFile();
                        isFileSaved = true;
                    }

                }
                else
                {
                    MessageBox.Show("Nothing to Save");
                }

            }
            else
            {
                SaveWordsToFile();
                isFileSaved = true;
            }
        }
Exemplo n.º 20
0
        private void btnProcessGCash_Click(object sender, EventArgs e)
        {
            if (ValidateInput())
            {
                double amountdue = 0;

                clsGCashTransaction gc = new clsGCashTransaction();
                gc.SenderName       = txtSenderName.Text;
                gc.SenderContact    = txtSenderNum.Text;
                gc.RecipientName    = txtRecipientName.Text;
                gc.RecipientContact = txtRecipientNum.Text;
                gc.GCashNumber      = txtGCashMobNum.Text;
                gc.TransDate        = DateTime.Now;
                gc.Country          = "";

                if (tabCtrl.SelectedIndex == 0)
                {
                    if (optCashIn.Checked)
                    {
                        gc.TransactionType = GCashTransType.CashIn;
                    }
                    else if (optCashOut.Checked)
                    {
                        gc.TransactionType = GCashTransType.CashOut;
                    }
                    else if (optSendOthers.Checked)
                    {
                        gc.TransactionType = GCashTransType.SendToOthers;
                    }

                    gc.RefNum       = txtRefNum1.Text;
                    gc.TransAmount  = Convert.ToDouble(txtAmount1.Text);
                    gc.SvcFeeAmount = Convert.ToDouble(txtSvcFee1.Text);
                    gc.Rebate       = Convert.ToDouble(txtRebate1.Text);
                }
                else if (tabCtrl.SelectedIndex == 1)
                {
                    if (optRecInt.Checked)
                    {
                        gc.TransactionType = GCashTransType.IntCashPickUp;
                        gc.Country         = txtCountry.Text;
                    }
                    else if (optRecDom.Checked)
                    {
                        gc.TransactionType = GCashTransType.DomCashPickup;
                    }

                    gc.RefNum       = txtRefNum2.Text;
                    gc.TransAmount  = Convert.ToDouble(txtAmount2.Text);
                    gc.SvcFeeAmount = Convert.ToDouble(txtSvcFee2.Text);
                    gc.Rebate       = Convert.ToDouble(txtRebate2.Text);
                }
                else if (tabCtrl.SelectedIndex == 2)
                {
                    if (optSendP2P.Checked)
                    {
                        gc.TransactionType = GCashTransType.RemitSend;
                        gc.TransAmount     = Convert.ToDouble(txtAmount3.Text);
                        gc.SvcFeeAmount    = Convert.ToDouble(txtSvcFee3.Text);
                        gc.Rebate          = Convert.ToDouble(txtRebate3.Text);
                    }
                    else if (optCancelP2P.Checked)
                    {
                        gc.TransactionType = GCashTransType.RemitCancel;
                        gc.TransAmount     = Convert.ToDouble(txtAmount3.Text);
                        gc.SvcFeeAmount    = Convert.ToDouble(txtSvcFee3.Text);
                        gc.Rebate          = Convert.ToDouble(txtRebate3.Text);
                    }
                    gc.RefNum = "";
                }
                amountdue   = gc.TransAmount + gc.SvcFeeAmount;
                gc.UserId   = myPosWide.m_user.UserId;
                gc.UserName = myPosWide.m_user.UserName;
                gc.Remarks  = clsGCashTransaction.GetTransType(gc.TransactionType);
                gc.Load_Id  = m_LoadAccount.LoadId;

                if (tabCtrl.SelectedIndex == 2 && optCancelP2P.Checked)
                {
                    amountdue = gc.SvcFeeAmount;
                    if (MessageBox.Show(string.Format("Amount: {0:0.00}\nService Fee: {1:0.00}\nPayout Amount: {2:0.00}\n\nAre you sure this is correct?", gc.TransAmount, gc.SvcFeeAmount, gc.TransAmount - gc.SvcFeeAmount), "Cancel Remittance", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
                    {
                        if (gc.Save())
                        {
                            MessageBox.Show("Transaction completed", "Payment", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            Clear();
                            string  ret = "";
                            Receipt or  = new Receipt();
                            or.InitializePrinter();
                            List <string> strmsg = new List <string>();
                            ret += or.PrintCompanyHeader();
                            strmsg.Add("G-CASH");
                            strmsg.Add(gc.Remarks);
                            ret += or.PrintAppend(strmsg, PrintFontAlignment.Center, PrintFontSize.UnderlineBold);
                            strmsg.Clear();

                            strmsg.Add(string.Format("Cashier: {0}", myPosWide.m_user.UserName.ToUpper()));
                            strmsg.Add(string.Format("Date: {0}", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")));
                            strmsg.Add(string.Format("TransId: {0}", gc.GCashtTransId));
                            strmsg.Add("");
                            strmsg.Add(string.Format("{0}", gc.Remarks));
                            strmsg.Add(string.Format("Sender: {0:0.00}", gc.SenderName));
                            strmsg.Add(string.Format("Recipient: {0:0.00}", gc.RecipientName));
                            strmsg.Add(string.Format("RefNum: {0:0.00}", gc.RefNum));
                            strmsg.Add(string.Format("Trans Amount: P {0:0.00}", gc.TransAmount));
                            strmsg.Add(string.Format("Service Fee: P {0:0.00}", gc.SvcFeeAmount));
                            strmsg.Add(string.Format("Payout Amount: P {0:0.00}", gc.TransAmount - gc.SvcFeeAmount));
                            strmsg.Add("");
                            strmsg.Add("");
                            ret += or.PrintAppend(strmsg, PrintFontAlignment.Left, PrintFontSize.Regular);
                            or.FormFeed();
                            or.OpenDrawer();
                            or.ExecPrint(ret);
                            strmsg.Clear();

                            m_LoadAccount = clsLoadAccount.GetLoadAccount(m_LoadAccount.LoadId);
                            RefreshAccount();
                        }
                    }
                }
                else if (tabCtrl.SelectedIndex == 0 && optCashOut.Checked)
                {
                    amountdue = gc.SvcFeeAmount;
                    if (MessageBox.Show(string.Format("Amount: {0:0.00}\nService Fee: {1:0.00}\nPayout Amount: {2:0.00}\n\nAre you sure this is correct?", gc.TransAmount, gc.SvcFeeAmount, gc.TransAmount - gc.SvcFeeAmount), "Cash Out", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
                    {
                        if (gc.Save())
                        {
                            Clear();
                            string  ret = "";
                            Receipt or  = new Receipt();
                            or.InitializePrinter();
                            List <string> strmsg = new List <string>();
                            ret += or.PrintCompanyHeader();
                            strmsg.Add("G-CASH");
                            strmsg.Add(gc.Remarks);
                            ret += or.PrintAppend(strmsg, PrintFontAlignment.Center, PrintFontSize.UnderlineBold); strmsg.Clear();

                            strmsg.Add(string.Format("Cashier: {0}", myPosWide.m_user.UserName.ToUpper()));
                            strmsg.Add(string.Format("Date: {0}", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")));
                            strmsg.Add(string.Format("TransId: {0}", gc.GCashtTransId));
                            strmsg.Add("");
                            strmsg.Add(string.Format("{0}", gc.Remarks));
                            strmsg.Add(string.Format("Sender: {0:0.00}", gc.SenderName));
                            strmsg.Add(string.Format("Recipient: {0:0.00}", gc.RecipientName));
                            strmsg.Add(string.Format("RefNum: {0:0.00}", gc.RefNum));
                            strmsg.Add(string.Format("Trans Amount: P {0:0.00}", gc.TransAmount));
                            strmsg.Add(string.Format("Service Fee: P {0:0.00}", gc.SvcFeeAmount));
                            strmsg.Add(string.Format("Payout Amount: P {0:0.00}", gc.TransAmount - gc.SvcFeeAmount));
                            strmsg.Add("");
                            strmsg.Add("");
                            ret += or.PrintAppend(strmsg, PrintFontAlignment.Left, PrintFontSize.Regular);
                            or.FormFeed();
                            or.OpenDrawer();
                            or.ExecPrint(ret);
                            strmsg.Clear();

                            m_LoadAccount = clsLoadAccount.GetLoadAccount(m_LoadAccount.LoadId);
                            RefreshAccount();
                        }
                    }
                }
                else if (tabCtrl.SelectedIndex == 1)
                {
                    if (MessageBox.Show(string.Format("You are about to deduct {0:0.00} from your actual cash on hand. \n\nAre you sure this is correct?", gc.TransAmount), "Receive Remittance", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
                    {
                        if (gc.Save())
                        {
                            Clear();
                            string  ret = "";
                            Receipt or  = new Receipt();
                            or.InitializePrinter();
                            List <string> strmsg = new List <string>();
                            ret += or.PrintCompanyHeader();
                            strmsg.Add("G-CASH");
                            strmsg.Add(gc.Remarks);
                            ret += or.PrintAppend(strmsg, PrintFontAlignment.Center, PrintFontSize.UnderlineBold); strmsg.Clear();

                            strmsg.Add(string.Format("Cashier: {0}", myPosWide.m_user.UserName.ToUpper()));
                            strmsg.Add(string.Format("Date: {0}", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")));
                            strmsg.Add(string.Format("TransId: {0}", gc.GCashtTransId));
                            strmsg.Add("");
                            strmsg.Add(string.Format("Sender: {0:0.00}", gc.SenderName));
                            strmsg.Add(string.Format("Recipient: {0:0.00}", gc.RecipientName));
                            strmsg.Add(string.Format("RefNum: {0:0.00}", gc.RefNum));
                            strmsg.Add(string.Format("Trans Amount: P {0:0.00}", gc.TransAmount));
                            strmsg.Add(string.Format("Service Fee: P {0:0.00}", gc.SvcFeeAmount));
                            strmsg.Add(string.Format("Payout Amount: P {0:0.00}", gc.TransAmount - gc.SvcFeeAmount));
                            ret += or.PrintAppend(strmsg, PrintFontAlignment.Left, PrintFontSize.Regular);
                            or.FormFeed();
                            or.OpenDrawer();
                            or.ExecPrint(ret);
                            strmsg.Clear();

                            m_LoadAccount = clsLoadAccount.GetLoadAccount(m_LoadAccount.LoadId);
                            RefreshAccount();
                        }
                    }
                }
                else
                {
                    frmInput input = new frmInput();
                    input.Title   = "Payment";
                    input.Value   = amountdue.ToString("0.00");
                    input.Caption = "Enter Tendered Amount";
                    if (input.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                    {
                        if (Convert.ToDouble(input.Value) >= amountdue)
                        {
                            gc.TenderedAmount = Convert.ToDouble(input.Value);
                            gc.Save();
                            MessageBox.Show("Transaction completed", "Payment", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            Clear();
                            string  ret = "";
                            Receipt or  = new Receipt();
                            or.InitializePrinter();
                            List <string> strmsg = new List <string>();
                            ret += or.PrintCompanyHeader();
                            strmsg.Add("");
                            strmsg.Add("G-CASH");
                            strmsg.Add(gc.Remarks);
                            ret += or.PrintAppend(strmsg, PrintFontAlignment.Center, PrintFontSize.UnderlineBold); strmsg.Clear();
                            strmsg.Clear();

                            strmsg.Add(string.Format("Cashier: {0}", myPosWide.m_user.UserName.ToUpper()));
                            strmsg.Add(string.Format("Date: {0}", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")));
                            strmsg.Add(string.Format("TransId: {0}", gc.GCashtTransId));
                            strmsg.Add("");
                            strmsg.Add(string.Format("Sender: {0:0.00}", gc.SenderName));
                            strmsg.Add(string.Format("Recepient: {0:0.00}", gc.RecipientName));
                            strmsg.Add(string.Format("Recepient Number: {0:0.00}", gc.RecipientContact));

                            strmsg.Add(string.Format("Trans Amount: P {0:0.00}", gc.TransAmount));
                            strmsg.Add(string.Format("Service Fee: P {0:0.00}", gc.SvcFeeAmount));
                            strmsg.Add(string.Format("Tendered Amount: P {0:0.00}", gc.TenderedAmount));
                            strmsg.Add(string.Format("Change: P {0:0.00}", gc.TenderedAmount - (gc.TransAmount + gc.SvcFeeAmount)));
                            strmsg.Add("");
                            strmsg.Add("");
                            ret += or.PrintAppend(strmsg, PrintFontAlignment.Left, PrintFontSize.Regular);
                            or.FormFeed();
                            or.OpenDrawer();
                            or.ExecPrint(ret);
                            strmsg.Clear();


                            m_LoadAccount = clsLoadAccount.GetLoadAccount(m_LoadAccount.LoadId);
                            RefreshAccount();
                        }
                        else
                        {
                            MessageBox.Show("Amount entered is less than the Amount Due", "Payment", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                    }
                }
            }
            else
            {
                MessageBox.Show("Kindly fill-out required fields", "Process", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Exemplo n.º 21
0
 private void addFileToolStripMenuItem_Click(object sender, EventArgs e)
 {
     _InputBox = new frmInput(this, "Add File", "Type the name of the file (with ext):", FileAction.NewFile);
 }
Exemplo n.º 22
0
        private void bbteditfa_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            TreeListNode node = treeList1.FocusedNode;
            if (node != null)
            {
                string suid = node["SUID"].ToString();
                if (suid.Contains("FA"))
                {
                    frmInput dlg = new frmInput();
                    dlg.Text = "������Ϣ";
                    dlg.hide = true;
                    dlg.id = symbolDoc.SvgdataUid;
                    dlg.symbolDoc = symbolDoc;
                    dlg.InputString = node["NAME"].ToString();
                    dlg.InputType = progtype;

                    DialogResult d = dlg.ShowDialog(this);
                    if (d == DialogResult.OK)
                    {
                        SVG_LAYER temp = new SVG_LAYER();
                        temp.SUID = suid;
                        temp.svgID = symbolDoc.SvgdataUid;
                        SVG_LAYER lar = (SVG_LAYER)Services.BaseService.GetObject("SelectSVG_LAYERByKey", temp);
                        // lar.YearID = dlg.list[1].ToString();
                        lar.NAME = dlg.InputString;

                        Services.BaseService.Update<SVG_LAYER>(lar);
                        PSP_ELCPROJECT pe = new PSP_ELCPROJECT();
                        pe.ID = lar.SUID;
                        pe = Services.BaseService.GetOneByKey<PSP_ELCPROJECT>(pe);
                        if (pe != null)
                        {
                            pe.Name = dlg.InputString;
                            Services.BaseService.Update<PSP_ELCPROJECT>(pe);
                        }
                        treeList1.FocusedNode.SetValue("NAME", dlg.InputString);
                        treeList1.Refresh();
                        //InitData();
                    }
                    if (d == DialogResult.Retry)
                    {
                        if (dlg.list.Count > 1)
                        {

                            SVG_LAYER temp = new SVG_LAYER();
                            temp.SUID = suid;
                            temp.svgID = symbolDoc.SvgdataUid;
                            SVG_LAYER lar = (SVG_LAYER)Services.BaseService.GetObject("SelectSVG_LAYERByKey", temp);
                            lar.YearID = dlg.list[1].ToString();
                            Services.BaseService.Update<SVG_LAYER>(lar);
                        }
                    }
                }
                else
                {
                    MessageBox.Show("��ѡ�з�����", "��ʾ", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
            }
        }
Exemplo n.º 23
0
        private void bbteditlayer_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            Layer layer = getFocusLayer();
            if (layer != null)
            {

                if (!CkRight(layer))
                {
                    MessageBox.Show("����ͼ�㲻�ܸ�����ɾ����", "��ʾ", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                frmInput dlg = new frmInput();
                dlg.id = symbolDoc.SvgdataUid;
                dlg.symbolDoc = symbolDoc;
                dlg.InputString = layer.Label;
                dlg.InputType = layer.GetAttribute("layerType");

                DialogResult d = dlg.ShowDialog(this);
                if (d == DialogResult.OK)
                {
                    layer.Label = dlg.InputString;
                    layer.SetAttribute("layerType", dlg.InputType);
                    treeList1.FocusedNode.SetValue("Name", dlg.InputString);
                    treeList1.Refresh();
                    //InitData();
                }
                if (d == DialogResult.Retry)
                {
                    if (dlg.list.Count > 1)
                    {
                        layer.SetAttribute("ParentID", dlg.list[1].ToString());
                        SVG_LAYER temp = new SVG_LAYER();
                        temp.SUID = layer.ID;
                        temp.svgID = symbolDoc.SvgdataUid;
                        SVG_LAYER lar = (SVG_LAYER)Services.BaseService.GetObject("SelectSVG_LAYERByKey", temp);
                        lar.YearID = dlg.list[1].ToString();
                        Services.BaseService.Update<SVG_LAYER>(lar);
                    }
                }

            }
        }
Exemplo n.º 24
0
        private void bbtaddfa_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            frmInput dlg = new frmInput();
            dlg.Text = "������Ϣ";
            dlg.InputType = progtype;
            if (dlg.ShowDialog(this) == DialogResult.OK)
            {
                if (Layer.CkLayerExist(dlg.InputString, this.SymbolDoc))
                {
                    MessageBox.Show("�ĵ����Ѿ�����ͬ��������", "��ʾ", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                //Layer lar = Layer.CreateNew(dlg.InputString, this.SymbolDoc);
                //lar.SetAttribute("layerType", dlg.InputType);
                //if (ilist.Count > 0)
                //{
                //    lar.SetAttribute("ParentID", ilist[0].ToString());
                //}
                addflag = true;
                //this.checkedListBox1.Items.Add(lar, true);
                //checkedListBox1.SelectedIndex = checkedListBox1.Items.Count - 1;
                DataTable dt = treeList1.DataSource as DataTable;
                SVG_LAYER _svg = new SVG_LAYER() { SUID = Guid.NewGuid().ToString().Substring(0, 10) };
                //if (treeList1.FocusedNode != null)
                {
                    _svg.NAME = dlg.InputString;
                    _svg.SUID = "FA" + _svg.SUID;
                    //_svg.ParentID = treeList1.FocusedNode["ParentID"].ToString();
                    _svg.YearID = ilist[0].ToString();
                    _svg.svgID = symbolDoc.SvgdataUid;
                    //_svg.OrderID = int.Parse(treeList1.FocusedNode["OrderID"].ToString()) + 1;
                    _svg.MDATE = DateTime.Now;
                    Services.BaseService.Create<SVG_LAYER>(_svg);
                    //�������㷽��
                    PSP_ELCPROJECT pd = new PSP_ELCPROJECT();
                    pd.ID = _svg.SUID;
                    pd.Name = dlg.InputString;
                    pd.FileType = "����";
                    pd.Class = System.DateTime.Now.ToString();
                    if (!string.IsNullOrEmpty(StrYear) && StrYear.Length == 4)
                    {
                        pd.BelongYear = StrYear;
                    }

                    pd.ProjectID = Itop.Client.MIS.ProgUID;
                    Services.BaseService.Create<PSP_ELCPROJECT>(pd);
                }
                DataRow row = dt.NewRow();
                dt.Rows.Add(DataConverter.ObjectToRow(_svg, row));
            }
        }
Exemplo n.º 25
0
        private void bbtaddlayer_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            frmInput dlg = new frmInput();
            dlg.InputType = progtype;
            if (dlg.ShowDialog(this) == DialogResult.OK)
            {
                if (Layer.CkLayerExist(dlg.InputString, this.SymbolDoc))
                {
                    MessageBox.Show("�ĵ����Ѿ�����ͬ��ͼ�㡣", "��ʾ", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                Layer lar = Layer.CreateNew(dlg.InputString, this.SymbolDoc);
                lar.SetAttribute("layerType", dlg.InputType);
                if (ilist.Count > 0)
                {
                    lar.SetAttribute("ParentID", ilist[0].ToString());
                }
                addflag = true;

                DataTable dt = treeList1.DataSource as DataTable;
                SVG_LAYER _svg = new SVG_LAYER() { SUID = lar.ID, NAME = lar.Label };
                if (treeList1.FocusedNode != null)
                {
                    _svg.ParentID = treeList1.FocusedNode["ParentID"].ToString();
                    if (ilist.Count!=0)
                    {
                        _svg.YearID = ilist[0].ToString();
                    }

                    _svg.svgID = symbolDoc.SvgdataUid;
                    _svg.OrderID = int.Parse(treeList1.FocusedNode["OrderID"].ToString()) + 1;
                    _svg.MDATE = DateTime.Now;
                    _svg.layerType = progtype;
                    Services.BaseService.Create<SVG_LAYER>(_svg);
                }
                DataRow row = dt.NewRow();
                dt.Rows.Add(DataConverter.ObjectToRow(_svg, row));

            }
        }
Exemplo n.º 26
0
        static void Main(string[] args)
        {
            //Application.EnableVisualStyles();
            //Application.SetCompatibleTextRenderingDefault(false);
            //Application.Run( new frm Input());
            //Console.WriteLine("I'm in is licensed");
            if (ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.EngineOrDesktop))
            {
                //Console.WriteLine("Inside binding");
                ESRI.ArcGIS.RuntimeManager.BindLicense(ESRI.ArcGIS.ProductCode.EngineOrDesktop);
                //Console.WriteLine("Bound and checked out license");
            }

            if (args.Length < 4)
            {
                usage();
                Environment.Exit(-1);
            }


            frmInput f = new frmInput();


            string xmlInputFile       = args[0];
            string mapOutputDirectory = args[1];
            string textOutputDir      = args[2];
            string xmlBackup          = args[3];

            f.doRun(xmlInputFile, mapOutputDirectory, textOutputDir, xmlBackup);

            //Console.WriteLine("Finished doRun");

            //Tried disposing form
            //f.Dispose();
            //if (f.IsDisposed)
            //{
            //    Console.WriteLine("Disposed form!");
            //}


            //Tried multiple types of exits
            //Do we need to force an exit here?
            //Environment.FailFast(null);
            //Console.WriteLine("Trying return");
            //return;
            //Console.WriteLine("Trying Application.Exit()");
            //Application.Exit();
            //Console.WriteLine("Trying Environment.Exit(0)");
            //Environment.Exit(0);


            //Tried garbage collection
            //GC.Collect();
            //Console.WriteLine("Waiting for finalizers");
            //GC.WaitForPendingFinalizers();

            //Tried sleeping
            //System.Threading.Thread.Sleep(5000);

            //Process thisProc = Process.GetCurrentProcess();
            //ProcessThreadCollection myThreads = thisProc.Threads;
            //foreach (ProcessThread pt in myThreads)
            //{
            //    DateTime startTime = pt.StartTime;
            //    TimeSpan cpuTime = pt.TotalProcessorTime;
            //int priority = pt.BasePriority;
            //    ThreadState ts = pt.ThreadState;

            //    Console.WriteLine("thread:  {0}", pt.Id);
            //    Console.WriteLine("    started: {0}", startTime.ToString());
            //    Console.WriteLine("    CPU time: {0}", cpuTime);
            //    Console.WriteLine("    priority: {0}", priority);
            //    Console.WriteLine("    thread state: {0}", ts.ToString());

            //    if (priority == 10)
            //    {
            //        Console.WriteLine("Disposing Thread!!!!");
            //        pt.Dispose();
            //    }
            //}

            Application.Exit();
            Environment.Exit(0);

            //thisProc.Kill();



            //Console.WriteLine("End of program");
        }
        private void tsbAdviceEdit_Click(object sender, EventArgs e)
        {
            if (existAdvice())
            {
                frmInput.text1 = aspects[gvAspect.CurrentRow.Index].Advices[gvAdvice.CurrentRow.Index].Name;
                frmInput.text2 = aspects[gvAspect.CurrentRow.Index].Advices[gvAdvice.CurrentRow.Index].Process;
                frmInput.text3 = aspects[gvAspect.CurrentRow.Index].Advices[gvAdvice.CurrentRow.Index].Goal;
                frmInput inp = new frmInput(frmInput.FormType.mdAdvice, frmInput.FormMode.mdEdit);

                inp.ShowDialog();

                if (inp.DialogResult == System.Windows.Forms.DialogResult.OK)
                {
                    aspects[gvAspect.CurrentRow.Index].Advices[gvAdvice.CurrentRow.Index].Name = frmInput.text1;
                    aspects[gvAspect.CurrentRow.Index].Advices[gvAdvice.CurrentRow.Index].Process = frmInput.text2;
                    aspects[gvAspect.CurrentRow.Index].Advices[gvAdvice.CurrentRow.Index].Goal = frmInput.text3;
                    updateGridViewAdvice();
                }
            }
        }
Exemplo n.º 28
0
 public static string show_out()
 {
     frmInput fi = new frmInput();
     fi.ShowDialog();
     return (fi.input);
 }
Exemplo n.º 29
0
		private void configRename() {
			frmInput df = new frmInput();
			df.DialogText = "Gib den neuen Konfigurationsname ein:";
			df.DialogTitel = "Konfiguration umbenennen";
			df.DialogDefaultValue = ds.DataTable1.Rows[cmbKonfiguration.SelectedIndex][ds.DataTable1.ConfigNameColumn.ColumnName].ToString();
			df.ShowDialog();
			if (df.Konfigurationsname == "")
				return;

			try {
				ds.DataTable1.Rows[cmbKonfiguration.SelectedIndex][ds.DataTable1.ConfigNameColumn] = df.Konfigurationsname;
				ds.WriteXml("./config.xml");
			} catch (Exception ex) {
				webbrowser(ex.Message);
			}
		}
        private void tsbAspectEdit_Click(object sender, EventArgs e)
        {
            if (existAspect())
            {
                frmInput.text1 = aspects[gvAspect.CurrentRow.Index].Name;
                frmInput inp = new frmInput(frmInput.FormType.mdAspect, frmInput.FormMode.mdEdit);

                inp.ShowDialog();

                if (inp.DialogResult == System.Windows.Forms.DialogResult.OK)
                {
                    aspects[gvAspect.CurrentRow.Index].Name = frmInput.text1;
                    updateGridViewAspect();
                }
            }
        }
Exemplo n.º 31
0
		private void configAdd() {

			try {
				frmInput s = new frmInput();
				s.DialogText = "Vergib Deiner Schlachtkonfiguration einen Namen:";
				s.DialogTitel = "speichern";

				s.ShowDialog();
				if (s.Konfigurationsname == "")
					return;

				DataSet1.DataTable1Row row;
				row = ds.DataTable1.NewDataTable1Row();
				row.ConfigName = s.Konfigurationsname;

				row.Bandit = rbBandit.Checked;
				row.Player = rbPlayer.Checked;

				row.Attacker = txtAngreiferName.Text;
				row.DefenderName = txtDefenderName.Text;

				//Angreifer 1
				row.AR1 = Convert.ToInt16(txtAR1.Text);
				row.AB1 = Convert.ToInt16(txtAB1.Text);
				row.AM1 = Convert.ToInt16(txtAM1.Text);
				row.AC1 = Convert.ToInt16(txtAC1.Text);
				row.AL1 = Convert.ToInt16(txtAL1.Text);
				row.AS1 = Convert.ToInt16(txtAS1.Text);
				row.AE1 = Convert.ToInt16(txtAE1.Text);
				row.AA1 = Convert.ToInt16(txtAA1.Text);
				row.AK1 = Convert.ToInt16(txtAK1.Text);

				//Angreifer 2
				row.AR2 = Convert.ToInt16(txtAR2.Text);
				row.AB2 = Convert.ToInt16(txtAB2.Text);
				row.AM2 = Convert.ToInt16(txtAM2.Text);
				row.AC2 = Convert.ToInt16(txtAC2.Text);
				row.AL2 = Convert.ToInt16(txtAL2.Text);
				row.AS2 = Convert.ToInt16(txtAS2.Text);
				row.AE2 = Convert.ToInt16(txtAE2.Text);
				row.AA2 = Convert.ToInt16(txtAA2.Text);
				row.AK2 = Convert.ToInt16(txtAK2.Text);
				row.AG2 = chkG1.Checked;

				//Angreifer 3
				row.AR3 = Convert.ToInt16(txtAR3.Text);
				row.AB3 = Convert.ToInt16(txtAB3.Text);
				row.AM3 = Convert.ToInt16(txtAM3.Text);
				row.AC3 = Convert.ToInt16(txtAC3.Text);
				row.AL3 = Convert.ToInt16(txtAL3.Text);
				row.AS3 = Convert.ToInt16(txtAS3.Text);
				row.AE3 = Convert.ToInt16(txtAE3.Text);
				row.AA3 = Convert.ToInt16(txtAA3.Text);
				row.AK3 = Convert.ToInt16(txtAK3.Text);
				row.AG3 = chkG3.Checked;

				//Player
				row.DR = Convert.ToInt16(txtDR.Text);
				row.DB = Convert.ToInt16(txtDB.Text);
				row.DM = Convert.ToInt16(txtDM.Text);
				row.DC = Convert.ToInt16(txtDC.Text);
				row.DL = Convert.ToInt16(txtDL.Text);
				row.DS = Convert.ToInt16(txtDS.Text);
				row.DE = Convert.ToInt16(txtDE.Text);
				row.DA = Convert.ToInt16(txtDA.Text);
				row.DK = Convert.ToInt16(txtDK.Text);
				row.DG = chkDG.Checked;
				row.DT = chkDT.Checked;

				//Banditen
				row.BanditName = txtBanditName.Text;

				row.PL = Convert.ToInt16(txtPL.Text);
				row.SL = Convert.ToInt16(txtSL.Text);
				row.WH = Convert.ToInt16(txtWH.Text);
				row.RB = Convert.ToInt16(txtRB.Text);
				row.SW = Convert.ToInt16(txtSW.Text);
				row.WL = Convert.ToInt16(txtWL.Text);

				row.BT = chkBT.Checked;

				//Boss
				row.noBoss = rbKeinBoss.Checked;
				row.ST = rbST.Checked;
				row.EB = rbEB.Checked;
				row.CK = rbCK.Checked;
				row.MG = rbMG.Checked;
				row.DWW = rbDWW.Checked;

				ds.DataTable1.AddDataTable1Row(row);
				cmbKonfiguration.SelectedIndex = cmbKonfiguration.Items.Count - 1;
			} catch (Exception ex) {
				webbrowser(ex.Message);
			}
		}
 private void tsbAspectNew_Click(object sender, EventArgs e)
 {
     frmInput inp = new frmInput(frmInput.FormType.mdAspect, frmInput.FormMode.mdInsert);
     inp.ShowDialog();
     if (inp.DialogResult == System.Windows.Forms.DialogResult.OK)
     {
         aspects.Add(new Aspect(frmInput.text1));
         updateGridViewAspect();
     }
 }
Exemplo n.º 33
0
 private void deleteToolStripMenuItem_Click(object sender, EventArgs e)
 {
     _InputBox = new frmInput(this, String.Format("Delete {0}?", listDir.SelectedItems[0].Text), "Please type the name of the folder as confirmation. This action cannot be undone.", FileAction.Delete);
 }
Exemplo n.º 34
0
        private void linkLabel8_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            // TODO: This function is not tested and not implemented at the server side.
            //       This function is coming soon!

            // The code in this routine is based on the code published on the web site: http://dobon.net/vb/dotnet/internet/webrequestpost.html

            frmInput fi = new frmInput();
            string apikey, apikeyenc;

            RegistryKey regkey;
            regkey = Registry.CurrentUser.OpenSubKey("SOFTWARE\\AutoGitClient", false);
            if (regkey != null)
            {
                apikeyenc = (string)regkey.GetValue("apikey", "");
                regkey.Close();

                if (apikeyenc != "")
                {
                    apikey = StringEnc.DecryptString(apikeyenc, StringEnc.TransStr());
                }
                else
                {
                    apikey = "";
                }
            }
            else
            {
                apikey = "";
            }

            fi.input = apikey;

            if (fi.ShowDialog() == DialogResult.Cancel)
            {
                return;
            }

            apikey = fi.input;

            regkey = Registry.CurrentUser.OpenSubKey("SOFTWARE\\AutoGitClient", true);
            if (regkey == null)
            {
                regkey = Registry.CurrentUser.CreateSubKey("SOFTWARE\\AutoGitClient");
            }

            apikeyenc = StringEnc.EncryptString(apikey, StringEnc.TransStr());

            regkey.SetValue("apikey", apikeyenc);
            regkey.Close();

            // Set character code as UTF-8
            System.Text.Encoding enc =
                System.Text.Encoding.GetEncoding("utf-8");

            // Make string to send as POST
            string postData =
                "inlang=ja&word=" +
                    System.Web.HttpUtility.UrlEncode("api_key:" + apikey, enc);
            byte[] postDataBytes = System.Text.Encoding.UTF8.GetBytes(postData);

            // Make an WebRequest
            System.Net.WebRequest req =
                System.Net.WebRequest.Create("http://www.fluxflex.com/connect/projects");

            // Set the WebRequest
            req.Method = "POST";
            req.ContentType = "application/x-www-form-urlencoded";
            req.ContentLength = postDataBytes.Length;

            // Get a stream to send POST data
            System.IO.Stream reqStream = req.GetRequestStream();

            // Send data
            reqStream.Write(postDataBytes, 0, postDataBytes.Length);
            reqStream.Close();

            // Make an WebResponse and receive data from the server.
            System.Net.WebResponse res = req.GetResponse();
            System.IO.Stream resStream = res.GetResponseStream();
            System.IO.StreamReader sr = new System.IO.StreamReader(resStream, enc);

            int i;
            string s = sr.ReadToEnd();
            Console.WriteLine(sr.ReadToEnd());
            sr.Close();

            char[] splitter = new char[]{','};

            string[] strs = s.Split(splitter);
            for (i = 0; i < strs.Length; i++)
            {
                parent.jobman.AddJob(new Job(strs[i], ActionType.Clone, this.parent.basepath));
            }

            parent.jobman.ExecuteAllJobs();
        }
Exemplo n.º 35
0
 private void addFolderToolStripMenuItem_Click(object sender, EventArgs e)
 {
     _InputBox = new frmInput(this, "Add Folder", "Type the name of the folder:", FileAction.NewFolder);
 }
Exemplo n.º 36
0
		void miNewCategoryClick(object sender, System.EventArgs e)
		{
			frmInput input = new frmInput();
			input.Question = StoreReader.STORE_CATEGORYNEW_INPUT;
			input.Caption = "Create New Category...";
			DialogResult result = input.ShowDialog(this);

			if (result == DialogResult.OK)
			{
				Methods.CreateNewCategory(storeReader, input.Input, (int)tvCategories.SelectedNode.Tag);
				Methods.PopulateCategoriesView(tvCategories, storeReader);
			}
		}
Exemplo n.º 37
0
 private void editToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (lstList.SelectedItems.Count > 0)
     {
         string tmpselectedstring = lstList.SelectedItem.ToString();
         int index = lstList.SelectedIndex;
         frmInput fi = new frmInput();
         fi.Caption = Settings.ApplicationName + "-" + tmpselectedstring;
         fi.Label = "Change Text";
         fi.Value = tmpselectedstring;
         if (fi.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             lstList.Items[lstList.SelectedIndex] = fi.Value;
             SaveWordsToFile();
         }
     }
 }
Exemplo n.º 38
0
		void miRenameReplayClick(object sender, System.EventArgs e)
		{
			Replay replay = null;
			if (lvReplays.SelectedItems.Count == 1)
			{
				ReplayStore.ReplayRow row = storeReader.GetReplayByID((int)lvReplays.SelectedItems[0].Tag);

				frmInput input = new frmInput();
				string question = StoreReader.STORE_REPLAYNAMERENAME_INPUT.Replace("{0}", row.Name);;
				input.Question = question;
				input.Caption = "Replay Rename...";
				input.Input = row.Name;
				input.MaxLength = 255;
				DialogResult result = input.ShowDialog(this);

				if (result == DialogResult.OK)
				{
					ReplayReader reader = new ReplayReader(replayManager.ReplayManagerFilePath + @"\" + row.Filename);
					replay = reader.Read();
					if (replay != null && replayManager.RenameReplay(replay, input.Input))
					{
						Methods.RenameReplay(storeReader, row.ID, input.Input);
						dvReplays = Methods.CreateReplayDataView(storeReader, storeReader.Replays);
						Methods.PopulateReplaysView(lvReplays, dvReplays, dvReplays.RowFilter, dvReplays.Sort);
					}
					else
					{
						string error = ReplayManager.MANAGER_REPLAYFILERENAME_FAIL.Replace("{0}", row.Filename);
						error = error.Replace("{1}", input.Input);

						MessageBox.Show(this, error, "Rename failed!", MessageBoxButtons.OK, MessageBoxIcon.Error);
					}
				}
			}
			else
				MessageBox.Show(this, StoreReader.STORE_REPLAYFILERENAME_SELECT, "Rename failed!", MessageBoxButtons.OK, MessageBoxIcon.Error);
		}
Exemplo n.º 39
0
        //
        private void btEdit_Click(object sender, EventArgs e)
        {
            if (this.checkedListBox1.SelectedIndex >= 0 && this.checkedListBox1.SelectedIndex < this.checkedListBox1.Items.Count) {
                Layer layer = this.checkedListBox1.Items[this.checkedListBox1.SelectedIndex] as Layer;
                if (!CkRight(layer)) {
                    MessageBox.Show("����ͼ�㲻�ܸ�����ɾ����", "��ʾ", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                frmInput dlg = new frmInput();
                dlg.id = symbolDoc.SvgdataUid;
                dlg.symbolDoc = symbolDoc;
                dlg.InputString = layer.Label;
                dlg.InputType = layer.GetAttribute("layerType");

                DialogResult d = dlg.ShowDialog(this);
                if (d == DialogResult.OK) {
                    layer.Label = dlg.InputString;
                    layer.SetAttribute("layerType", dlg.InputType);
                    InitData();
                }
                if (d == DialogResult.Retry) {
                    if (dlg.list.Count > 1) {
                        layer.SetAttribute("ParentID", dlg.list[1].ToString());
                        SVG_LAYER temp = new SVG_LAYER();
                        temp.SUID = layer.ID;
                        temp.svgID = symbolDoc.SvgdataUid;
                        SVG_LAYER lar = (SVG_LAYER)Services.BaseService.GetObject("SelectSVG_LAYERByKey", temp);
                        lar.YearID = dlg.list[1].ToString();
                        Services.BaseService.Update<SVG_LAYER>(lar);
                    }
                }

            }
        }
Exemplo n.º 40
0
 private void btnOutput_Click(object sender, EventArgs e)
 {
     Mainnumber = new frmInput();
     Mainnumber.Out = this;
     Mainnumber.Show();
 }
Exemplo n.º 41
0
        private void btAdd_Click(object sender, EventArgs e)
        {
            frmInput dlg = new frmInput();
            dlg.InputType = progtype;
            if (dlg.ShowDialog(this) == DialogResult.OK) {
                if (Layer.CkLayerExist(dlg.InputString, this.SymbolDoc)) {
                    MessageBox.Show("�ĵ����Ѿ�����ͬ��ͼ�㡣", "��ʾ", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                Layer lar = Layer.CreateNew(dlg.InputString, this.SymbolDoc);
                lar.SetAttribute("layerType", dlg.InputType);
                if (ilist.Count > 0) {
                    lar.SetAttribute("ParentID", ilist[0].ToString());
                }
                addflag = true;
                this.checkedListBox1.Items.Add(lar, true);
                checkedListBox1.SelectedIndex = checkedListBox1.Items.Count - 1;

                if (this.checkedListBox1.SelectedIndex != -1) {
                    Layer layer = this.checkedListBox1.Items[this.checkedListBox1.SelectedIndex] as Layer;
                    if (checkedListBox1.GetItemCheckState(checkedListBox1.SelectedIndex) == CheckState.Checked) {
                        layer.Visible = true;
                    } else {
                        layer.Visible = false;
                    }
                }

                //string guid=Guid.NewGuid().ToString();
                //GraPowerRelation gra = new GraPowerRelation();
                //gra.UID = Guid.NewGuid().ToString();
                //gra.PowerEachID = guid;
                //gra.LayerID = lar.ID;
                //Services.BaseService.Create<GraPowerRelation>(gra);

                //SVG_LAYER layer = new SVG_LAYER();
                //layer.SUID = lar.ID;
                //layer.svgID = symbolDoc.SvgdataUid;
                //layer.NAME = lar.Label;
                //layer.XML = txt;
                //layer.MDATE = System.DateTime.Now;
                //layer.OrderID = list.IndexOf(lar);
                //layer.YearID = lar.GetAttribute("ParentID");
                //layer.IsChange = lar.GetAttribute("IsChange");
                //layer.visibility = lar.GetAttribute("visibility");
                //layer.layerType = lar.GetAttribute("layerType");
                //layer.IsSelect = lar.GetAttribute("IsSelect");
                //Services.BaseService.Create<SVG_LAYER>(_svg);

            }
        }
Exemplo n.º 42
0
    private void button1_Click(object sender, EventArgs e)
    {
        frmInput f = new frmInput();

        f.ShowDialog(this);
    }
Exemplo n.º 43
0
        private void btnProcessSend_Click(object sender, EventArgs e)
        {
            if (ValidateInput())
            {
                clsSmartCashTransaction sc = new clsSmartCashTransaction();
                sc.TransDate       = DateTime.Now;
                sc.SenderName      = txtSenderName.Text.Trim();
                sc.SenderContact   = txtSenderNum.Text.Trim();
                sc.Load_Id         = m_LoadAccount.LoadId;
                sc.Remarks         = " ";
                sc.RecepientAccNum = " ";
                sc.UserId          = myPosWide.m_user.UserId;
                if (tabCtrl.SelectedIndex == 0)
                {
                    sc.TransType        = SCashTranstype.SEND;
                    sc.RecipientName    = txtSSRecipientName.Text.Trim();
                    sc.RecipientContact = txtSSRecipientNum.Text.Trim();
                    sc.RecepientAccNum  = txtSSSmartMoney.Text.Trim();

                    sc.RefNum       = txtSSRefNum.Text;
                    sc.TransAmount  = double.Parse(txtSSAmount.Text.Trim());
                    sc.SvcFeeAmount = double.Parse(txtSSSvcFee.Text.Trim());
                    sc.Rebate       = double.Parse(txtSSCommission.Text.Trim());
                    sc.Remarks      = clsSmartCashTransaction.GetTransType(sc.TransType);
                    frmInput input     = new frmInput();
                    double   amountdue = sc.TransAmount + sc.SvcFeeAmount;
                    input.Title   = "Payment";
                    input.Value   = amountdue.ToString("0.00");
                    input.Caption = "Enter Tendered Amount";
                    if (input.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                    {
                        if (Convert.ToDouble(input.Value) >= amountdue)
                        {
                            sc.TenderedAmount = Convert.ToDouble(input.Value);
                            if (sc.Save())
                            {
                                string  ret = "";
                                Receipt or  = new Receipt();
                                or.InitializePrinter();
                                List <string> strmsg = new List <string>();
                                ret += or.PrintCompanyHeader();
                                strmsg.Add("SMART MONEY");
                                strmsg.Add(sc.Remarks);
                                ret += or.PrintHeader(strmsg, PrintFontAlignment.Center, PrintFontSize.UnderlineBold);
                                strmsg.Clear();

                                strmsg.Add(string.Format("Cashier: {0}", myPosWide.m_user.UserName.ToUpper()));
                                strmsg.Add(string.Format("Date: {0}", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")));
                                strmsg.Add(string.Format("TransId: {0}", sc.SCashTransId));
                                strmsg.Add("");
                                strmsg.Add(string.Format("Sender: {0:0.00}", sc.SenderName));
                                strmsg.Add(string.Format("Contact Num: {0:0.00}", sc.SenderContact));
                                strmsg.Add(string.Format("Recipient: {0:0.00}", sc.RecipientName));
                                strmsg.Add(string.Format("Contact: {0:0.00}", sc.RecipientContact));
                                strmsg.Add(string.Format("Smart Money: {0:0.00}", sc.RecepientAccNum));
                                strmsg.Add(string.Format("RefNum: {0:0.00}", sc.RefNum));
                                strmsg.Add(string.Format("Trans Amount: P {0:0.00}", sc.TransAmount));
                                strmsg.Add(string.Format("Service Fee: P {0:0.00}", sc.SvcFeeAmount));
                                strmsg.Add(string.Format("Total Amount: P {0:0.00}", amountdue));
                                strmsg.Add(string.Format("Tendered Amount: P {0:0.00}", sc.TenderedAmount));
                                strmsg.Add(string.Format("Change Amount: P {0:0.00}", sc.TenderedAmount - amountdue));
                                strmsg.Add("");
                                strmsg.Add("");
                                ret += or.PrintAppend(strmsg, PrintFontAlignment.Left, PrintFontSize.Regular);
                                or.FormFeed();
                                or.OpenDrawer();
                                or.ExecPrint(ret);
                                strmsg.Clear();
                                Clear();
                                m_LoadAccount = clsLoadAccount.GetLoadAccount(m_LoadAccount.LoadId);
                                RefreshAccount();
                            }
                            else
                            {
                                MessageBox.Show("Saving failed", "Save", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            }
                        }
                        else
                        {
                            MessageBox.Show("Amount entered is less than the Amount Due", "Payment", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                    }
                }
                else if (tabCtrl.SelectedIndex == 1)
                {
                    sc.TransType = SCashTranstype.ENCASH;
                    if (optCash.Checked)
                    {
                        sc.PaymentMode = SCashPaymentMode.CASH;
                    }
                    else if (optSmartMoney.Checked)
                    {
                        sc.PaymentMode = SCashPaymentMode.SMARTMONEY;
                    }

                    sc.SenderAccnum       = txtCSSmartMoney.Text;
                    sc.RefNum             = txtCSRefNum.Text;
                    sc.TransAmount        = double.Parse(txtCSAmount.Text.Trim());
                    sc.SvcFeeAmount       = double.Parse(txtCSSvcFee.Text.Trim());
                    sc.Rebate             = 0; // double.Parse(txtCSCommission.Text.Trim());
                    sc.TotalAmtTransfered = double.Parse(txtCSTotalAmtTrans.Text);


                    if (MessageBox.Show(string.Format("You are about to deduct {0:0.00} from your actual cash on hand.\n\nAre you sure this is correct?", sc.TransAmount - sc.SvcFeeAmount), "Payment", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
                    {
                        if (sc.Save())
                        {
                            if (clsUnclaimedCash.ClaimCash(sc.RefNum))
                            {
                                UpdateList();
                            }
                            string  ret = "";
                            Receipt or  = new Receipt();
                            or.InitializePrinter();
                            List <string> strmsg = new List <string>();
                            ret += or.PrintCompanyHeader();
                            strmsg.Add("SMART MONEY");
                            strmsg.Add(sc.Remarks);
                            ret += or.PrintHeader(strmsg, PrintFontAlignment.Center, PrintFontSize.UnderlineBold);
                            strmsg.Clear();

                            strmsg.Add(string.Format("Cashier: {0}", myPosWide.m_user.UserName.ToUpper()));
                            strmsg.Add(string.Format("Date: {0}", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")));
                            strmsg.Add(string.Format("TransId: {0}", sc.SCashTransId));
                            strmsg.Add("");
                            strmsg.Add(string.Format("Sender: {0:0.00}", sc.SenderName));
                            strmsg.Add(string.Format("Contact Num: {0:0.00}", sc.SenderContact));
                            strmsg.Add(string.Format("Smart Money: {0:0.00}", sc.RecepientAccNum));
                            strmsg.Add(string.Format("RefNum: {0:0.00}", sc.RefNum));
                            strmsg.Add(string.Format("Trans Amount: P {0:0.00}", sc.TransAmount));
                            strmsg.Add(string.Format("Service Fee: P {0:0.00}", sc.SvcFeeAmount));
                            strmsg.Add(string.Format("Payout Amount: P {0:0.00}", sc.TransAmount - sc.SvcFeeAmount));
                            strmsg.Add("");
                            strmsg.Add("");
                            ret += or.PrintAppend(strmsg, PrintFontAlignment.Left, PrintFontSize.Regular);
                            or.FormFeed();
                            or.OpenDrawer();
                            or.ExecPrint(ret);
                            strmsg.Clear();
                            Clear();
                            RefreshAccount();
                        }
                    }
                }
            }
        }
        private void tsbPointcutEdit_Click(object sender, EventArgs e)
        {
            if (existPointcut())
            {
                frmInput.text1 = aspects[gvAspect.CurrentRow.Index].Advices[gvAdvice.CurrentRow.Index].Pointcuts[gvPointcut.CurrentRow.Index].Process;
                frmInput.text2 = aspects[gvAspect.CurrentRow.Index].Advices[gvAdvice.CurrentRow.Index].Pointcuts[gvPointcut.CurrentRow.Index].Task;
                frmInput.text3 = aspects[gvAspect.CurrentRow.Index].Advices[gvAdvice.CurrentRow.Index].Pointcuts[gvPointcut.CurrentRow.Index].Condition;

                frmInput inp = new frmInput(frmInput.FormType.mdPointcut, frmInput.FormMode.mdEdit);

                inp.ShowDialog();

                if (inp.DialogResult == System.Windows.Forms.DialogResult.OK)
                {
                    aspects[gvAspect.CurrentRow.Index].Advices[gvAdvice.CurrentRow.Index].Pointcuts[gvPointcut.CurrentRow.Index].Process = frmInput.text1;
                    aspects[gvAspect.CurrentRow.Index].Advices[gvAdvice.CurrentRow.Index].Pointcuts[gvPointcut.CurrentRow.Index].Task = frmInput.text2;
                    aspects[gvAspect.CurrentRow.Index].Advices[gvAdvice.CurrentRow.Index].Pointcuts[gvPointcut.CurrentRow.Index].Condition = frmInput.text3;

                    updateGridViewPointcut();
                }
            }
        }
Exemplo n.º 45
0
        private void btAdd_Click(object sender, EventArgs e)
        {
            frmInput dlg = new frmInput();
            dlg.InputType = progtype;
            if (dlg.ShowDialog(this) == DialogResult.OK) {
                if (Layer.CkLayerExist(dlg.InputString, this.SymbolDoc)) {
                    MessageBox.Show("�ĵ����Ѿ�����ͬ��ͼ�㡣", "��ʾ", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                Layer lar = Layer.CreateNew(dlg.InputString, this.SymbolDoc);
                lar.SetAttribute("layerType", dlg.InputType);
                if (ilist.Count > 0) {
                    lar.SetAttribute("ParentID", ilist[0].ToString());
                }
                addflag = true;
                //this.checkedListBox1.Items.Add(lar, true);
                //checkedListBox1.SelectedIndex = checkedListBox1.Items.Count - 1;
                DataTable dt = treeList1.DataSource as DataTable;
                SVG_LAYER _svg = new SVG_LAYER() { SUID = lar.ID, NAME = lar.Label };
                if (treeList1.FocusedNode != null) {
                    _svg.ParentID = treeList1.FocusedNode["ParentID"].ToString();
                    _svg.YearID = ilist[0].ToString();
                    _svg.svgID = symbolDoc.SvgdataUid;
                    _svg.OrderID = int.Parse(treeList1.FocusedNode["OrderID"].ToString()) + 1;
                    _svg.MDATE = DateTime.Now;
                    Services.BaseService.Create<SVG_LAYER>(_svg);
                }
                DataRow row = dt.NewRow();
                dt.Rows.Add(DataConverter.ObjectToRow(_svg, row));

                //_svg.SUID = lar.ID;
                //_svg.NAME = lar.Label;
                //_svg.svgID = SVGUID;
                //_svg.XML = txt;
                //_svg.MDATE = System.DateTime.Now;
                //_svg.OrderID = ny * 100 + list.IndexOf(lar);
                //_svg.YearID = tems_id;// lar.GetAttribute("ParentID");
                //_svg.IsChange = lar.GetAttribute("IsChange");
                //_svg.visibility = lar.GetAttribute("visibility");
                //_svg.layerType = lar.GetAttribute("layerType");
                //_svg.IsSelect = lar.GetAttribute("IsSelect");
                //Services.BaseService.Create<SVG_LAYER>(_svg);
                //if (this.checkedListBox1.SelectedIndex != -1) {
                //    Layer layer = this.checkedListBox1.Items[this.checkedListBox1.SelectedIndex] as Layer;
                //    if (checkedListBox1.GetItemCheckState(checkedListBox1.SelectedIndex) == CheckState.Checked) {
                //        layer.Visible = true;
                //    } else {
                //        layer.Visible = false;
                //    }
                //}

                //string guid=Guid.NewGuid().ToString();
                //GraPowerRelation gra = new GraPowerRelation();
                //gra.UID = Guid.NewGuid().ToString();
                //gra.PowerEachID = guid;
                //gra.LayerID = lar.ID;
                //Services.BaseService.Create<GraPowerRelation>(gra);

                //SVG_LAYER layer = new SVG_LAYER();
                //layer.SUID = lar.ID;
                //layer.svgID = symbolDoc.SvgdataUid;
                //layer.NAME = lar.Label;
                //layer.XML = txt;
                //layer.MDATE = System.DateTime.Now;
                //layer.OrderID = list.IndexOf(lar);
                //layer.YearID = lar.GetAttribute("ParentID");
                //layer.IsChange = lar.GetAttribute("IsChange");
                //layer.visibility = lar.GetAttribute("visibility");
                //layer.layerType = lar.GetAttribute("layerType");
                //layer.IsSelect = lar.GetAttribute("IsSelect");
                //Services.BaseService.Create<SVG_LAYER>(_svg);

            }
        }
Exemplo n.º 46
0
 private void linkLabel5_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     frmInput fi = new frmInput();
     if (fi.ShowDialog() == DialogResult.OK)
     {
         parent.jobman.AddJob(new Job(fi.input, ActionType.Clone, this.parent.basepath));
         parent.jobman.ExecuteAllJobs();
     }
 }