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

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Último (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 

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