Пример #1
0
        public void Generator(int priority, string bdate = null)
        {
            string ret;

            try
            {
                if (bdate == null)
                {
                    string sql1 = "select dateformat(max(bank_date),'yyyy-MM-dd') BussinessDay from cc.day_details where closed_by is null";
                    //bussinessDate = root_obj_in.db_select_operation("select dateformat(max(bank_date),'yyyy-MM-dd') BussinessDay from cc.day_details where closed_by is null", "BussinessDay");
                    bussinessDate = Connections(sql1, "BussinessDay");
                    if (bussinessDate != null || bussinessDate != "")
                    {
                        string sql2 = "select sf_update_sms('" + bussinessDate.Substring(0, 10) + "','" + priority + "') sf_update_sms";
                        ret = Connections(sql2, "sf_update_sms");
                        //ret = root_obj_in.db_select_operation(sql, "sf_update_sms");
                    }
                    else
                    {
                        Console.WriteLine("null");
                    }
                }
                else
                {
                    bdate = bdate.Substring(6, 4) + "-" + bdate.Substring(3, 2) + "-" + bdate.Substring(0, 2);
                    string sql2 = "select sf_update_sms('" + bdate + "','" + priority + "') sf_update_sms";
                    ret = Connections(sql2, "sf_update_sms");
                }
            }
            catch (Exception ex)
            {
                Track_obj.Text_Tracker(Convert.ToString(ex));
            }
        }
Пример #2
0
        public void db_Connection_open()
        {
            dsn = MTier.RegLoader.Dsn;
            string first  = "#websms*321*#";
            string middle = "busopasnosty#";
            string last   = "rotartsinimda123*#";

            _con_string = "DSN=" + dsn + ";uid=CCBankingSMS;pwd=" + first + middle + last;
            try
            {
                lock (ReaderLock)
                {
                    _conn = new OdbcConnection(_con_string);
                    if (_conn.State == ConnectionState.Closed || _conn.State == ConnectionState.Broken)
                    {
                        _conn.Open();
                    }
                    else if (_conn.State == ConnectionState.Connecting || _conn.State == ConnectionState.Fetching)
                    {
                        Thread.Sleep(9000);
                        _conn.Open();
                    }
                }
            }
            catch (Exception ex)
            {
                Track_obj.Text_Tracker(Convert.ToString(ex));
            }
        }
Пример #3
0
 public void get_provider_det(int provider_id)
 {
     try
     {
         DataTable DT_Obj = new DataTable();
         string    sql9   = "select Provider_name,provider_key,provider_uid,provider_password from cc.sms_provider where provider_id=" + provider_id;
         DT_Obj            = (DataTable)root_obj_out.db_select_operation_table(sql9);
         Provider_name     = Convert.ToString(DT_Obj.Rows[0]["Provider_name"]);
         provider_key      = Convert.ToString(DT_Obj.Rows[0]["Provider_key"]);
         provider_uid      = Convert.ToString(DT_Obj.Rows[0]["Provider_uid"]);
         provider_password = Convert.ToString(DT_Obj.Rows[0]["Provider_password"]);
     }
     catch (Exception ex)
     {
         trcker_obj.Text_Tracker(Convert.ToString(ex));
     }
 }
Пример #4
0
 public void db_InsertUpdateDelete_Operations(string _sql_string)
 {
     try
     {
         lock (_object)
         {
             //db_Connection_open();
             _conn = con_obj.db_Connection_open();
             OdbcCommand _command_obj = new OdbcCommand(_sql_string, _conn);
             _command_obj.ExecuteNonQuery();
         }
     }
     catch (Exception ex)
     {
         Track_obj.Text_Tracker(Convert.ToString(ex));
     }
     // db_Connection_close();
     _conn.Close();
 }
Пример #5
0
 public void db_InsertUpdateDelete_Operations(string _sql_string)
 {
     try
     {
         //db_Connection_open();
         _conn = connection._conn;
         if (_conn.State == ConnectionState.Connecting || _conn.State == ConnectionState.Executing || _conn.State == ConnectionState.Fetching)
         {
             Thread.Sleep(8000);
         }
         else
         {
             OdbcCommand _command_obj = new OdbcCommand(_sql_string, _conn);
             _command_obj.ExecuteNonQuery();
         }
     }
     catch (Exception ex)
     {
         Track_obj.Text_Tracker(Convert.ToString(ex));
     }
     // db_Connection_close();
     // _conn.Close();
 }
Пример #6
0
        public void provider_selector(string MobNo, string Messages, int sms_inout_id)
        {
            try
            {
                switch (provider_name)
                {
                case "gup shup":
                    message_return_id = sendwebmessage_gupshup(MobNo, Messages, provider_user_name, provider_password);
                    break;

                case "green ads sap":
                    message_return_id = sendwebmessage_greenads_sap(MobNo, Messages, provider_user_name, provider_password, provider_SenderName);
                    break;

                case "green ads":
                    message_return_id = sendwebmessage_greenads(MobNo, Messages, provider_user_name, provider_password, provider_SenderName);
                    break;

                case "tech soul":
                    message_return_id = sendwebmessage_techsoul(MobNo, Messages, provider_workingkey, provider_SenderName);
                    break;

                case "prudent tech":
                    message_return_id = sendwebmessage_prudent_tech(MobNo, Messages, provider_user_name, provider_password, provider_SenderName);
                    break;

                case "monotone":
                    message_return_id = sendwebmessage_monotone(MobNo, Messages, provider_user_name, provider_password);
                    break;

                case "bhashsms":
                    message_return_id = sendwebmessage_bhashsms(MobNo, Messages, provider_user_name, provider_password, provider_SenderName);
                    break;

                case "prpsms":
                    message_return_id = sendwebmessage_prpsms(MobNo, Messages, provider_user_name, provider_password, provider_SenderName);
                    break;

                default:
                    Track_obj.Text_Tracker("Invalid Provider Name-Message sender class");
                    break;
                }
                if (Convert.ToString(message_return_id) != null && Convert.ToString(message_return_id) != "")
                {
                    DBClass.Root_Sen root_obj_in = new DBClass.Root_Sen();
                    string           sql8        = "select sf_update_sms_delivery_status('D','" + message_return_id + "','N','" + sms_inout_id + "') result";
                    // string sql8 = "update cc.sms_inout set delivery_status='D',message_id='" + message_return_id + "',status='N' where sms_inout_id='" + sms_inout_id + "'";
                    root_obj_in.db_select_operation(sql8, "result");
                }
                else
                {
                    DBClass.Root_Sen root_obj_in = new DBClass.Root_Sen();
                    string           sql8        = "select sf_update_sms_delivery_status('F','" + message_return_id + "','N','" + sms_inout_id + "') result";
                    // string sql1 = "update cc.sms_inout set delivery_status='F',message_id='" + message_return_id + "',status='N' where sms_inout_id='" + sms_inout_id + "'";
                    root_obj_in.db_select_operation(sql8, "result");
                }
            }
            catch (Exception ex)
            {
                Track_obj.Text_Tracker(Convert.ToString(ex));
            }
        }