SlideShare ist ein Scribd-Unternehmen logo
1 von 5
Downloaden Sie, um offline zu lesen
Di WebTech Mail - (no subject)                                         https://mail.google.com/mail/u/0/?ui=2&ik=f2506c64f4&view=pt&searc...




                                                                                     Ankur Kumar <akumar@diwebtech.com>



          (no subject)
          1 message

          Pankaj Sharma <pksharma@diwebtech.com>                                                   Tue, Jul 24, 2012 at 11:29 AM
          To: Ankur Kumar <akumar@diwebtech.com>

            using System;
            using System.Linq;
            using System.Web;
            using System.Web.Services;
            using System.Web.Services.Protocols;
            using System.Xml.Linq;
            using MySql.Data.MySqlClient;
            using System.Data;
            using System.Net;
            using System.IO;
            [WebService(Namespace = "http://rwa47.org/")]
            [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
            // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
            // [System.Web.Script.Services.ScriptService]

            public class Service : System.Web.Services.WebService
            {

              MySqlConnection connection = new MySqlConnection("server=localhost; user=root; password=123;
            database=easymoney");
              public Service()
              {

               }
               public struct RawDataEnq
               {
                 public String transdate;
                 public String usrtransid;
                 public String usrcity;
                 public String usrbank;
                 public String usrname;
                 public String usraccountno;
                 public String usramount;
               }
               public struct RawDataLogin
               {
                 public String id;
                 public bool result;

               }
               public struct RawData
               {
                 public String username;
                 public String amount;
                 public String type;
                 public String comment;
                 public String date;




1 of 5                                                                                                                     9/1/2012 8:24 PM
Di WebTech Mail - (no subject)                                          https://mail.google.com/mail/u/0/?ui=2&ik=f2506c64f4&view=pt&searc...



                   public String prevbal;
                   public String id;
                   public String time;

               }

               [WebMethod]
               public DataSet connectoToMySql()
               {
                 MySqlDataAdapter mysqlAdap = new MySqlDataAdapter("SELECT * FROM pankajku201235", connection);
                 DataSet ds = new DataSet();
                 mysqlAdap.Fill(ds, "users");
                 return ds;
               }
               [WebMethod]
               public RawDataLogin [] LoginCheck(string user_id, string user_pass)
               {

                 MySqlCommand mycommand = connection.CreateCommand();
                 connection.Open();
                 //mycommand.CommandText = "SELECT COUNT(*) FROM members where (username='" + user_id + "' and
            password='" + user_pass + "')";
                 //object scalar = mycommand.ExecuteScalar();
                 //int rows = int.Parse(scalar.ToString());
                 //mycommand.Dispose();
                 int i = 0;
                 mycommand.CommandText = "Select id,username,password from members where (username='" + user_id + "'
            and password='" + user_pass + "')";
                 RawDataLogin[] Data = new RawDataLogin[1];
                                                              )
                 MySqlDataAdapter myDA = new MySqlDataAdapter(mycommand);
                 MySqlDataReader reader = mycommand.ExecuteReader();
                 while (reader.Read())
                 {

                     if (user_id.Equals(reader.GetString(1).ToString()) && user_pass.Equals(reader.GetString(2).ToString()))
                     {
                         Data[i].id = reader.GetString(0).ToString();
                         Data[i].result = true;
                     }
                     else
                     {
                         Data[i].result = false ;
                     }
                   }
                   reader.Close();
                   return Data ;

               }
               [WebMethod]
               public RawData [] MyAccount(string user_id)
               {
                 MySqlCommand mycommand = connection.CreateCommand();
                 connection.Open();
                 mycommand.CommandText = "SELECT COUNT(*) FROM recharge where username='"+user_id +"'";
                 object scalar = mycommand.ExecuteScalar();
                 int rows = int.Parse(scalar.ToString());
                 mycommand.Dispose();
                 int i = 0;




2 of 5                                                                                                                      9/1/2012 8:24 PM
Di WebTech Mail - (no subject)                                     https://mail.google.com/mail/u/0/?ui=2&ik=f2506c64f4&view=pt&searc...



                 mycommand.CommandText = "Select * from recharge where username='" + user_id + "'";
                 RawData[] Data = new RawData[rows];
                 MySqlDataAdapter myDA = new MySqlDataAdapter(mycommand);
                 MySqlDataReader reader = mycommand.ExecuteReader();
                 while (reader.Read())
                 {
                    if (i < rows)
                    {
                        Data[i].username = reader.GetString(0).ToString();
                        Data[i].amount = reader.GetString(1).ToString();
                        Data[i].type = reader.GetString(2).ToString();
                        Data[i].comment = reader.GetString(3).ToString();
                        Data[i].date = reader.GetString(4).ToString();
                        Data[i].prevbal = reader.GetString(5).ToString();
                        Data[i].id = reader.GetString(6).ToString();
                        Data[i].time = reader.GetString(6).ToString();
                    }
                    i++;
                 }
                 reader.Close();
                 return Data;
               }
               [WebMethod]
               public RawDataEnq[] Enquiry(string user_id, DateTime start_date, DateTime end_date)
               {
                  MySqlCommand mycommand = connection.CreateCommand();
                  connection.Open();
                  mycommand.CommandText = "SELECT COUNT(*) FROM " + user_id + " where transdate between '" +
            start_date.Date.ToString("yyyy-MM-dd") + "' and '" + end_date.Date.ToString("yyyy-MM-dd") + "'";
                  object scalar = mycommand.ExecuteScalar();              6
                  int rows = int.Parse(scalar.ToString());
                  mycommand.Dispose();
                  int i = 0;
                  mycommand.CommandText = "Select transdate,usrtransid,usrcity,usrbank,usrname,usraccountno,usramount
            from " + user_id + " where transdate between '" + start_date.Date.ToString("yyyy-MM-dd") + "' and '" +
            end_date.Date.ToString("yyyy-MM-dd") + "'";
                  RawDataEnq[] Data = new RawDataEnq[rows];
                  MySqlDataAdapter myDA = new MySqlDataAdapter(mycommand);
                  MySqlDataReader reader = mycommand.ExecuteReader();
                  while (reader.Read())
                  {
                      if (i < rows)
                      {
                          Data[i].transdate = reader.GetString(0).ToString();
                          Data[i].usraccountno = reader.GetString(1).ToString();
                          Data[i].usramount = reader.GetString(2).ToString();
                          Data[i].usrbank = reader.GetString(3).ToString();
                          Data[i].usrcity = reader.GetString(4).ToString();
                          Data[i].usrname = reader.GetString(5).ToString();
                          Data[i].usrtransid = reader.GetString(6).ToString();

                    }
                    i++;
                 }
                 reader.Close();
                 return Data;




3 of 5                                                                                                                 9/1/2012 8:24 PM
Di WebTech Mail - (no subject)                                           https://mail.google.com/mail/u/0/?ui=2&ik=f2506c64f4&view=pt&searc...



               }
               [WebMethod]
               public bool ChangePassword(string user_id, string current_pass, string new_pass)
               {
                 MySqlCommand mycommand = connection.CreateCommand();
                 connection.Open();

                 mycommand.CommandText = "update members set password='" + new_pass + "' where username='" +
            user_id + "' and password='" + current_pass + "'";
                 mycommand.ExecuteNonQuery();
                 mycommand.Dispose();
                 bool result = false;
                 mycommand.CommandText = "Select username,password from members where (username='" + user_id + "')";
                 MySqlDataAdapter myDA = new MySqlDataAdapter(mycommand);
                 MySqlDataReader reader = mycommand.ExecuteReader();
                 while (reader.Read())
                 {
                    if (new_pass.Equals(reader.GetString(1).ToString()))
                        result = true;

                 }
                 reader.Close();
                 return result;
              }
              [WebMethod]
              public string MoneyTransfer(string user_id, string user_bank, string user_city, string user_name, string
            user_accountno, int user_amount)
              {
                 MySqlCommand mycommand = connection.CreateCommand();
                 connection.Open();                                    e
                 mycommand.CommandText = "Select afterbal from " + user_id + " ";
                 MySqlDataAdapter myDA = new MySqlDataAdapter(mycommand);
                 MySqlDataReader reader = mycommand.ExecuteReader();
                 int rows = 0;
                 while (reader.Read())
                 {
                     rows = int.Parse(reader.GetString(0).ToString());

                  }
                  int user_prevbal = rows;
                  int user_afterbal = rows - (user_amount + 50);
                  DateTime user_transdate = DateTime.Today;
                  DateTime user_transtime = DateTime.Now;
                  reader.Close();
                  mycommand.Dispose();
                  mycommand.CommandText = "insert into " + user_id + " (usrtransid,usrvoucherno,usrbank,usrstate,usrdistrict,
            usrcity,usrname,usraccountno,usramount,transdate,transtime,usrifsccode ,prevbal,afterbal) values(500,100,'" +
            user_bank + "','up','lko','" + user_city + "','" + user_name + "','" + user_accountno + "'," + user_amount + ",'" +
            user_transdate.Date.ToString("yyyy-MM-dd") + "','" + user_transtime.ToString("HH:mm:ss") + "','fdfd'," +
            user_prevbal + "," + user_afterbal + ")";
                  mycommand.ExecuteNonQuery();
                  mycommand.Dispose();
                  string s = "";
                  mycommand.CommandText = "Select usrname from " + user_id + " ";
                  MySqlDataAdapter myDA1 = new MySqlDataAdapter(mycommand);
                  MySqlDataReader reader1 = mycommand.ExecuteReader();
                  while (reader.Read())
                  {




4 of 5                                                                                                                       9/1/2012 8:24 PM
Di WebTech Mail - (no subject)                                         https://mail.google.com/mail/u/0/?ui=2&ik=f2506c64f4&view=pt&searc...



                      s = reader1.GetString(0).ToString();

                    }
                    reader1.Close();
                    return s;
                }
                [WebMethod]
                public string CurrentBalance(string user_id)
                {
                  string rows = "";
                  MySqlCommand mycommand = connection.CreateCommand();
                  connection.Open();
                  mycommand.CommandText = "Select afterbal from " + user_id + " ";
                  MySqlDataAdapter myDA = new MySqlDataAdapter(mycommand);
                  MySqlDataReader reader = mycommand.ExecuteReader();

                    while (reader.Read())
                    {
                      rows =reader.GetString(0).ToString();

                    }
                    reader.Close();
                    return rows;
                }
            }




                                                                   e




5 of 5                                                                                                                     9/1/2012 8:24 PM

Weitere ähnliche Inhalte

Was ist angesagt?

Indexing and Query Optimization
Indexing and Query OptimizationIndexing and Query Optimization
Indexing and Query OptimizationMongoDB
 
Indexing & Query Optimization
Indexing & Query OptimizationIndexing & Query Optimization
Indexing & Query OptimizationMongoDB
 
Reducing Development Time with MongoDB vs. SQL
Reducing Development Time with MongoDB vs. SQLReducing Development Time with MongoDB vs. SQL
Reducing Development Time with MongoDB vs. SQLMongoDB
 
Rapid and Scalable Development with MongoDB, PyMongo, and Ming
Rapid and Scalable Development with MongoDB, PyMongo, and MingRapid and Scalable Development with MongoDB, PyMongo, and Ming
Rapid and Scalable Development with MongoDB, PyMongo, and MingRick Copeland
 
Spring data presentation
Spring data presentationSpring data presentation
Spring data presentationOleksii Usyk
 
Tame Accidental Complexity with Ruby and MongoMapper
Tame Accidental Complexity with Ruby and MongoMapperTame Accidental Complexity with Ruby and MongoMapper
Tame Accidental Complexity with Ruby and MongoMapperGiordano Scalzo
 
MongoDB .local Houston 2019: Using Client Side Encryption in MongoDB 4.2
MongoDB .local Houston 2019: Using Client Side Encryption in MongoDB 4.2MongoDB .local Houston 2019: Using Client Side Encryption in MongoDB 4.2
MongoDB .local Houston 2019: Using Client Side Encryption in MongoDB 4.2MongoDB
 
MongoDB and PHP ZendCon 2011
MongoDB and PHP ZendCon 2011MongoDB and PHP ZendCon 2011
MongoDB and PHP ZendCon 2011Steven Francia
 
Paintfree Object-Document Mapping for MongoDB by Philipp Krenn
Paintfree Object-Document Mapping for MongoDB by Philipp KrennPaintfree Object-Document Mapping for MongoDB by Philipp Krenn
Paintfree Object-Document Mapping for MongoDB by Philipp KrennJavaDayUA
 
Data access 2.0? Please welcome: Spring Data!
Data access 2.0? Please welcome: Spring Data!Data access 2.0? Please welcome: Spring Data!
Data access 2.0? Please welcome: Spring Data!Oliver Gierke
 
The Principle of Hybrid App.
The Principle of Hybrid App.The Principle of Hybrid App.
The Principle of Hybrid App.musart Park
 
Mongo db tutorials
Mongo db tutorialsMongo db tutorials
Mongo db tutorialsAnuj Jain
 
An introduction into Spring Data
An introduction into Spring DataAn introduction into Spring Data
An introduction into Spring DataOliver Gierke
 
Knot.x: when Vert.x and RxJava meet
Knot.x: when Vert.x and RxJava meetKnot.x: when Vert.x and RxJava meet
Knot.x: when Vert.x and RxJava meetTomasz Michalak
 
Using Arbor/ RGraph JS libaries for Data Visualisation
Using Arbor/ RGraph JS libaries for Data VisualisationUsing Arbor/ RGraph JS libaries for Data Visualisation
Using Arbor/ RGraph JS libaries for Data VisualisationAlex Hardman
 
JavaEE 8 on a diet with Payara Micro 5
JavaEE 8 on a diet with Payara Micro 5JavaEE 8 on a diet with Payara Micro 5
JavaEE 8 on a diet with Payara Micro 5Payara
 
Learn Ajax here
Learn Ajax hereLearn Ajax here
Learn Ajax herejarnail
 

Was ist angesagt? (18)

Indexing and Query Optimization
Indexing and Query OptimizationIndexing and Query Optimization
Indexing and Query Optimization
 
Indexing & Query Optimization
Indexing & Query OptimizationIndexing & Query Optimization
Indexing & Query Optimization
 
Reducing Development Time with MongoDB vs. SQL
Reducing Development Time with MongoDB vs. SQLReducing Development Time with MongoDB vs. SQL
Reducing Development Time with MongoDB vs. SQL
 
Rapid and Scalable Development with MongoDB, PyMongo, and Ming
Rapid and Scalable Development with MongoDB, PyMongo, and MingRapid and Scalable Development with MongoDB, PyMongo, and Ming
Rapid and Scalable Development with MongoDB, PyMongo, and Ming
 
Spring data presentation
Spring data presentationSpring data presentation
Spring data presentation
 
Tame Accidental Complexity with Ruby and MongoMapper
Tame Accidental Complexity with Ruby and MongoMapperTame Accidental Complexity with Ruby and MongoMapper
Tame Accidental Complexity with Ruby and MongoMapper
 
MongoDB .local Houston 2019: Using Client Side Encryption in MongoDB 4.2
MongoDB .local Houston 2019: Using Client Side Encryption in MongoDB 4.2MongoDB .local Houston 2019: Using Client Side Encryption in MongoDB 4.2
MongoDB .local Houston 2019: Using Client Side Encryption in MongoDB 4.2
 
MongoDB and PHP ZendCon 2011
MongoDB and PHP ZendCon 2011MongoDB and PHP ZendCon 2011
MongoDB and PHP ZendCon 2011
 
Paintfree Object-Document Mapping for MongoDB by Philipp Krenn
Paintfree Object-Document Mapping for MongoDB by Philipp KrennPaintfree Object-Document Mapping for MongoDB by Philipp Krenn
Paintfree Object-Document Mapping for MongoDB by Philipp Krenn
 
Data access 2.0? Please welcome: Spring Data!
Data access 2.0? Please welcome: Spring Data!Data access 2.0? Please welcome: Spring Data!
Data access 2.0? Please welcome: Spring Data!
 
The Principle of Hybrid App.
The Principle of Hybrid App.The Principle of Hybrid App.
The Principle of Hybrid App.
 
Mongo db tutorials
Mongo db tutorialsMongo db tutorials
Mongo db tutorials
 
An introduction into Spring Data
An introduction into Spring DataAn introduction into Spring Data
An introduction into Spring Data
 
Knot.x: when Vert.x and RxJava meet
Knot.x: when Vert.x and RxJava meetKnot.x: when Vert.x and RxJava meet
Knot.x: when Vert.x and RxJava meet
 
Using Arbor/ RGraph JS libaries for Data Visualisation
Using Arbor/ RGraph JS libaries for Data VisualisationUsing Arbor/ RGraph JS libaries for Data Visualisation
Using Arbor/ RGraph JS libaries for Data Visualisation
 
JavaEE 8 on a diet with Payara Micro 5
JavaEE 8 on a diet with Payara Micro 5JavaEE 8 on a diet with Payara Micro 5
JavaEE 8 on a diet with Payara Micro 5
 
Mongo indexes
Mongo indexesMongo indexes
Mongo indexes
 
Learn Ajax here
Learn Ajax hereLearn Ajax here
Learn Ajax here
 

Andere mochten auch

Indian Youth and climate change
Indian Youth and climate changeIndian Youth and climate change
Indian Youth and climate changeglobalcitizens
 
Showcasing stalk ninja
Showcasing stalk ninjaShowcasing stalk ninja
Showcasing stalk ninjaAshish Sharma
 
Retargeting 101 - Presentation at 500 startups
Retargeting 101 - Presentation at 500 startupsRetargeting 101 - Presentation at 500 startups
Retargeting 101 - Presentation at 500 startupslexity
 
US India food processing opportunities
US India food processing opportunitiesUS India food processing opportunities
US India food processing opportunitiesprivg
 
Nigeria media consumption research main 23 apr-12
Nigeria media consumption research main 23 apr-12Nigeria media consumption research main 23 apr-12
Nigeria media consumption research main 23 apr-12rosannaman
 
Business in networks by Antony Mayfield at Internet World Kongress Munich
Business in networks  by Antony Mayfield at Internet World Kongress MunichBusiness in networks  by Antony Mayfield at Internet World Kongress Munich
Business in networks by Antony Mayfield at Internet World Kongress MunichAntony Mayfield
 
Il& fs marketing straetgy
Il& fs   marketing straetgyIl& fs   marketing straetgy
Il& fs marketing straetgyManisha Kunwar
 
Msc business and management dissertation ankit yadav - 450148
Msc business and management dissertation   ankit yadav - 450148Msc business and management dissertation   ankit yadav - 450148
Msc business and management dissertation ankit yadav - 450148ankityadavuk
 
Challenges for a good comp and ben in current indian scenario
Challenges for a good comp and ben in current indian scenario Challenges for a good comp and ben in current indian scenario
Challenges for a good comp and ben in current indian scenario Manisha Kunwar
 
Manufacturing sector of india
Manufacturing sector of indiaManufacturing sector of india
Manufacturing sector of indiaManisha Kunwar
 
Pestle Analysis – South Korea and Samsung PPT
Pestle Analysis – South Korea and Samsung PPTPestle Analysis – South Korea and Samsung PPT
Pestle Analysis – South Korea and Samsung PPTManisha Kunwar
 

Andere mochten auch (20)

Indian Youth and climate change
Indian Youth and climate changeIndian Youth and climate change
Indian Youth and climate change
 
Showcasing stalk ninja
Showcasing stalk ninjaShowcasing stalk ninja
Showcasing stalk ninja
 
Retargeting 101 - Presentation at 500 startups
Retargeting 101 - Presentation at 500 startupsRetargeting 101 - Presentation at 500 startups
Retargeting 101 - Presentation at 500 startups
 
US India food processing opportunities
US India food processing opportunitiesUS India food processing opportunities
US India food processing opportunities
 
Kelompok sosial
Kelompok sosialKelompok sosial
Kelompok sosial
 
Nigeria media consumption research main 23 apr-12
Nigeria media consumption research main 23 apr-12Nigeria media consumption research main 23 apr-12
Nigeria media consumption research main 23 apr-12
 
Cách seo từ khóa hiệu quả
Cách seo từ khóa hiệu quảCách seo từ khóa hiệu quả
Cách seo từ khóa hiệu quả
 
Business in networks by Antony Mayfield at Internet World Kongress Munich
Business in networks  by Antony Mayfield at Internet World Kongress MunichBusiness in networks  by Antony Mayfield at Internet World Kongress Munich
Business in networks by Antony Mayfield at Internet World Kongress Munich
 
Prosedur penyelesaian sengketa
Prosedur penyelesaian sengketaProsedur penyelesaian sengketa
Prosedur penyelesaian sengketa
 
Il& fs marketing straetgy
Il& fs   marketing straetgyIl& fs   marketing straetgy
Il& fs marketing straetgy
 
Msc business and management dissertation ankit yadav - 450148
Msc business and management dissertation   ankit yadav - 450148Msc business and management dissertation   ankit yadav - 450148
Msc business and management dissertation ankit yadav - 450148
 
T&d presentation
T&d presentationT&d presentation
T&d presentation
 
Kelompok sosial
Kelompok sosialKelompok sosial
Kelompok sosial
 
Challenges for a good comp and ben in current indian scenario
Challenges for a good comp and ben in current indian scenario Challenges for a good comp and ben in current indian scenario
Challenges for a good comp and ben in current indian scenario
 
Leadership
LeadershipLeadership
Leadership
 
Hr planning and audit
Hr planning and auditHr planning and audit
Hr planning and audit
 
Ccd vs starbucks
Ccd vs starbucksCcd vs starbucks
Ccd vs starbucks
 
Samsonite ppt
Samsonite pptSamsonite ppt
Samsonite ppt
 
Manufacturing sector of india
Manufacturing sector of indiaManufacturing sector of india
Manufacturing sector of india
 
Pestle Analysis – South Korea and Samsung PPT
Pestle Analysis – South Korea and Samsung PPTPestle Analysis – South Korea and Samsung PPT
Pestle Analysis – South Korea and Samsung PPT
 

Ähnlich wie PDFDemo

Metaprogramming with JavaScript
Metaprogramming with JavaScriptMetaprogramming with JavaScript
Metaprogramming with JavaScriptTimur Shemsedinov
 
Mail OnLine Android Application at DroidCon - Turin - Italy
Mail OnLine Android Application at DroidCon - Turin - ItalyMail OnLine Android Application at DroidCon - Turin - Italy
Mail OnLine Android Application at DroidCon - Turin - ItalyYahoo
 
MongoDB dla administratora
MongoDB dla administratora MongoDB dla administratora
MongoDB dla administratora 3camp
 
Creating an Uber Clone - Part XII.pdf
Creating an Uber Clone - Part XII.pdfCreating an Uber Clone - Part XII.pdf
Creating an Uber Clone - Part XII.pdfShaiAlmog1
 
Simple.Data intro slides
Simple.Data intro slidesSimple.Data intro slides
Simple.Data intro slidesMark Rendle
 
Geneva JUG - Cassandra for Java Developers
Geneva JUG - Cassandra for Java DevelopersGeneva JUG - Cassandra for Java Developers
Geneva JUG - Cassandra for Java DevelopersMichaël Figuière
 
The State of JavaScript (2015)
The State of JavaScript (2015)The State of JavaScript (2015)
The State of JavaScript (2015)Domenic Denicola
 
New Features of JSR 317 (JPA 2.0)
New Features of JSR 317 (JPA 2.0)New Features of JSR 317 (JPA 2.0)
New Features of JSR 317 (JPA 2.0)Markus Eisele
 
TDD in the wild
TDD in the wildTDD in the wild
TDD in the wildBrainhub
 
Writing SOLID C++ [gbgcpp meetup @ Zenseact]
Writing SOLID C++ [gbgcpp meetup @ Zenseact]Writing SOLID C++ [gbgcpp meetup @ Zenseact]
Writing SOLID C++ [gbgcpp meetup @ Zenseact]Dimitrios Platis
 
nw-lab_dns-server.pdf
nw-lab_dns-server.pdfnw-lab_dns-server.pdf
nw-lab_dns-server.pdfJayaprasanna4
 
Developing Applications with MySQL and Java for beginners
Developing Applications with MySQL and Java for beginnersDeveloping Applications with MySQL and Java for beginners
Developing Applications with MySQL and Java for beginnersSaeid Zebardast
 
10 ways to make your code rock
10 ways to make your code rock10 ways to make your code rock
10 ways to make your code rockmartincronje
 
Android Architecture - Khoa Tran
Android Architecture -  Khoa TranAndroid Architecture -  Khoa Tran
Android Architecture - Khoa TranTu Le Dinh
 

Ähnlich wie PDFDemo (20)

greenDAO
greenDAOgreenDAO
greenDAO
 
Metaprogramming with JavaScript
Metaprogramming with JavaScriptMetaprogramming with JavaScript
Metaprogramming with JavaScript
 
Mail OnLine Android Application at DroidCon - Turin - Italy
Mail OnLine Android Application at DroidCon - Turin - ItalyMail OnLine Android Application at DroidCon - Turin - Italy
Mail OnLine Android Application at DroidCon - Turin - Italy
 
Ac2
Ac2Ac2
Ac2
 
MongoDB dla administratora
MongoDB dla administratora MongoDB dla administratora
MongoDB dla administratora
 
Anti patterns
Anti patternsAnti patterns
Anti patterns
 
Creating an Uber Clone - Part XII.pdf
Creating an Uber Clone - Part XII.pdfCreating an Uber Clone - Part XII.pdf
Creating an Uber Clone - Part XII.pdf
 
Simple.Data intro slides
Simple.Data intro slidesSimple.Data intro slides
Simple.Data intro slides
 
Mongo db dla administratora
Mongo db dla administratoraMongo db dla administratora
Mongo db dla administratora
 
Geneva JUG - Cassandra for Java Developers
Geneva JUG - Cassandra for Java DevelopersGeneva JUG - Cassandra for Java Developers
Geneva JUG - Cassandra for Java Developers
 
The State of JavaScript (2015)
The State of JavaScript (2015)The State of JavaScript (2015)
The State of JavaScript (2015)
 
New Features of JSR 317 (JPA 2.0)
New Features of JSR 317 (JPA 2.0)New Features of JSR 317 (JPA 2.0)
New Features of JSR 317 (JPA 2.0)
 
TDD in the wild
TDD in the wildTDD in the wild
TDD in the wild
 
Writing SOLID C++ [gbgcpp meetup @ Zenseact]
Writing SOLID C++ [gbgcpp meetup @ Zenseact]Writing SOLID C++ [gbgcpp meetup @ Zenseact]
Writing SOLID C++ [gbgcpp meetup @ Zenseact]
 
Xm lparsers
Xm lparsersXm lparsers
Xm lparsers
 
nw-lab_dns-server.pdf
nw-lab_dns-server.pdfnw-lab_dns-server.pdf
nw-lab_dns-server.pdf
 
Developing Applications with MySQL and Java for beginners
Developing Applications with MySQL and Java for beginnersDeveloping Applications with MySQL and Java for beginners
Developing Applications with MySQL and Java for beginners
 
10 ways to make your code rock
10 ways to make your code rock10 ways to make your code rock
10 ways to make your code rock
 
Database security
Database securityDatabase security
Database security
 
Android Architecture - Khoa Tran
Android Architecture -  Khoa TranAndroid Architecture -  Khoa Tran
Android Architecture - Khoa Tran
 

PDFDemo

  • 1. Di WebTech Mail - (no subject) https://mail.google.com/mail/u/0/?ui=2&ik=f2506c64f4&view=pt&searc... Ankur Kumar <akumar@diwebtech.com> (no subject) 1 message Pankaj Sharma <pksharma@diwebtech.com> Tue, Jul 24, 2012 at 11:29 AM To: Ankur Kumar <akumar@diwebtech.com> using System; using System.Linq; using System.Web; using System.Web.Services; using System.Web.Services.Protocols; using System.Xml.Linq; using MySql.Data.MySqlClient; using System.Data; using System.Net; using System.IO; [WebService(Namespace = "http://rwa47.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. // [System.Web.Script.Services.ScriptService] public class Service : System.Web.Services.WebService { MySqlConnection connection = new MySqlConnection("server=localhost; user=root; password=123; database=easymoney"); public Service() { } public struct RawDataEnq { public String transdate; public String usrtransid; public String usrcity; public String usrbank; public String usrname; public String usraccountno; public String usramount; } public struct RawDataLogin { public String id; public bool result; } public struct RawData { public String username; public String amount; public String type; public String comment; public String date; 1 of 5 9/1/2012 8:24 PM
  • 2. Di WebTech Mail - (no subject) https://mail.google.com/mail/u/0/?ui=2&ik=f2506c64f4&view=pt&searc... public String prevbal; public String id; public String time; } [WebMethod] public DataSet connectoToMySql() { MySqlDataAdapter mysqlAdap = new MySqlDataAdapter("SELECT * FROM pankajku201235", connection); DataSet ds = new DataSet(); mysqlAdap.Fill(ds, "users"); return ds; } [WebMethod] public RawDataLogin [] LoginCheck(string user_id, string user_pass) { MySqlCommand mycommand = connection.CreateCommand(); connection.Open(); //mycommand.CommandText = "SELECT COUNT(*) FROM members where (username='" + user_id + "' and password='" + user_pass + "')"; //object scalar = mycommand.ExecuteScalar(); //int rows = int.Parse(scalar.ToString()); //mycommand.Dispose(); int i = 0; mycommand.CommandText = "Select id,username,password from members where (username='" + user_id + "' and password='" + user_pass + "')"; RawDataLogin[] Data = new RawDataLogin[1]; ) MySqlDataAdapter myDA = new MySqlDataAdapter(mycommand); MySqlDataReader reader = mycommand.ExecuteReader(); while (reader.Read()) { if (user_id.Equals(reader.GetString(1).ToString()) && user_pass.Equals(reader.GetString(2).ToString())) { Data[i].id = reader.GetString(0).ToString(); Data[i].result = true; } else { Data[i].result = false ; } } reader.Close(); return Data ; } [WebMethod] public RawData [] MyAccount(string user_id) { MySqlCommand mycommand = connection.CreateCommand(); connection.Open(); mycommand.CommandText = "SELECT COUNT(*) FROM recharge where username='"+user_id +"'"; object scalar = mycommand.ExecuteScalar(); int rows = int.Parse(scalar.ToString()); mycommand.Dispose(); int i = 0; 2 of 5 9/1/2012 8:24 PM
  • 3. Di WebTech Mail - (no subject) https://mail.google.com/mail/u/0/?ui=2&ik=f2506c64f4&view=pt&searc... mycommand.CommandText = "Select * from recharge where username='" + user_id + "'"; RawData[] Data = new RawData[rows]; MySqlDataAdapter myDA = new MySqlDataAdapter(mycommand); MySqlDataReader reader = mycommand.ExecuteReader(); while (reader.Read()) { if (i < rows) { Data[i].username = reader.GetString(0).ToString(); Data[i].amount = reader.GetString(1).ToString(); Data[i].type = reader.GetString(2).ToString(); Data[i].comment = reader.GetString(3).ToString(); Data[i].date = reader.GetString(4).ToString(); Data[i].prevbal = reader.GetString(5).ToString(); Data[i].id = reader.GetString(6).ToString(); Data[i].time = reader.GetString(6).ToString(); } i++; } reader.Close(); return Data; } [WebMethod] public RawDataEnq[] Enquiry(string user_id, DateTime start_date, DateTime end_date) { MySqlCommand mycommand = connection.CreateCommand(); connection.Open(); mycommand.CommandText = "SELECT COUNT(*) FROM " + user_id + " where transdate between '" + start_date.Date.ToString("yyyy-MM-dd") + "' and '" + end_date.Date.ToString("yyyy-MM-dd") + "'"; object scalar = mycommand.ExecuteScalar(); 6 int rows = int.Parse(scalar.ToString()); mycommand.Dispose(); int i = 0; mycommand.CommandText = "Select transdate,usrtransid,usrcity,usrbank,usrname,usraccountno,usramount from " + user_id + " where transdate between '" + start_date.Date.ToString("yyyy-MM-dd") + "' and '" + end_date.Date.ToString("yyyy-MM-dd") + "'"; RawDataEnq[] Data = new RawDataEnq[rows]; MySqlDataAdapter myDA = new MySqlDataAdapter(mycommand); MySqlDataReader reader = mycommand.ExecuteReader(); while (reader.Read()) { if (i < rows) { Data[i].transdate = reader.GetString(0).ToString(); Data[i].usraccountno = reader.GetString(1).ToString(); Data[i].usramount = reader.GetString(2).ToString(); Data[i].usrbank = reader.GetString(3).ToString(); Data[i].usrcity = reader.GetString(4).ToString(); Data[i].usrname = reader.GetString(5).ToString(); Data[i].usrtransid = reader.GetString(6).ToString(); } i++; } reader.Close(); return Data; 3 of 5 9/1/2012 8:24 PM
  • 4. Di WebTech Mail - (no subject) https://mail.google.com/mail/u/0/?ui=2&ik=f2506c64f4&view=pt&searc... } [WebMethod] public bool ChangePassword(string user_id, string current_pass, string new_pass) { MySqlCommand mycommand = connection.CreateCommand(); connection.Open(); mycommand.CommandText = "update members set password='" + new_pass + "' where username='" + user_id + "' and password='" + current_pass + "'"; mycommand.ExecuteNonQuery(); mycommand.Dispose(); bool result = false; mycommand.CommandText = "Select username,password from members where (username='" + user_id + "')"; MySqlDataAdapter myDA = new MySqlDataAdapter(mycommand); MySqlDataReader reader = mycommand.ExecuteReader(); while (reader.Read()) { if (new_pass.Equals(reader.GetString(1).ToString())) result = true; } reader.Close(); return result; } [WebMethod] public string MoneyTransfer(string user_id, string user_bank, string user_city, string user_name, string user_accountno, int user_amount) { MySqlCommand mycommand = connection.CreateCommand(); connection.Open(); e mycommand.CommandText = "Select afterbal from " + user_id + " "; MySqlDataAdapter myDA = new MySqlDataAdapter(mycommand); MySqlDataReader reader = mycommand.ExecuteReader(); int rows = 0; while (reader.Read()) { rows = int.Parse(reader.GetString(0).ToString()); } int user_prevbal = rows; int user_afterbal = rows - (user_amount + 50); DateTime user_transdate = DateTime.Today; DateTime user_transtime = DateTime.Now; reader.Close(); mycommand.Dispose(); mycommand.CommandText = "insert into " + user_id + " (usrtransid,usrvoucherno,usrbank,usrstate,usrdistrict, usrcity,usrname,usraccountno,usramount,transdate,transtime,usrifsccode ,prevbal,afterbal) values(500,100,'" + user_bank + "','up','lko','" + user_city + "','" + user_name + "','" + user_accountno + "'," + user_amount + ",'" + user_transdate.Date.ToString("yyyy-MM-dd") + "','" + user_transtime.ToString("HH:mm:ss") + "','fdfd'," + user_prevbal + "," + user_afterbal + ")"; mycommand.ExecuteNonQuery(); mycommand.Dispose(); string s = ""; mycommand.CommandText = "Select usrname from " + user_id + " "; MySqlDataAdapter myDA1 = new MySqlDataAdapter(mycommand); MySqlDataReader reader1 = mycommand.ExecuteReader(); while (reader.Read()) { 4 of 5 9/1/2012 8:24 PM
  • 5. Di WebTech Mail - (no subject) https://mail.google.com/mail/u/0/?ui=2&ik=f2506c64f4&view=pt&searc... s = reader1.GetString(0).ToString(); } reader1.Close(); return s; } [WebMethod] public string CurrentBalance(string user_id) { string rows = ""; MySqlCommand mycommand = connection.CreateCommand(); connection.Open(); mycommand.CommandText = "Select afterbal from " + user_id + " "; MySqlDataAdapter myDA = new MySqlDataAdapter(mycommand); MySqlDataReader reader = mycommand.ExecuteReader(); while (reader.Read()) { rows =reader.GetString(0).ToString(); } reader.Close(); return rows; } } e 5 of 5 9/1/2012 8:24 PM