SlideShare uma empresa Scribd logo
1 de 5
Baixar para ler offline
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

Mais conteúdo relacionado

Mais procurados

Indexing and Query Optimization
Indexing and Query OptimizationIndexing and Query Optimization
Indexing and Query Optimization
MongoDB
 
Indexing & Query Optimization
Indexing & Query OptimizationIndexing & Query Optimization
Indexing & Query Optimization
MongoDB
 
MongoDB and PHP ZendCon 2011
MongoDB and PHP ZendCon 2011MongoDB and PHP ZendCon 2011
MongoDB and PHP ZendCon 2011
Steven Francia
 

Mais procurados (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
 

Semelhante a Di web tech mail (no subject)

Geneva JUG - Cassandra for Java Developers
Geneva JUG - Cassandra for Java DevelopersGeneva JUG - Cassandra for Java Developers
Geneva JUG - Cassandra for Java Developers
Michaël Figuière
 
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
martincronje
 

Semelhante a Di web tech mail (no subject) (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
 

Último

Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
panagenda
 
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
UK Journal
 

Último (20)

Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 
Overview of Hyperledger Foundation
Overview of Hyperledger FoundationOverview of Hyperledger Foundation
Overview of Hyperledger Foundation
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 Warsaw
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty Secure
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & Ireland
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties ReimaginedEasier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentation
 

Di web tech mail (no subject)

  • 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