Exemplo n.º 1
0
        public int sendSMS()
        {
            try
            {
                var accountSid = "AC194a875ea62f4ccaba8400b3df223acd";
                // Your Auth Token from twilio.com/console
                var authToken = "4234556c7698862e49c7ac8867c3443f";

                TwilioClient.Init(accountSid, authToken);

                var message = MessageResource.Create(
                    to: new PhoneNumber("+19522974157"),
                    from: new PhoneNumber("+19522220256"),
                    body: "Hello from Common DLL");

                Console.WriteLine(message.Sid);
                Console.Write("Press any key to continue.");
                Console.ReadKey();
            }
            catch (Exception objEx)
            {
                Helpers.LogExceptionInFlatFile(objEx);
            }
            return(0);
        }
Exemplo n.º 2
0
        //http://csharp.net-informations.com/dataadapter/updatecommand-sqlserver.htm

        public static void getDataSet()
        {
            try
            {
            }
            catch (Exception objEx)
            {
                Helpers.LogExceptionInFlatFile(objEx);
            }
        }
Exemplo n.º 3
0
        private static void updateData(string strLoginID, string strHashedPwdText)
        {
            string         connetionString = null;
            SqlConnection  connection;
            SqlDataAdapter adapter = new SqlDataAdapter();
            string         sql     = null;

            connetionString = "data source=103.235.104.24;initial catalog=VishwakarmaMugurtham;user id=VishMugAdmin;password=Swingsys@!1";
            connection      = new SqlConnection(connetionString);
            sql             = "update portaluser set password = '******' where loginid = '" + strLoginID + "'";
            try
            {
                connection.Open();
                adapter.UpdateCommand             = connection.CreateCommand();
                adapter.UpdateCommand.CommandText = sql;
                adapter.UpdateCommand.ExecuteNonQuery();
                //MessageBox.Show("Row updated !! ");
            }
            catch (Exception objEx)
            {
                Helpers.LogExceptionInFlatFile(objEx);
            }
        }
Exemplo n.º 4
0
 private int getConnectionString()
 {
     try
     {
         if (_CommunityID == "1")
         {
             _CommunityName          = "Aadhidhravidar";
             _AppKeyConnectionstring = "AdidravidarMugurtham";
             _Connectionstring       = System.Configuration.ConfigurationManager.ConnectionStrings[_AppKeyConnectionstring].ConnectionString;
         }
         else if (_CommunityID == "2")
         {
             _CommunityName          = "Agamudayar";
             _AppKeyConnectionstring = "AgamudayarMugurtham";
             _Connectionstring       = System.Configuration.ConfigurationManager.ConnectionStrings[_AppKeyConnectionstring].ConnectionString;
         }
         else if (_CommunityID == "3")
         {
             _CommunityName          = "Brahmin";
             _AppKeyConnectionstring = "BrahminMugurtham";
             _Connectionstring       = System.Configuration.ConfigurationManager.ConnectionStrings[_AppKeyConnectionstring].ConnectionString;
         }
         else if (_CommunityID == "4")
         {
             _CommunityName          = "Christian";
             _AppKeyConnectionstring = "ChristianMugurtham";
             _Connectionstring       = System.Configuration.ConfigurationManager.ConnectionStrings[_AppKeyConnectionstring].ConnectionString;
         }
         else if (_CommunityID == "5")
         {
             _CommunityName          = "Gounder";
             _AppKeyConnectionstring = "GounderMugurtham";
             _Connectionstring       = System.Configuration.ConfigurationManager.ConnectionStrings[_AppKeyConnectionstring].ConnectionString;
         }
         else if (_CommunityID == "6")
         {
             _CommunityName          = "Maruthuvar";
             _AppKeyConnectionstring = "MaruthuvarMugurtham";
             _Connectionstring       = System.Configuration.ConfigurationManager.ConnectionStrings[_AppKeyConnectionstring].ConnectionString;
         }
         else if (_CommunityID == "7")
         {
             _CommunityName          = "Mudaliyar";
             _AppKeyConnectionstring = "MudaliyarMugurtham";
             _Connectionstring       = System.Configuration.ConfigurationManager.ConnectionStrings[_AppKeyConnectionstring].ConnectionString;
         }
         else if (_CommunityID == "8")
         {
             _CommunityName          = "Mukkulathor";
             _AppKeyConnectionstring = "MukkulathorMugurtham";
             _Connectionstring       = System.Configuration.ConfigurationManager.ConnectionStrings[_AppKeyConnectionstring].ConnectionString;
         }
         else if (_CommunityID == "9")
         {
             _CommunityName          = "Nadar";
             _AppKeyConnectionstring = "NadarMugurtham";
             _Connectionstring       = System.Configuration.ConfigurationManager.ConnectionStrings[_AppKeyConnectionstring].ConnectionString;
         }
         else if (_CommunityID == "10")
         {
             _CommunityName          = "Naidu";
             _AppKeyConnectionstring = "NaiduMugurtham";
             _Connectionstring       = System.Configuration.ConfigurationManager.ConnectionStrings[_AppKeyConnectionstring].ConnectionString;
         }
         else if (_CommunityID == "11")
         {
             _CommunityName          = "Others";
             _AppKeyConnectionstring = "OthersMugurtham";
             _Connectionstring       = System.Configuration.ConfigurationManager.ConnectionStrings[_AppKeyConnectionstring].ConnectionString;
         }
         else if (_CommunityID == "12")
         {
             _CommunityName          = "Padayachi";
             _AppKeyConnectionstring = "PadayachiMugurtham";
             _Connectionstring       = System.Configuration.ConfigurationManager.ConnectionStrings[_AppKeyConnectionstring].ConnectionString;
         }
         else if (_CommunityID == "13")
         {
             _CommunityName          = "Parvatharajakulam";
             _AppKeyConnectionstring = "ParvatharajakulamMugurtham";
             _Connectionstring       = System.Configuration.ConfigurationManager.ConnectionStrings[_AppKeyConnectionstring].ConnectionString;
         }
         else if (_CommunityID == "14")
         {
             _CommunityName          = "Pillai";
             _AppKeyConnectionstring = "PillaiMugurtham";
             _Connectionstring       = System.Configuration.ConfigurationManager.ConnectionStrings[_AppKeyConnectionstring].ConnectionString;
         }
         else if (_CommunityID == "15")
         {
             _CommunityName          = "Reddiar";
             _AppKeyConnectionstring = "ReddiarMugurtham";
             _Connectionstring       = System.Configuration.ConfigurationManager.ConnectionStrings[_AppKeyConnectionstring].ConnectionString;
         }
         else if (_CommunityID == "16")
         {
             _CommunityName          = "ReMarriage";
             _AppKeyConnectionstring = "ReMarriageMugurtham";
             _Connectionstring       = System.Configuration.ConfigurationManager.ConnectionStrings[_AppKeyConnectionstring].ConnectionString;
         }
         else if (_CommunityID == "17")
         {
             _CommunityName          = "Thevar";
             _AppKeyConnectionstring = "ThevarMugurtham";
             _Connectionstring       = System.Configuration.ConfigurationManager.ConnectionStrings[_AppKeyConnectionstring].ConnectionString;
         }
         else if (_CommunityID == "18")
         {
             _CommunityName          = "Udayar";
             _AppKeyConnectionstring = "UdayarMugurtham";
             _Connectionstring       = System.Configuration.ConfigurationManager.ConnectionStrings[_AppKeyConnectionstring].ConnectionString;
         }
         else if (_CommunityID == "19")
         {
             _CommunityName          = "vanniyar";
             _AppKeyConnectionstring = "VanniyarMugurtham";
             _Connectionstring       = System.Configuration.ConfigurationManager.ConnectionStrings[_AppKeyConnectionstring].ConnectionString;
         }
         else if (_CommunityID == "20")
         {
             _CommunityName          = "Vellalar";
             _AppKeyConnectionstring = "VellalarMugurtham";
             _Connectionstring       = System.Configuration.ConfigurationManager.ConnectionStrings[_AppKeyConnectionstring].ConnectionString;
         }
         else if (_CommunityID == "21")
         {
             _CommunityName          = "Vishwakarma";
             _AppKeyConnectionstring = "VishwakarmaMugurtham";
             _Connectionstring       = System.Configuration.ConfigurationManager.ConnectionStrings[_AppKeyConnectionstring].ConnectionString;
         }
         else if (_CommunityID == "22")
         {
             _CommunityName          = "Yadava";
             _AppKeyConnectionstring = "YadavaMugurtham";
             _Connectionstring       = System.Configuration.ConfigurationManager.ConnectionStrings[_AppKeyConnectionstring].ConnectionString;
         }
         else if (_CommunityID == "23")
         {
             _CommunityName          = "CasteNoBar";
             _AppKeyConnectionstring = "CasteNoBarMugurtham";
             _Connectionstring       = System.Configuration.ConfigurationManager.ConnectionStrings[_AppKeyConnectionstring].ConnectionString;
         }
     }
     catch (Exception objEx)
     {
         Helpers.LogExceptionInFlatFile(objEx);
     }
     return(0);
 }
Exemplo n.º 5
0
        public static void getDataSet1()
        {
            string         connetionString = null;
            SqlConnection  connection;
            SqlCommand     command;
            SqlDataAdapter adapter   = new SqlDataAdapter();
            DataSet        ds        = new DataSet();
            int            i         = 0;
            string         firstSql  = null;
            string         secondSql = null;

            connetionString = "data source=103.235.104.24;initial catalog=VishwakarmaMugurtham;user id=VishMugAdmin;password=Swingsys@!1";
            firstSql        = "Select * from portaluser";
            secondSql       = "Select * from profilebasicinfo";
            connection      = new SqlConnection(connetionString);


            //SqlDataAdapter objUpdateadapter = new SqlDataAdapter();
            string strSQL = string.Empty;

            try
            {
                connection.Open();

                command = new SqlCommand(firstSql, connection);
                adapter.SelectCommand = command;
                adapter.Fill(ds, "First Table");

                adapter.SelectCommand.CommandText = secondSql;
                adapter.Fill(ds, "Second Table");

                adapter.Dispose();
                command.Dispose();
                connection.Close();

                //retrieve first table data
                for (i = 0; i <= ds.Tables[0].Rows.Count - 1; i++)
                {
                    //MessageBox.Show(ds.Tables[0].Rows[i].ItemArray[0] + " -- " + ds.Tables[0].Rows[i].ItemArray[1]);
                    //Helpers.LogMessage(ds.Tables[0].Rows[i].ItemArray[3] + " -- " + Helpers.EncodePasswordToBase64(ds.Tables[0].Rows[i].ItemArray[3].ToString()));


                    //updateData(ds.Tables[0].Rows[i].ItemArray[2].ToString(), Helpers.EncodePasswordToBase64(ds.Tables[0].Rows[i].ItemArray[3].ToString()));

                    strSQL = "update portaluser set password = '******' where loginid = '" + ds.Tables[0].Rows[i].ItemArray[2].ToString() + "'";

                    Helpers.LogMessageInFlatFile1(strSQL);

                    //objUpdateadapter.UpdateCommand = connection.CreateCommand();
                    //objUpdateadapter.UpdateCommand.CommandText = strSQL;
                    //objUpdateadapter.UpdateCommand.ExecuteNonQuery();
                }
                //objUpdateadapter.Dispose();
                //retrieve second table data
                for (i = 0; i <= ds.Tables[1].Rows.Count - 1; i++)
                {
                    //MessageBox.Show(ds.Tables[1].Rows[i].ItemArray[0] + " -- " + ds.Tables[1].Rows[i].ItemArray[1]);
                }
            }
            catch (Exception objEx)
            {
                Helpers.LogExceptionInFlatFile(objEx);
            }
        }