Ejemplo n.º 1
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        //{
        //    SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
        //    conn.Open();
        //    string insertQuery = "insert into [Table] ([name],[account],[amount]) values (@name1,@account1,@amount1)";
        //    SqlCommand com = new SqlCommand(insertQuery, conn);
        //    com.Parameters.AddWithValue("@name1", TextBox3.Text);
        //    com.Parameters.AddWithValue("@account1", TextBox1.Text);
        //    com.Parameters.AddWithValue("@amount1", TextBox2.Text);
        //    com.ExecuteNonQuery();
        //    Response.Redirect("manage.aspx");
        //    Response.Write("Transfer Successfull");
        //    conn.Close();
        //}

        //catch (Exception ex)
        //{
        //    Response.Write("Error:"+ex.ToString());
        //}
        if (FileUpload1.HasFile)
        {
            try
            {
                string filename = Path.GetFileName(FileUpload1.FileName);
                FileUpload1.SaveAs(Server.MapPath("~/") + filename);
                STATUS.Text = "Upload status: File uploaded!";
                if (Session["AdminFlag"] != null)
                {
                    VIEW_STATUS.Visible = Visible;
                    VIEW_STATUS.Text = "View All Transactions";

                }
                else
                {
                    VIEW_STATUS.Visible = Visible;
                }
                System.Diagnostics.Debug.WriteLine("Transfer Operation");
                System.Diagnostics.Debug.WriteLine("UserName:"******"New"].ToString());
                System.Diagnostics.Debug.WriteLine("User GUID:" + Session["SESSIONID"].ToString());
                System.Diagnostics.Debug.WriteLine("Session ID:" + HttpContext.Current.Session.SessionID);

                string file = Server.MapPath("~/ ") + filename;
                TParser parse = new TParser(file);
                TransactionBuilder build = new TransactionBuilder();
                int BatchId = parse.Parse(build);
                TransactionQueue queue = build.SetBatch(BatchId);
                TransactionService service = new TransactionService();
                service.Start(queue);

            }
            catch (Exception ex)
            {
                STATUS.Text = "Upload status: The file could not be uploaded. The following error occured: " + ex.Message;
            }
        }
    }
Ejemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            string s = textBox1.Text;

            tree = new TParser(ClientRectangle.Width, ClientRectangle.Height);
            tree.Recyrse(s, out tree.top);
            tree.SetXY(tree.top, 200, 60);
            label1.Text = "= " + Convert.ToString(tree.top.Value);
            MyDraw();
        }
Ejemplo n.º 3
0
 static void Main(string[] args)
 {
     string file = @"C:\Users\Priyank Kapadia\BankInformation\Batch\batch.txt";
     TParser parse = new TParser(file);
     TransactionBuilder build = new TransactionBuilder();
     int BatchId =  parse.Parse(build);
     TransactionQueue queue =  build.SetBatch(BatchId);
     TransactionService service = new TransactionService();
     service.Start(queue);
 }
Ejemplo n.º 4
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        //{
        //    SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
        //    conn.Open();
        //    string insertQuery = "insert into [Table] ([name],[account],[amount]) values (@name1,@account1,@amount1)";
        //    SqlCommand com = new SqlCommand(insertQuery, conn);
        //    com.Parameters.AddWithValue("@name1", TextBox3.Text);
        //    com.Parameters.AddWithValue("@account1", TextBox1.Text);
        //    com.Parameters.AddWithValue("@amount1", TextBox2.Text);
        //    com.ExecuteNonQuery();
        //    Response.Redirect("manage.aspx");
        //    Response.Write("Transfer Successfull");
        //    conn.Close();
        //}

        //catch (Exception ex)
        //{
        //    Response.Write("Error:"+ex.ToString());
        //}
        if (FileUpload1.HasFile)
        {
            try
            {
                string filename = Path.GetFileName(FileUpload1.FileName);
                FileUpload1.SaveAs(Server.MapPath("~/") + filename);
                STATUS.Text = "Upload status: File uploaded!";
                if (Session["AdminFlag"] != null)
                {
                    VIEW_STATUS.Visible = Visible;
                    VIEW_STATUS.Text    = "View All Transactions";
                }
                else
                {
                    VIEW_STATUS.Visible = Visible;
                }
                System.Diagnostics.Debug.WriteLine("Transfer Operation");
                System.Diagnostics.Debug.WriteLine("UserName:"******"New"].ToString());
                System.Diagnostics.Debug.WriteLine("User GUID:" + Session["SESSIONID"].ToString());
                System.Diagnostics.Debug.WriteLine("Session ID:" + HttpContext.Current.Session.SessionID);

                string             file  = Server.MapPath("~/ ") + filename;
                TParser            parse = new TParser(file);
                TransactionBuilder build = new TransactionBuilder();
                int BatchId = parse.Parse(build);
                TransactionQueue   queue   = build.SetBatch(BatchId);
                TransactionService service = new TransactionService();
                service.Start(queue);
            }
            catch (Exception ex)
            {
                STATUS.Text = "Upload status: The file could not be uploaded. The following error occured: " + ex.Message;
            }
        }
    }
Ejemplo n.º 5
0
        static void Main(string[] args)
        {
            string             file  = @"C:\Users\Priyank Kapadia\BankInformation\Batch\batch.txt";
            TParser            parse = new TParser(file);
            TransactionBuilder build = new TransactionBuilder();
            int BatchId = parse.Parse(build);
            TransactionQueue   queue   = build.SetBatch(BatchId);
            TransactionService service = new TransactionService();

            service.Start(queue);
        }
Ejemplo n.º 6
0
        private void Form1_Load(object sender, EventArgs e)
        {
            g = CreateGraphics();
            string s = textBox1.Text;

            tree = new TParser(ClientRectangle.Width, ClientRectangle.Height);
            tree.Recyrse(s, out tree.top);
            tree.SetXY(tree.top, 200, 60);
            label1.Text = "= " + Convert.ToString(tree.top.Value);
            MyDraw();
        }
Ejemplo n.º 7
0
Archivo: Main.cs Proyecto: dfneto/comdd
        public static void Main(string[] args)
        {
            if (args.Length == 1)
            {

                ICharStream input = new ANTLRFileStream(args[0]);
                TLexer lex = new TLexer(input);
                CommonTokenStream tokens = new CommonTokenStream(lex);
                //System.out.println("tokens="+tokens);
                TParser parser = new TParser(tokens);
                parser.stat();
            }
            else
                Console.Error.WriteLine("Usage: hoisted <input-file>");
        }
Ejemplo n.º 8
0
        private void button9_Click(object sender, EventArgs e)
        {
            string s = textBox1.Text;

            parser = new TParser();
            try
            {
                parser.SetOperator(ref s, out parser.topOp);
                MyDraw(II, JJ, g);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Ejemplo n.º 9
0
        private void Form1_Load(object sender, EventArgs e)
        {
            MouseWheel += new MouseEventHandler(Form1_MouseWheel);
            string s = textBox1.Text;

            parser = new TParser();
            try
            {
                parser.SetOperator(ref s, out parser.topOp);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Ejemplo n.º 10
0
        public static TParser Get <TParser>()
            where TParser : NamedParser, new()
        {
            var         type = typeof(TParser);
            NamedParser singleton;

            if (_sSingletons.TryGetValue(type, out singleton))
            {
                return((TParser)singleton);
            }

            singleton = new TParser();
            _sSingletons.Add(type, singleton);
            return((TParser)singleton);
        }
Ejemplo n.º 11
0
 public static void Main(string[] args)
 {
     if (args.Length == 1)
     {
         ICharStream       input  = new ANTLRFileStream(args[0]);
         TLexer            lex    = new TLexer(input);
         CommonTokenStream tokens = new CommonTokenStream(lex);
         //System.out.println("tokens="+tokens);
         TParser parser = new TParser(tokens);
         parser.stat();
     }
     else
     {
         Console.Error.WriteLine("Usage: hoisted <input-file>");
     }
 }
Ejemplo n.º 12
0
        private void buttonRun_Click(object sender, EventArgs e)
        {
            string s = textBox1.Text;

            tree = new TParser(ClientRectangle.Width, ClientRectangle.Height);
            tree.Expression(ref s, out tree.top);
            if (tree.error == 0)
            {
                tree.SetXY(tree.top, 200, 60);
                label1.Text = "= " + Convert.ToString(tree.top.Value);
                MyDraw();
            }
            else
            {
                MessageBox.Show("Error = " + tree.error.ToString() + " " + tree.errorToString());
            }
        }
Ejemplo n.º 13
0
        public NodesCollection <Node> Parse(string code)
        {
            var input  = new AntlrInputStream(code);
            var lexer  = new TLexer(input);
            var tokens = new CommonTokenStream(lexer);

            tokens.Fill();


            var parser = new TParser(tokens);

            parser.RemoveErrorListeners();
            parser.AddErrorListener(ParseErrorListener.Instance);

            var res = VisitMain(parser.main());

            return(res.As <NodesCollection <Node> >());
        }
Ejemplo n.º 14
0
 public static void Main(string[] args)
 {
     if (args.Length > 0)
     {
         string inputFileName = args[0];
         if (!Path.IsPathRooted(inputFileName))
         {
             inputFileName = Path.Combine(Environment.CurrentDirectory, inputFileName);
         }
         ICharStream input = new ANTLRFileStream(inputFileName);
         TLexer lex = new TLexer(input);
         ITokenStream tokens = new TokenRewriteStream(lex);
         TParser parser = new TParser(tokens);
         parser.program();
         Console.Out.WriteLine(tokens);
     }
     else
         Console.Error.WriteLine("Usage: tweak <input-file>");
 }
Ejemplo n.º 15
0
Archivo: Main.cs Proyecto: dfneto/comdd
        public static void Main(string[] args)
        {
            if (args.Length == 1)
            {
                string inputFileName = args[0];
                if (!Path.IsPathRooted(inputFileName))
                {
                    inputFileName = Path.Combine(Environment.CurrentDirectory, inputFileName);
                }

                ICharStream input = new ANTLRFileStream(inputFileName);
                TLexer lex = new TLexer(input);
                CommonTokenStream tokens = new CommonTokenStream(lex);
                //System.out.println("tokens="+tokens);
                TParser parser = new TParser(tokens);
                parser.program();
            }
            else
                Console.Error.WriteLine("Usage: dynscope <input-file>");
        }
Ejemplo n.º 16
0
 public static void Main(string[] args)
 {
     if (args.Length > 0)
     {
         string inputFileName = args[0];
         if (!Path.IsPathRooted(inputFileName))
         {
             inputFileName = Path.Combine(Environment.CurrentDirectory, inputFileName);
         }
         ICharStream  input  = new ANTLRFileStream(inputFileName);
         TLexer       lex    = new TLexer(input);
         ITokenStream tokens = new TokenRewriteStream(lex);
         TParser      parser = new TParser(tokens);
         parser.program();
         Console.Out.WriteLine(tokens);
     }
     else
     {
         Console.Error.WriteLine("Usage: tweak <input-file>");
     }
 }
Ejemplo n.º 17
0
        public static void Main(string[] args)
        {
            if (args.Length == 1)
            {
                string inputFileName = args[0];
                if (!Path.IsPathRooted(inputFileName))
                {
                    inputFileName = Path.Combine(Environment.CurrentDirectory, inputFileName);
                }

                ICharStream       input  = new ANTLRFileStream(inputFileName);
                TLexer            lex    = new TLexer(input);
                CommonTokenStream tokens = new CommonTokenStream(lex);
                //System.out.println("tokens="+tokens);
                TParser parser = new TParser(tokens);
                parser.program();
            }
            else
            {
                Console.Error.WriteLine("Usage: dynscope <input-file>");
            }
        }
Ejemplo n.º 18
0
 public SieveConfiguration WithParser <TParser>()
     where TParser : class, IParser, new()
 {
     Parser = new TParser();
     return(this);
 }