// ////////////////////////////////////////////////////////////////////////
        // EVENTS
        //
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                // Security check
                if (!Convert.ToBoolean(Session["sgLFS_LABOUR_HOURS_FULL_EDITING"]))
                {
                    if (!Convert.ToBoolean(Session["sgLFS_LABOUR_HOURS_REPORTS"]))
                    {
                        Response.Redirect("./../../error_page.aspx?error=" + "You are not authorized to view this page. Contact your system administrator.");
                    }
                }

                // Initialize viewstate variables
                System.Configuration.AppSettingsReader appSettingReader = new System.Configuration.AppSettingsReader();
                ViewState["LHMode"] = appSettingReader.GetValue("LABOUR_HOURS_OPERATION_MODE", typeof(System.String)).ToString();

                // Prepare initial data for client
                ddlProjectTimeState.SelectedValue = "Approved";
                tkrdpStartDate.SelectedDate = DateTime.Now;
                tkrdpEndDate.SelectedDate = DateTime.Now;

                // Register delegates
                this.RegisterDelegates();
            }
            else
            {
                // Register delegates
                this.RegisterDelegates();
            }
        }
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     System.Configuration.AppSettingsReader configurationAppSettings = new System.Configuration.AppSettingsReader();
     this.cnOrderTrackerDB = new System.Data.SqlClient.SqlConnection();
     this.sqlDataAdapter1 = new System.Data.SqlClient.SqlDataAdapter();
     this.sqlCommand2 = new System.Data.SqlClient.SqlCommand();
     this.custData1 = new OrderTrackerv2.HOOemployees.Secure.CustData();
     ((System.ComponentModel.ISupportInitialize)(this.custData1)).BeginInit();
     //
     // cnOrderTrackerDB
     //
     this.cnOrderTrackerDB.ConnectionString = ((string)(configurationAppSettings.GetValue("cnOrderTrackerDB.ConnectionString", typeof(string))));
     //
     // sqlDataAdapter1
     //
     this.sqlDataAdapter1.SelectCommand = this.sqlCommand2;
     this.sqlDataAdapter1.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
                                                                                               new System.Data.Common.DataTableMapping("Table", "Customers", new System.Data.Common.DataColumnMapping[] {
                                                                                                                                                                                                            new System.Data.Common.DataColumnMapping("SID", "SID"),
                                                                                                                                                                                                            new System.Data.Common.DataColumnMapping("name", "name"),
                                                                                                                                                                                                            new System.Data.Common.DataColumnMapping("email", "email"),
                                                                                                                                                                                                            new System.Data.Common.DataColumnMapping("phone", "phone")})});
     //
     // sqlCommand2
     //
     this.sqlCommand2.CommandText = "SELECT SID, name, phone, email FROM dbo.Customers";
     this.sqlCommand2.Connection = this.cnOrderTrackerDB;
     //
     // custData1
     //
     this.custData1.DataSetName = "CustData";
     this.custData1.Locale = new System.Globalization.CultureInfo("en-US");
     this.Load += new System.EventHandler(this.Page_Load);
     ((System.ComponentModel.ISupportInitialize)(this.custData1)).EndInit();
 }
        public bool CheckOutFile(Cdc.MetaManager.DataAccess.IVersionControlled domainObject, Cdc.MetaManager.DataAccess.Domain.Application application, out string errorMessage)
        {
            System.Configuration.AppSettingsReader appReader = new System.Configuration.AppSettingsReader();

            string rootPath   = appReader.GetValue("RepositoryPath", typeof(System.String)).ToString();
            string parentPath = System.IO.Path.Combine(rootPath, application.Name + (application.IsFrontend.Value ? "_Frontend" : "_Backend"));
            string filePath   = System.IO.Path.Combine(parentPath, NHibernate.Proxy.NHibernateProxyHelper.GetClassWithoutInitializingProxy(domainObject).Name);
            string fileName   = domainObject.RepositoryFileName + ".xml";
            string fullPath   = System.IO.Path.Combine(filePath, fileName);

            bool success = true;

            errorMessage = string.Empty;

            if (IsFileInClearCase(fullPath))
            {
                if (!IsCheckedOutByMe(fullPath))
                {
                    errorMessage = ExecuteClearCaseCommand(ClearCaseCommands.CHECK_OUT, fullPath).Error;
                    success      = string.IsNullOrEmpty(errorMessage);
                }
            }

            return(success);
        }
예제 #4
0
        public static string Encrypt(string toEncrypt, bool useHashing)
        {
            byte[] keyArray;
            byte[] toEncryptArray = UTF8Encoding.UTF8.GetBytes(toEncrypt);

            System.Configuration.AppSettingsReader settingsReader = new System.Configuration.AppSettingsReader();
            // Get the key from config file
            string key = "9078a2e6-ed71-4607-b4d1-b68993880501";
            //System.Windows.Forms.MessageBox.Show(key);
            if (useHashing)
            {
                MD5CryptoServiceProvider hashmd5 = new MD5CryptoServiceProvider();
                keyArray = hashmd5.ComputeHash(UTF8Encoding.UTF8.GetBytes(key));
                hashmd5.Clear();
            }
            else
                keyArray = UTF8Encoding.UTF8.GetBytes(key);

            TripleDESCryptoServiceProvider tdes = new TripleDESCryptoServiceProvider();
            tdes.Key = keyArray;
            tdes.Mode = CipherMode.ECB;
            tdes.Padding = PaddingMode.PKCS7;

            ICryptoTransform cTransform = tdes.CreateEncryptor();
            byte[] resultArray = cTransform.TransformFinalBlock(toEncryptArray, 0, toEncryptArray.Length);
            tdes.Clear();
            return Convert.ToBase64String(resultArray, 0, resultArray.Length);
        }
예제 #5
0
        public RentalService()
        {
            System.Configuration.AppSettingsReader r = new System.Configuration.AppSettingsReader();
            string path = (string)r.GetValue("DataFaceSimulationsettings", typeof(String));
            //class name to load
            string line;

            // Read the file and display it line by line.
            using (System.IO.StreamReader file = new System.IO.StreamReader(path))
            {
                line = file.ReadToEnd();
                file.Close();
            }
            SimulationManager.Simulator s = new SimulationManager.Simulator();

            //s.Check("DataFaceSimulationsettings: " + line);
            if (line=="DataFacade1")
            {
                df = new DataFacade1();
                //s.Check("DataFaceSimulationsettings: instantiated " + line);
            }
            else if (line == "DataFacade2")
            {
                df = new DataFacade2();
                //s.Check("DataFaceSimulationsettings: instantiated " + line);
            }
            else
            {
                throw new Exception("DataFacade not loaded, check the following appsetting in web.config -> 'DataFaceSimulationsettings'");
            }
        }
예제 #6
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     System.Configuration.AppSettingsReader configurationAppSettings = new System.Configuration.AppSettingsReader();
     this.oleDbDataAdapter1   = new System.Data.OleDb.OleDbDataAdapter();
     this.oleDbSelectCommand1 = new System.Data.OleDb.OleDbCommand();
     this.oleDbConnection1    = new System.Data.OleDb.OleDbConnection();
     this.dataSet11           = new aviso_vencimiento.DataSet1();
     ((System.ComponentModel.ISupportInitialize)(this.dataSet11)).BeginInit();
     //
     // oleDbDataAdapter1
     //
     this.oleDbDataAdapter1.SelectCommand = this.oleDbSelectCommand1;
     this.oleDbDataAdapter1.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "Table", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("Expr1", "Expr1")
         })
     });
     //
     // oleDbSelectCommand1
     //
     this.oleDbSelectCommand1.CommandText = @"SELECT '' AS numero_letra, '' AS vencimiento, '' AS monto, '' AS abonado, '' AS saldo_letra, '' AS estado, '' AS rut_alumno, '' AS rut_apoderado, '' AS comuna, '' AS ciudad, '' AS nombre_apoderado, '' AS pers_tape_paterno, '' AS pers_tape_materno, '' AS direccion, '' AS telefono";
     this.oleDbSelectCommand1.Connection  = this.oleDbConnection1;
     //
     // oleDbConnection1
     //
     this.oleDbConnection1.ConnectionString = ((string)(configurationAppSettings.GetValue("cadenaConexion", typeof(string))));
     //
     // dataSet11
     //
     this.dataSet11.DataSetName = "DataSet1";
     this.dataSet11.Locale      = new System.Globalization.CultureInfo("es-ES");
     this.dataSet11.Namespace   = "http://www.tempuri.org/DataSet1.xsd";
     this.Load += new System.EventHandler(this.Page_Load);
     ((System.ComponentModel.ISupportInitialize)(this.dataSet11)).EndInit();
 }
예제 #7
0
        static Settings()
        {
            PATH_DEFAULTS = new System.String[] { ".", Environment.SpecialFolder.ApplicationData + "/properties" };
            {
                System.Configuration.AppSettingsReader properties = PropertyHelper.load(PATH_DEFAULTS, PROPERTY_FILE);
                if (properties == null /*|| properties.Count == 0*/)
                {
                    System.Console.Error.WriteLine("FATAL: simulator cannot start without properties!");
                    System.Environment.Exit(1);
                }

                SIM_NETWORK      = PropertyHelper.getIpProperty(properties, PROPERTY_PKG + ".network");
                SIM_NETMASK      = PropertyHelper.getIpProperty(properties, PROPERTY_PKG + ".mask");
                PROB_ETH_IP      = PropertyHelper.getFloatProperty(properties, PROPERTY_PKG + ".prob.eth.ip");
                PROB_ETH_ARP     = PropertyHelper.getFloatProperty(properties, PROPERTY_PKG + ".prob.eth.arp");
                PROB_ETH_RARP    = PropertyHelper.getFloatProperty(properties, PROPERTY_PKG + ".prob.eth.rarp");
                PROB_ETH_OTHER   = PropertyHelper.getFloatProperty(properties, PROPERTY_PKG + ".prob.eth.other");
                PROB_ARP_REQUEST = PropertyHelper.getFloatProperty(properties, PROPERTY_PKG + ".prob.arp.request");
                PROB_ARP_REPLY   = PropertyHelper.getFloatProperty(properties, PROPERTY_PKG + ".prob.arp.reply");
                PROB_IP_TCP      = PropertyHelper.getFloatProperty(properties, PROPERTY_PKG + ".prob.ip.tcp");
                PROB_IP_UDP      = PropertyHelper.getFloatProperty(properties, PROPERTY_PKG + ".prob.ip.udp");
                PROB_IP_ICMP     = PropertyHelper.getFloatProperty(properties, PROPERTY_PKG + ".prob.ip.icmp");
                PROB_IP_OTHER    = PropertyHelper.getFloatProperty(properties, PROPERTY_PKG + ".prob.ip.other");
            }
        }
예제 #8
0
        public BaseDatabaseService()
        {
            var appSettingsReader = new System.Configuration.AppSettingsReader();


            ConnectionString = (string)appSettingsReader.GetValue("ConnectionString", typeof(string));
        }
예제 #9
0
        /// <summary>
        /// Initialize Command Option's Model
        /// </summary>
        public ICommandModel CreateCommandModel()
        {
            var model = new OrchestartorModel();

            System.Configuration.AppSettingsReader reader = new System.Configuration.AppSettingsReader();

            model.HostName = string.IsNullOrEmpty(OrchestratorConfig.HostName) ?
                             reader.GetValue(nameof(OrchestratorConfig.HostName), typeof(string)).ToString() :
                             OrchestratorConfig.HostName;

            model.Password = string.IsNullOrEmpty(OrchestratorConfig.Password) ?
                             reader.GetValue(nameof(OrchestratorConfig.Password), typeof(string)).ToString() :
                             OrchestratorConfig.Password;

            model.TenantName = string.IsNullOrEmpty(OrchestratorConfig.TenantName) ?
                               reader.GetValue(nameof(OrchestratorConfig.TenantName), typeof(string)).ToString() :
                               OrchestratorConfig.TenantName;

            model.UserId = string.IsNullOrEmpty(OrchestratorConfig.UserId) ?
                           reader.GetValue(nameof(OrchestratorConfig.UserId), typeof(string)).ToString() :
                           OrchestratorConfig.HostName;

            model.Commands = OrchestratorConfig.Commands;
            return(model);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            Cerval_Configuration c = new Cerval_Configuration("StaffIntranet_TTD_AllowRoomEdit");
            string s = c.Value;

            if (!c.valid)//try revert to config file
            {
                System.Configuration.AppSettingsReader ar = new System.Configuration.AppSettingsReader();
                s = ar.GetValue("TTD_AllowRoomEdit", typeof(string)).ToString();
            }
            if (s.ToUpper() == "TRUE")
            {
                MenuList.InnerHtml += "<a href =\"EditRooms.aspx\">Edit Rooms</a><br />";
            }

            c = new Cerval_Configuration("StaffIntranet_TTPlan_Title");
            Information.InnerHtml = c.Value + "<br />";

            c = new Cerval_Configuration("StaffIntranet_TTD_TimetablePlanDate");
            DateTime d = new DateTime();

            try
            {
                d = System.Convert.ToDateTime(c.Value);

                Information.InnerHtml += "Timetable as at " + d.ToShortDateString() + "<br/> Please select a choice from the options below:<br /><br />";
            }
            catch { }
        }
        public void SetUnitIPFromXML(XmlDocument doc, string sIP)
        {
            try
            {
                System.Configuration.AppSettingsReader appSettings = new System.Configuration.AppSettingsReader();
                if (_logger == null)
                {
                    // *** TODO
                    //_logger = new FileLogger(LoggerSeverities.Debug, (string)appSettings.GetValue("ServiceLog", typeof(string)));
                    //               OPS.Comm.Messaging.CommMain.Logger.AddLogMessage += new AddLogMessageHandler(Logger_AddLogMessage);
                    //               OPS.Comm.Messaging.CommMain.Logger.AddLogException += new AddLogExceptionHandler(Logger_AddLogException);
                    //               DatabaseFactory.Logger = _logger;
                }

                try
                {
                    int iUnitId = GetUnitId(doc);
                    if (iUnitId != -1)
                    {
                        SetUnitIPFromID(iUnitId, sIP);
                    }
                }
                catch
                {
                }
            }
            catch (Exception e)
            {
                Logger_AddLogException(e);
            }
        }
예제 #12
0
        public Config()
        {
            try
            {
                System.Configuration.AppSettingsReader configurationAppSettings = new System.Configuration.AppSettingsReader();
                this.mwConnection = new System.Data.SqlClient.SqlConnection();
                this.mwConnection.ConnectionString = ((string)(configurationAppSettings.GetValue("mwConnection.ConnectionString", typeof(string))));

                configWatcher = new FileSystemWatcher();
                configWatcher.EnableRaisingEvents = false;
                configWatcher.Filter   = ((string)(configurationAppSettings.GetValue("ServerConfig.Filter", typeof(string))));
                configWatcher.Path     = ((string)(configurationAppSettings.GetValue("ServerConfig.Path", typeof(string))));
                configWatcher.Created += new FileSystemEventHandler(newConfigFile);
                configWatcher.Changed += new FileSystemEventHandler(updatedConfigFile);

                // load config file
                string fullname = ((string)(configurationAppSettings.GetValue("ServerConfig.Path", typeof(string)))) +
                                  Path.DirectorySeparatorChar + ((string)(configurationAppSettings.GetValue("ServerConfig.Filter", typeof(string))));
                loadConfigFile(fullname);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Exception " + ex.ToString());
            }
        }
예제 #13
0
        public static string GetSettingsValue(string key)
        {
            var    readerSettings = new System.Configuration.AppSettingsReader();
            string retorno        = (string)readerSettings.GetValue(key, typeof(string));

            return(retorno);
        }
        public Pantalla_Asociacion_Conyuge(int nroAfiliadoConyuPrinci, string nombre, string apellido)
        {
            InitializeComponent();

            dateTimePicker1.Format       = DateTimePickerFormat.Custom;
            dateTimePicker1.CustomFormat = "dd/MM/yyyy";

            nroAfiliadoConyugePrincipal = nroAfiliadoConyuPrinci;

            tablaAfiliados = new DataTable();
            tablaAfiliados.Columns.Add("nro_afiliado");
            tablaAfiliados.Columns.Add("nombre");
            tablaAfiliados.Columns.Add("apellido");
            tablaAfiliados.Rows.Add(nroAfiliadoConyugePrincipal, nombre, apellido);

            comboBox1.Items.Add("DNI");
            comboBox1.Items.Add("CI");
            comboBox1.Items.Add("LE");
            comboBox1.Items.Add("LC");

            comboBox2.Items.Add("Masculino");
            comboBox2.Items.Add("Femenino");

            var MyReader = new System.Configuration.AppSettingsReader();

            fechaHoy = MyReader.GetValue("Datekey", typeof(string)).ToString();

            dateTimePicker1.MaxDate = Convert.ToDateTime(fechaHoy);
        }
예제 #15
0
 /// <summary>
 /// Static constructor. Initializes values global to all Msg04.
 /// </summary>
 static Msg04()
 {
     System.Configuration.AppSettingsReader appSettings = new System.Configuration.AppSettingsReader();
     FINES_DEF_CODES_FINE   = (string)appSettings.GetValue("FinesDefCodes.Fine", typeof(string));
     FINES_DEF_PAYMENT      = (int)appSettings.GetValue("FinesDef.Payment", typeof(int));
     OPERATIONS_DEF_PAYMENT = (int)appSettings.GetValue("OperationsDef.Payment", typeof(int));
 }
예제 #16
0
 /// <summary>
 /// Método necesario para admitir el Diseñador, no se puede modificar
 /// el contenido del método con el editor de código.
 /// </summary>
 private void InitializeComponent()
 {
     System.Configuration.AppSettingsReader configurationAppSettings = new System.Configuration.AppSettingsReader();
     this.oleDbDataAdapter1   = new System.Data.OleDb.OleDbDataAdapter();
     this.oleDbSelectCommand1 = new System.Data.OleDb.OleDbCommand();
     this.oleDbConnection1    = new System.Data.OleDb.OleDbConnection();
     this.flujoEfectivo1      = new flujo_vencimiento.FlujoEfectivo();
     ((System.ComponentModel.ISupportInitialize)(this.flujoEfectivo1)).BeginInit();
     //
     // oleDbDataAdapter1
     //
     this.oleDbDataAdapter1.SelectCommand = this.oleDbSelectCommand1;
     this.oleDbDataAdapter1.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "Table", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("CARR_TDESC", "CARR_TDESC"),
             new System.Data.Common.DataColumnMapping("CARR_CCOD", "CARR_CCOD"),
             new System.Data.Common.DataColumnMapping("TOTAL_CHEQUE_A", "TOTAL_CHEQUE_A"),
             new System.Data.Common.DataColumnMapping("TOTAL_LETRA_A", "TOTAL_LETRA_A"),
             new System.Data.Common.DataColumnMapping("TOTAL_CHEQUE_N", "TOTAL_CHEQUE_N"),
             new System.Data.Common.DataColumnMapping("TOTAL_LETRA_N", "TOTAL_LETRA_N"),
             new System.Data.Common.DataColumnMapping("EFECTIVO_A", "EFECTIVO_A"),
             new System.Data.Common.DataColumnMapping("EFECTIVO_N", "EFECTIVO_N"),
             new System.Data.Common.DataColumnMapping("TOTAL_CREDITO_A", "TOTAL_CREDITO_A"),
             new System.Data.Common.DataColumnMapping("TOTAL_BECA_A", "TOTAL_BECA_A"),
             new System.Data.Common.DataColumnMapping("TOTAL_DESCUENTO_A", "TOTAL_DESCUENTO_A"),
             new System.Data.Common.DataColumnMapping("TOTAL_CREDITO_N", "TOTAL_CREDITO_N"),
             new System.Data.Common.DataColumnMapping("TOTAL_BECA_N", "TOTAL_BECA_N"),
             new System.Data.Common.DataColumnMapping("TOTAL_DESCUENTO_N", "TOTAL_DESCUENTO_N"),
             new System.Data.Common.DataColumnMapping("TOTAL_MATR_CHEQUE_A", "TOTAL_MATR_CHEQUE_A"),
             new System.Data.Common.DataColumnMapping("TOTAL_MATR_LETRA_A", "TOTAL_MATR_LETRA_A"),
             new System.Data.Common.DataColumnMapping("TOTAL_COL_LETRA_A", "TOTAL_COL_LETRA_A"),
             new System.Data.Common.DataColumnMapping("TOTAL_COL_LETRA_A1", "TOTAL_COL_LETRA_A1"),
             new System.Data.Common.DataColumnMapping("TOTAL_MATR_CHEQUE_N", "TOTAL_MATR_CHEQUE_N"),
             new System.Data.Common.DataColumnMapping("TOTAL_MATR_LETRA_N", "TOTAL_MATR_LETRA_N"),
             new System.Data.Common.DataColumnMapping("TOTAL_COL_LETRA_N", "TOTAL_COL_LETRA_N"),
             new System.Data.Common.DataColumnMapping("TOTAL_COL_LETRA_N1", "TOTAL_COL_LETRA_N1"),
             new System.Data.Common.DataColumnMapping("TOTAL_MATR_EFECTIVO_A", "TOTAL_MATR_EFECTIVO_A"),
             new System.Data.Common.DataColumnMapping("TOTAL_COL_EFECTIVO_A", "TOTAL_COL_EFECTIVO_A"),
             new System.Data.Common.DataColumnMapping("TOTAL_MATR_EFECTIVO_N", "TOTAL_MATR_EFECTIVO_N"),
             new System.Data.Common.DataColumnMapping("TOTAL_COL_EFECTIVO_N", "TOTAL_COL_EFECTIVO_N")
         })
     });
     //
     // oleDbSelectCommand1
     //
     this.oleDbSelectCommand1.CommandText = @"SELECT '' AS CARR_TDESC, '' AS CARR_CCOD, '' AS TOTAL_CHEQUE_A, '' AS TOTAL_LETRA_A, '' AS TOTAL_CHEQUE_N, '' AS TOTAL_LETRA_N, '' AS EFECTIVO_A, '' AS EFECTIVO_N, '' AS TOTAL_CREDITO_A, '' AS TOTAL_BECA_A, '' AS TOTAL_DESCUENTO_A, '' AS TOTAL_CREDITO_N, '' AS TOTAL_BECA_N, '' AS TOTAL_DESCUENTO_N, '' AS TOTAL_MATR_CHEQUE_A, '' AS TOTAL_MATR_LETRA_A, '' AS TOTAL_COL_LETRA_A, '' AS TOTAL_COL_CHEQUE_A, '' AS TOTAL_MATR_CHEQUE_N, '' AS TOTAL_MATR_LETRA_N, '' AS TOTAL_COL_LETRA_N, '' AS TOTAL_COL_CHEQUE_N, '' AS TOTAL_MATR_EFECTIVO_A, '' AS TOTAL_COL_EFECTIVO_A, '' AS TOTAL_MATR_EFECTIVO_N, '' AS TOTAL_COL_EFECTIVO_N FROM DUAL";
     this.oleDbSelectCommand1.Connection  = this.oleDbConnection1;
     //
     // oleDbConnection1
     //
     this.oleDbConnection1.ConnectionString = ((string)(configurationAppSettings.GetValue("cadenaConexion", typeof(string))));
     //
     // flujoEfectivo1
     //
     this.flujoEfectivo1.DataSetName = "FlujoEfectivo";
     this.flujoEfectivo1.Locale      = new System.Globalization.CultureInfo("es-ES");
     this.flujoEfectivo1.Namespace   = "http://www.tempuri.org/FlujoEfectivo.xsd";
     this.Load += new System.EventHandler(this.Page_Load);
     ((System.ComponentModel.ISupportInitialize)(this.flujoEfectivo1)).EndInit();
 }
예제 #17
0
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.Configuration.AppSettingsReader configurationAppSettings = new System.Configuration.AppSettingsReader();
            this.cnFriends        = new System.Data.SqlClient.SqlConnection();
            this.cmAttendeesCount = new System.Data.SqlClient.SqlCommand();
            this.cmContacts       = new System.Data.SqlClient.SqlCommand();
            //
            // cnFriends
            //
            this.cnFriends.ConnectionString = ((string)(configurationAppSettings.GetValue("cnFriends.ConnectionString", typeof(string))));
            //
            // cmAttendeesCount
            //
            this.cmAttendeesCount.CommandText    = @"
IF EXISTS(SELECT PlaceID FROM Place WHERE PlaceID = @PlaceID)
SELECT COUNT(*) AS Attendees, @PlaceID 
FROM  (SELECT UserID
               FROM   TimeLapse
               WHERE PlaceID = @PlaceID
               GROUP BY UserID) Users
ELSE
SELECT -1";
            this.cmAttendeesCount.CommandTimeout = 29;
            this.cmAttendeesCount.Connection     = this.cnFriends;
            this.cmAttendeesCount.Parameters.Add(new System.Data.SqlClient.SqlParameter("@PlaceID", System.Data.SqlDbType.Variant));
            //
            // cmContacts
            //
            this.cmContacts.CommandText = @"SELECT ContactUser.FirstName, ContactUser.LastName, ContactUser.Email, ContactUser.Notes, ContactUser.IsApproved FROM [User] INNER JOIN (SELECT [User].FirstName, [User].LastName, [User].Email, Contact.Notes, Contact.IsApproved, Contact.DestinationID FROM Contact INNER JOIN [User] ON [User].UserID = Contact.RequestID) ContactUser ON [User].UserID = ContactUser.DestinationID WHERE ([User].Login = @Login) AND ([User].Password = @Password)";
            this.cmContacts.Connection  = this.cnFriends;
            this.cmContacts.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Login", System.Data.SqlDbType.VarChar, 15, "Login"));
            this.cmContacts.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Password", System.Data.SqlDbType.VarChar, 15, "Password"));
        }
예제 #18
0
        private void barcode_Load(object sender, EventArgs e)
        {
            //BarCode.Start();
            System.Configuration.AppSettingsReader configurationAppSettings = new System.Configuration.AppSettingsReader();
            string          connstr = configurationAppSettings.GetValue("universal_analyse_connstr", typeof(string)).ToString();
            OleDbConnection myConn  = new OleDbConnection(connstr);

            myConn.Open();
            string       ls_up = "update [t_barcode_Listing_table] set [units on hand]=(select [units on hand] from [t_lisa_Listing_Table] where item=[t_barcode_Listing_table].item);";
            OleDbCommand cmd   = new OleDbCommand(ls_up, myConn);

            cmd.ExecuteNonQuery();



            string           ls_m_sql = "select 'BarCode Count:'+cast((select count(item) from [t_barcode_Listing_table] where len(barcode)>7) as nvarchar(20))+'   '+'Instock Item:'+cast((select count(item) from [t_barcode_Listing_table] where [Units On Hand] >0) as nvarchar(20))+'   '+'All Item:'+cast((select count(item) from [t_barcode_Listing_table]) as nvarchar(20))";
            OleDbDataAdapter adapter2 = new OleDbDataAdapter(ls_m_sql, myConn);
            DataSet          ds2      = new DataSet();

            adapter2.Fill(ds2);
            this.Text = " " + ds2.Tables[0].Rows[0][0].ToString();


            myConn.Close();
        }
예제 #19
0
 /// <summary>
 /// Método necesario para admitir el Diseñador, no se puede modificar
 /// el contenido del método con el editor de código.
 /// </summary>
 private void InitializeComponent()
 {
     System.Configuration.AppSettingsReader configurationAppSettings = new System.Configuration.AppSettingsReader();
     this.oleDbSelectCommand1 = new System.Data.OleDb.OleDbCommand();
     this.oleDbConnection1    = new System.Data.OleDb.OleDbConnection();
     this.oleDbDataAdapter1   = new System.Data.OleDb.OleDbDataAdapter();
     this.dataSet11           = new contrato_docente_otec.DataSet1();
     ((System.ComponentModel.ISupportInitialize)(this.dataSet11)).BeginInit();
     //
     // oleDbSelectCommand1
     //
     this.oleDbSelectCommand1.CommandText = @"SELECT 0 AS CDOt_NCORR, 0 AS pers_ncorr, '' AS Nombre_Docente, '' AS Rut_Docente, '' AS DV, '' AS Fecha_Nac, '' AS Estado_Civil, '' AS Direccion, '' AS Comuna, '' AS Ciudad, '' AS PROFESION, 0 AS Bhot_ANEXO, 0 AS dcurr_CCOD, '' AS dcurr_TDESC, '' AS mote_CCOD, 0 AS daot_NHORA, '' AS mote_TDESC, '' AS daot_mhora, 0 AS anot_ncorr, '' AS INST_TRAZON_SOCIAL, '' AS NombreRepLeg, '' AS tcat_tdesc, '' AS Nacionalidad, '' AS cdot_finicio, '' AS cdot_ffin, '' AS SEot_TDESC, '' AS sede_tdesc, '' AS anot_ncuotas, '' AS anot_inicio, '' AS anot_fin, '' AS institucion_t, '' AS TipoDocente, '' AS ano_contrato, '' AS seot_ncorr, 0 AS daot_ncorr, 0 AS valorI, '' AS Mes, '' AS Dia, '' AS Año, 0 AS valoII, '' AS anot_ncodigo";
     this.oleDbSelectCommand1.Connection  = this.oleDbConnection1;
     //
     // oleDbConnection1
     //
     this.oleDbConnection1.ConnectionString = ((string)(configurationAppSettings.GetValue("cadenaConexion", typeof(string))));
     this.oleDbConnection1.InfoMessage     += new System.Data.OleDb.OleDbInfoMessageEventHandler(this.oleDbConnection1_InfoMessage);
     //
     // oleDbDataAdapter1
     //
     this.oleDbDataAdapter1.SelectCommand = this.oleDbSelectCommand1;
     this.oleDbDataAdapter1.RowUpdated   += new System.Data.OleDb.OleDbRowUpdatedEventHandler(this.oleDbDataAdapter1_RowUpdated);
     //
     // dataSet11
     //
     this.dataSet11.DataSetName = "DataSet1";
     this.dataSet11.Locale      = new System.Globalization.CultureInfo("es-CL");
     this.dataSet11.Namespace   = "http://www.tempuri.org/DataSet1.xsd";
     this.Load += new System.EventHandler(this.Page_Load);
     ((System.ComponentModel.ISupportInitialize)(this.dataSet11)).EndInit();
 }
        public SecurityLevel GetSecurityLevelByID(int securityLevelID)
        {
            SecurityLevel securityLevel = new SecurityLevel();

            securityLevel.SecurityLevelReal        = 0;
            securityLevel.SecurityLevelID          = 0;
            securityLevel.SecurityLevelDescription = "";

            // We need some objects
            System.Configuration.AppSettingsReader settingsReader = new System.Configuration.AppSettingsReader();
            string configDirectory = settingsReader.GetValue("XmlConfigDirectory", typeof(string)).ToString();

            // We read the required information from the xml-file
            System.Data.DataSet dataSet = new System.Data.DataSet();
            dataSet.ReadXml(configDirectory + settingsReader.GetValue("SecuritylevelsConfigXml", typeof(string)).ToString());

            // Cycle through the dataset and set object's information
            foreach (System.Data.DataRow dr in dataSet.Tables[0].Rows)
            {
                if (Int32.Parse(dr["securitylevel_id"].ToString()) == securityLevelID)
                {
                    securityLevel.SecurityLevelID          = securityLevelID;
                    securityLevel.SecurityLevelDescription = dr["name"].ToString();
                    securityLevel.SecurityLevelReal        = Int32.Parse(dr["level"].ToString());
                    break;
                }
            }
            return(securityLevel);
        }
예제 #21
0
 public static void GenerateMethodMap()
 {
     Mil = new MethodInclusion();
     string line;
     System.Configuration.AppSettingsReader r = new System.Configuration.AppSettingsReader();
     string path = (string)r.GetValue("MethodInclusionList", typeof(String));
     // Read the file and display it line by line.
     System.IO.StreamReader file = new System.IO.StreamReader(path);
     while ((line = file.ReadLine()) != null)
     {
         Mil.list.Add(line, line);
     }
     file.Close();
     //read a file which contains information on what to apply
     //the file will be a key and values list, method name, followed by sleep time,
     //a boolean to throw method exceptions or not and a bool to hold onto a unmanaged reference
     Type myType = (typeof(RentalServiceClient));
     // Get the public methods.
     sim = new Sim();
     MethodInfo[] myArrayMethodInfo = myType.GetMethods(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly);
     // initialise methods
     foreach (MethodInfo methodInfo in myArrayMethodInfo)
     {
         SimulationAction sa = new SimulationAction();
         sa.methodname = methodInfo.Name;
         sa.consumeheap = false;
         sa.sleep = 1;
         sa.throwException = false;
         sa.consumecpu = false;
         if (Mil.list.ContainsKey(methodInfo.Name))
         {
             sim.methodSimulationMap.Add(sa);
         }
     }
 }
예제 #22
0
 /// <summary>
 /// Método necesario para admitir el Diseñador, no se puede modificar
 /// el contenido del método con el editor de código.
 /// </summary>
 private void InitializeComponent()
 {
     System.Configuration.AppSettingsReader configurationAppSettings = new System.Configuration.AppSettingsReader();
     this.oleDbSelectCommand1 = new System.Data.OleDb.OleDbCommand();
     this.oleDbConnection1    = new System.Data.OleDb.OleDbConnection();
     this.oleDbDataAdapter1   = new System.Data.OleDb.OleDbDataAdapter();
     this.dataSet11           = new contratos_otec.DataSet1();
     ((System.ComponentModel.ISupportInitialize)(this.dataSet11)).BeginInit();
     //
     // oleDbSelectCommand1
     //
     this.oleDbSelectCommand1.CommandText = @"SELECT '' AS monto_total, '' AS jorn_tdesc, '' AS emailp, '' AS eciv_tdescp, '' AS pais_tdescp, ' ' AS pers_tprofesionp, '' AS emailppc, '' AS eciv_tdescppc, '' AS pais_tdescppc, '' AS pers_tprofesionppc, 0 AS nro_informe, '' AS NOMBRE_INFORME, '' AS NRO_CONTRATO, '' AS DD_HOY, '' AS MM_HOY, '' AS YY_HOY, '' AS NOMBRE_INSTITUCION, '' AS PERIODO_ACADEMICO, '' AS RUT_INSTITUCION, '' AS NOMBRE_REPRESENTANTE, '' AS RUT_POSTULANTE, '' AS EDAD, '' AS NOMBRE_ALUMNO, '' AS CARRERA, '' AS RUT_CODEUDOR, '' AS NOMBRE_CODEUDOR, '' AS PROFESION, '' AS DIRECCION, '' AS DIRECCION_ALUMNO, '' AS CIUDAD, '' AS COMUNA, '' AS CIUDAD_ALUMNO, '' AS COMUNA_ALUMNO, '' AS TIPO_DOCUMENTO, '' AS DOCUMENTO, '' AS NOMBRE_BANCO, '' AS VALOR_DOCTO, '' AS NRO_DOCTO, '' AS FECHA_VENCIMIENTO, '' AS TOTAL_M, '' AS TOTAL_A, '' AS matricula, '' AS arancel, '' AS sede, '' AS comuna_sede";
     this.oleDbSelectCommand1.Connection  = this.oleDbConnection1;
     //
     // oleDbConnection1
     //
     this.oleDbConnection1.ConnectionString = ((string)(configurationAppSettings.GetValue("cadenaConexion", typeof(string))));
     //
     // oleDbDataAdapter1
     //
     this.oleDbDataAdapter1.SelectCommand = this.oleDbSelectCommand1;
     this.oleDbDataAdapter1.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "Table", new System.Data.Common.DataColumnMapping[0])
     });
     //
     // dataSet11
     //
     this.dataSet11.DataSetName = "DataSet1";
     this.dataSet11.Locale      = new System.Globalization.CultureInfo("es-CL");
     this.dataSet11.Namespace   = "http://www.tempuri.org/DataSet1.xsd";
     this.Load += new System.EventHandler(this.Page_Load);
     ((System.ComponentModel.ISupportInitialize)(this.dataSet11)).EndInit();
 }
예제 #23
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            if (currentSelectedMethod != null)
            {
                currentSelectedMethod.sleep             = int.Parse(this.txtSleeptimer.Text);
                currentSelectedMethod.throwException    = this.chkException.IsChecked.HasValue ? this.chkException.IsChecked.Value : false;
                currentSelectedMethod.consumeheap       = this.chkUnmanaged.IsChecked.HasValue ? this.chkUnmanaged.IsChecked.Value : false;
                currentSelectedMethod.consumeheapfactor = int.Parse(this.heaprate.Text);
                currentSelectedMethod.consumecpu        = this.chkCpu.IsChecked.HasValue ? this.chkCpu.IsChecked.Value : false;
                this.lbTodoList.Items.Refresh();
                SimulationDL.Persisttofile();//this technique is needed so that the actual service can read this and perform simulations
            }
            //persist the data facade state
            string facade = radioFacade1.IsChecked.HasValue ? "DataFacade1" : "DataFacade2";

            if (!radioFacade1.IsChecked.Value)
            {
                facade = radioFacade2.IsChecked.HasValue ? "DataFacade2" : "DataFacade1";
            }

            System.Configuration.AppSettingsReader r = new System.Configuration.AppSettingsReader();
            string path = (string)r.GetValue("DataFaceSimulationsettings", typeof(String));

            using (StreamWriter writer = new StreamWriter(path, false))
            {
                writer.Write(facade);
            }
        }
        public IngestSecFormBlob(bool useConsole)
        {
            _useConsole = useConsole;
            var configReader = new System.Configuration.AppSettingsReader();

            _basePath = (string)configReader.GetValue("DataStorePath", string.Empty.GetType());
        }
예제 #25
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
     System.Configuration.AppSettingsReader         configurationAppSettings = new System.Configuration.AppSettingsReader();
     this.NES_notif    = new System.Windows.Forms.NotifyIcon(this.components);
     this.contextMenu1 = new System.Windows.Forms.ContextMenu();
     this.timer1       = new System.Windows.Forms.Timer(this.components);
     this.SuspendLayout();
     //
     // NES_notif
     //
     this.NES_notif.ContextMenu = this.contextMenu1;
     this.NES_notif.Icon        = ((System.Drawing.Icon)(resources.GetObject("NES_notif.Icon")));
     this.NES_notif.Text        = "NES Mouse";
     this.NES_notif.Visible     = true;
     //
     // timer1
     //
     this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
     //
     // Form1
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize        = new System.Drawing.Size(292, 273);
     this.Name          = "Form1";
     this.Opacity       = ((double)(configurationAppSettings.GetValue("Form1.Opacity", typeof(double))));
     this.ShowInTaskbar = ((bool)(configurationAppSettings.GetValue("Form1.ShowInTaskbar", typeof(bool))));
     this.Text          = "Form1";
     this.WindowState   = System.Windows.Forms.FormWindowState.Minimized;
     this.ResumeLayout(false);
 }
예제 #26
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Utility u = new Utility();
                //string staff_code = u.GetStaffCodefromContext(Context);
                string staff_code = u.GetsStaffCodefromRequest(Request);
                Cerval_Configuration c2 = new Cerval_Configuration("StaffIntranet_SEN-MANAGERS");
                string s_sen = ""; bool display = false;
                s_sen = c2.Value;
                if (!c2.valid)//try revert to config file
                {
                    System.Configuration.AppSettingsReader ar = new System.Configuration.AppSettingsReader();
                    s_sen = ar.GetValue("SEN-MANAGERS", typeof(string)).ToString();
                }
                staff_code = staff_code.Trim();
                char[]   c1      = new char[1]; c1[0] = ','; s_sen = s_sen.ToUpper();
                string[] s_array = new string[10]; s_array = s_sen.Split(c1);


                if (s_array.Contains(staff_code.ToUpper()))
                {
                    SENEdit1.SenId     = new Guid(Request.QueryString["SENID"]);
                    SENEdit1.StudentId = new Guid(Request.QueryString["StudentID"]);
                    SENEdit1.UpdateControls();
                    SENEdit1.Visible = true;
                }
                else
                {
                    Response.Write("<br/><h3>You do not have permission to edit SEN data.</h3><br/>" + s_sen + "<br/>" + staff_code + "<br/>" + s_array[4].ToString());
                }
            }
        }
        public static int SeekActiveUnitsCuenca(DataTable dtzone, int qty)
        {
            System.Configuration.AppSettingsReader appSettings = new System.Configuration.AppSettingsReader();
            string UNIT_ID = (string)appSettings.GetValue("GroupsChilds.UnitId", typeof(string));

            string swhere = "";
            CmpGroupsChildsGisDB cGroupChildsDb = new CmpGroupsChildsGisDB();
            CmpGroupsDB          cGroupsDb      = new CmpGroupsDB();

            foreach (DataRow dr in dtzone.Rows)
            {
                // If there is not a UNIT we follow deeping in the tree...(Level 2)
                if (dr["CGRPG_TYPE"].ToString() != UNIT_ID)
                {
                    swhere = "CGRPG_ID	= "+ dr["CGRPG_CHILD"].ToString();
                    DataTable dtsubzone = cGroupChildsDb.GetData(null, swhere, null, null);
                    qty = SeekActiveUnits(dtsubzone, qty);
                }
                else
                {
                    CmpUnitsDB udb = new CmpUnitsDB();
                    swhere = "UNI_ID = " + dr["CGRPG_CHILD"].ToString() + " AND UNI_IP IS NOT NULL AND UNI_DSTA_ID IN (0,1,2)";
                    DataTable dtUnit = udb.GetData(null, swhere, null, null);
                    if (dtUnit.Rows.Count != 0)
                    {
                        qty++;
                    }
                }
            }
            return(qty);
        }
예제 #28
0
 public ChangePasswordVM()
 {
     if (ConfigurationMasterMemory.ConfigurationDict.ContainsKey("WindowsPosition"))
     {
         BoltAppSettingsWindowsPosition oBoltAppSettingsWindowsPosition = new BoltAppSettingsWindowsPosition();
         oBoltAppSettingsWindowsPosition = (BoltAppSettingsWindowsPosition)ConfigurationMasterMemory.ConfigurationDict["WindowsPosition"];
         if (oBoltAppSettingsWindowsPosition != null && oBoltAppSettingsWindowsPosition.CHGPASSWORD != null && oBoltAppSettingsWindowsPosition.CHGPASSWORD.WNDPOSITION != null)
         {
             Height       = oBoltAppSettingsWindowsPosition.CHGPASSWORD.WNDPOSITION.Down.ToString();
             TopPosition  = oBoltAppSettingsWindowsPosition.CHGPASSWORD.WNDPOSITION.Top.ToString();
             LeftPosition = oBoltAppSettingsWindowsPosition.CHGPASSWORD.WNDPOSITION.Left.ToString();
             Width        = oBoltAppSettingsWindowsPosition.CHGPASSWORD.WNDPOSITION.Right.ToString();
         }
     }
     System.Configuration.AppSettingsReader lobjreader = new System.Configuration.AppSettingsReader();
     try
     {
         mintNoofDays = (int)lobjreader.GetValue("PasswordExpiryDays", typeof(int));
         if (mintNoofDays == 0)
         {
             mintNoofDays = 14;
         }
     }
     catch (Exception ex)
     {
         mintNoofDays = 14;
     }
 }
예제 #29
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="url"></param>
        /// <returns></returns>
        public static string GetHttpFullPath(string url, string token = "")
        {
            if (string.IsNullOrEmpty(url))
            {
                return(null);
            }

            if (string.IsNullOrEmpty(token))
            {
                return(string.Format("{0}/{1}", UserEnvironment.CurrentServerBaseUrl.TrimEnd('/'), url.Trim().TrimStart('/')));
            }

            var sr = new System.Configuration.AppSettingsReader();

            try
            {
                var baseUrl = sr.GetValue("BaseUrl_" + token, typeof(string)) as String;
                if (baseUrl == null)
                {
                    return(string.Format("{0}/{1}", UserEnvironment.CurrentServerBaseUrl.TrimEnd('/'), url.Trim().TrimStart('/')));
                }

                return(string.Format("{0}/{1}", baseUrl.TrimEnd('/'), url.Trim().TrimStart('/')));
            }
            catch (Exception ex)
            {
                return(string.Format("{0}/{1}", UserEnvironment.CurrentServerBaseUrl.TrimEnd('/'), url.Trim().TrimStart('/')));
            }
        }
예제 #30
0
        private string Encrypt(string strToEnc, bool useHash)
        {
            byte[] keyArr;
            byte[] toEncryptBytes = Encoding.UTF8.GetBytes(strToEnc);

            System.Configuration.AppSettingsReader settingsReader = new System.Configuration.AppSettingsReader();

            string key = "myKey";

            if (useHash)
            {
                MD5CryptoServiceProvider md5Provider = new MD5CryptoServiceProvider();
                keyArr = md5Provider.ComputeHash(Encoding.UTF8.GetBytes(key));
                md5Provider.Clear();
            }
            else
            {
                keyArr = Encoding.UTF8.GetBytes(key);
            }

            TripleDESCryptoServiceProvider cryptoProvider = new TripleDESCryptoServiceProvider();

            cryptoProvider.Key     = keyArr;
            cryptoProvider.Mode    = CipherMode.ECB;
            cryptoProvider.Padding = PaddingMode.PKCS7;

            ICryptoTransform cryptoTransform = cryptoProvider.CreateEncryptor();

            byte[] resultBytes =
                cryptoTransform.TransformFinalBlock(toEncryptBytes, 0, toEncryptBytes.Length);
            cryptoProvider.Clear();

            return(Convert.ToBase64String(resultBytes, 0, resultBytes.Length));
        }
예제 #31
0
        public Pantalla_Cancelacion_Afiliado(int idU)
        {
            InitializeComponent();

            idUser = idU;

            var MyReader = new System.Configuration.AppSettingsReader();

            fechaHoy = MyReader.GetValue("Datekey", typeof(string)).ToString();


            GD2C2016DataSetTableAdapters.turnosDeAfiliadoTableAdapter turnosAdapter = new GD2C2016DataSetTableAdapters.turnosDeAfiliadoTableAdapter();


            turnosData = turnosAdapter.obtenerTurnosDeAfiliado(Convert.ToDecimal(idUser));


            foreach (DataRow turno in turnosData.Rows)
            {
                dataGridView1.Rows.Add(turno.Field <decimal>("numero"),
                                       turno.Field <string>("nombre"),
                                       turno.Field <string>("apellido"),
                                       turno.Field <string>("descripcion"),
                                       turno.Field <DateTime>("fecha"));
            }
        }
예제 #32
0
/// <summary>
/// Try to get path to inifile in static constructor
/// </summary>

        static ServicesIniFile()
        {
            try
            {
                System.Configuration.AppSettingsReader asr = new System.Configuration.AppSettingsReader();
                if (asr != null)
                {
                    IniFilePath = asr.GetValue("IniFilePath", typeof(string)) as string;
                }
            }

            catch (Exception ex) { ex = ex; }

            if (IniFilePath == null)             // default path if not defined in inifile
            {
                IniFilePath = System.Environment.CurrentDirectory + @"\MobiusServices.ini";
            }

            if (!FileUtil.Exists(IniFilePath) && ClientState.IsDeveloper)             // dev/debug
            {
                IniFilePath = @"C:\Mobius_OpenSource\MobiusClient\ServiceFacade\MobiusServicesDev.ini";
            }

            if (!FileUtil.Exists(IniFilePath))             // just return if not found
            {
                IniFilePath = null;
                return;
            }

            IniFile = new IniFile(IniFilePath, "Mobius");
            return;
        }
예제 #33
0
 /// <summary>
 /// Método necesario para admitir el Diseñador, no se puede modificar
 /// el contenido del método con el editor de código.
 /// </summary>
 private void InitializeComponent()
 {
     System.Configuration.AppSettingsReader configurationAppSettings = new System.Configuration.AppSettingsReader();
     this.oleDbDataAdapter1   = new System.Data.OleDb.OleDbDataAdapter();
     this.oleDbSelectCommand1 = new System.Data.OleDb.OleDbCommand();
     this.oleDbConnection1    = new System.Data.OleDb.OleDbConnection();
     this.datosInforme1       = new informe_1.datosInforme();
     ((System.ComponentModel.ISupportInitialize)(this.datosInforme1)).BeginInit();
     //
     // oleDbDataAdapter1
     //
     this.oleDbDataAdapter1.SelectCommand = this.oleDbSelectCommand1;
     this.oleDbDataAdapter1.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "Table", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("NOMBRE", "NOMBRE")
         })
     });
     //
     // oleDbSelectCommand1
     //
     this.oleDbSelectCommand1.CommandText = "SELECT \'\' AS NOMBRE FROM DUAL";
     this.oleDbSelectCommand1.Connection  = this.oleDbConnection1;
     //
     // oleDbConnection1
     //
     this.oleDbConnection1.ConnectionString = ((string)(configurationAppSettings.GetValue("cadenaConexion", typeof(string))));
     //
     // datosInforme1
     //
     this.datosInforme1.DataSetName = "datosInforme";
     this.datosInforme1.Locale      = new System.Globalization.CultureInfo("es-ES");
     this.datosInforme1.Namespace   = "http://www.tempuri.org/datosInforme.xsd";
     this.Load += new System.EventHandler(this.Page_Load);
     ((System.ComponentModel.ISupportInitialize)(this.datosInforme1)).EndInit();
 }
        public MaildirMessageRetrievalInterface()
        {
            string maildirPath;

            try
            {
                System.Configuration.AppSettingsReader settings = new System.Configuration.AppSettingsReader();
                maildirPath = (string)settings.GetValue("MaildirPath", typeof(string));
            }
            catch (InvalidOperationException)
            {
                throw new ApplicationException(
                    "Could not read MaildirPath from the configuration."
                    );
            }

            if (!Directory.Exists(maildirPath))
            {
                throw new ApplicationException(
                    "MaildirPath does not exist."
                    );
            }

            if (!Directory.Exists(Path.Combine(maildirPath, "new"))
                || !Directory.Exists(Path.Combine(maildirPath, "cur"))
               )
            {
                throw new ApplicationException(
                    "MaildirPath does not refer to a valid Maildir."
                    );
            }

            newDir = new DirectoryInfo(Path.Combine(maildirPath, "new"));
            curDir = new DirectoryInfo(Path.Combine(maildirPath, "cur"));
        }
예제 #35
0
 /// <summary>
 /// M�todo necesario para admitir el Dise�ador, no se puede modificar
 /// el contenido del m�todo con el editor de c�digo.
 /// </summary>
 private void InitializeComponent()
 {
     System.Configuration.AppSettingsReader configurationAppSettings = new System.Configuration.AppSettingsReader();
     this.oleDbDataAdapter1 = new System.Data.OleDb.OleDbDataAdapter();
     this.oleDbSelectCommand1 = new System.Data.OleDb.OleDbCommand();
     this.oleDbConnection1 = new System.Data.OleDb.OleDbConnection();
     this.datosInforme1 = new informe_1.datosInforme();
     ((System.ComponentModel.ISupportInitialize)(this.datosInforme1)).BeginInit();
     //
     // oleDbDataAdapter1
     //
     this.oleDbDataAdapter1.SelectCommand = this.oleDbSelectCommand1;
     this.oleDbDataAdapter1.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
                                                                                                 new System.Data.Common.DataTableMapping("Table", "Table", new System.Data.Common.DataColumnMapping[] {
                                                                                                                                                                                                          new System.Data.Common.DataColumnMapping("NOMBRE", "NOMBRE")})});
     //
     // oleDbSelectCommand1
     //
     this.oleDbSelectCommand1.CommandText = "SELECT \'\' AS NOMBRE FROM DUAL";
     this.oleDbSelectCommand1.Connection = this.oleDbConnection1;
     //
     // oleDbConnection1
     //
     this.oleDbConnection1.ConnectionString = ((string)(configurationAppSettings.GetValue("cadenaConexion", typeof(string))));
     //
     // datosInforme1
     //
     this.datosInforme1.DataSetName = "datosInforme";
     this.datosInforme1.Locale = new System.Globalization.CultureInfo("es-ES");
     this.datosInforme1.Namespace = "http://www.tempuri.org/datosInforme.xsd";
     this.Load += new System.EventHandler(this.Page_Load);
     ((System.ComponentModel.ISupportInitialize)(this.datosInforme1)).EndInit();
 }
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     System.Configuration.AppSettingsReader configurationAppSettings = new System.Configuration.AppSettingsReader();
     this.mwConnection   = new System.Data.SqlClient.SqlConnection();
     this.messageListBox = new System.Windows.Forms.ListBox();
     this.SuspendLayout();
     //
     // mwConnection
     //
     this.mwConnection.ConnectionString = ((string)(configurationAppSettings.GetValue("mwConnection.ConnectionString", typeof(string))));
     //
     // messageListBox
     //
     this.messageListBox.Dock                = System.Windows.Forms.DockStyle.Fill;
     this.messageListBox.ItemHeight          = 16;
     this.messageListBox.Location            = new System.Drawing.Point(0, 0);
     this.messageListBox.Name                = "messageListBox";
     this.messageListBox.ScrollAlwaysVisible = true;
     this.messageListBox.Size                = new System.Drawing.Size(979, 692);
     this.messageListBox.TabIndex            = 0;
     //
     // InteractiveChunkMonitor
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(6, 15);
     this.ClientSize        = new System.Drawing.Size(979, 698);
     this.Controls.Add(this.messageListBox);
     this.Name = "InteractiveChunkMonitor";
     this.Text = "InteractiveChunkMonitor";
     this.ResumeLayout(false);
 }
예제 #37
0
 /// <summary>
 /// Gets the application security context.
 /// </summary>
 /// <returns></returns>
 public ApplicationSecurityContext GetApplicationSecurityContext()
 {
     System.Configuration.AppSettingsReader appSettingsReader = new System.Configuration.AppSettingsReader();
     var appGuidstr = appSettingsReader.GetValue("gatekeeper-app-guid", typeof(string)) as string;
     var appGuid = new Guid(appGuidstr);
     return new ApplicationSecurityContext(appGuid);
 }
        public static int SeekUnitAlarmsQty(DataTable dtzone, int qty, int zoneId)
        {
            System.Configuration.AppSettingsReader appSettings = new System.Configuration.AppSettingsReader();
            string UNIT_ID = (string)appSettings.GetValue("GroupsChilds.UnitId", typeof(string));

            string swhere = "";

            CmpGroupsChildsGisDB cGroupChildsDb = new CmpGroupsChildsGisDB();
            CmpGroupsDB          cGroupsDb      = new CmpGroupsDB();

            foreach (DataRow dr in dtzone.Rows)
            {
                // If there is not a UNIT we follow deeping in the tree...(Level 2)
                if (dr["CGRPG_TYPE"].ToString() != UNIT_ID)
                {
                    swhere = "CGRPG_ID	= "+ dr["CGRPG_CHILD"].ToString();
                    DataTable dtsubzone = cGroupChildsDb.GetData(null, swhere, null, null);
                    qty = SeekUnitAlarmsQty(dtsubzone, qty, zoneId);
                }
                // if theres a unit let's get if he has an active alarm (or more)
                else
                {
                    swhere = "ALA_UNI_ID	= "+ dr["CGRPG_CHILD"].ToString();
                    DataTable dtAlarms = new CmpAlarmsDB().GetData(null, swhere, null, null);
                    if (dtAlarms.Rows.Count > 0)
                    {
                        qty++;
                    }
                }
            }
            return(qty);
        }
예제 #39
0
 public static string Encrypt(string text, bool useHash)
 {
     byte[] keyArray;
     byte[] toEcryptArray = UTF8Encoding.UTF8.GetBytes(text);
     System.Configuration.AppSettingsReader setingReader = new System.Configuration.AppSettingsReader();
     string key = (string)setingReader.GetValue("SecurityKey", typeof(string));
     if (useHash)
     {
         MD5CryptoServiceProvider hashMd5 = new MD5CryptoServiceProvider();
         keyArray = hashMd5.ComputeHash(UTF8Encoding.UTF8.GetBytes(key));
         hashMd5.Clear();
     }
     else
     {
         keyArray = UTF8Encoding.UTF8.GetBytes(key);
     }
     TripleDESCryptoServiceProvider crypto = new TripleDESCryptoServiceProvider();
     crypto.Key = keyArray;
     crypto.Mode = CipherMode.ECB;
     crypto.Padding = PaddingMode.PKCS7;
     ICryptoTransform transforme = crypto.CreateEncryptor();
     byte[] result = transforme.TransformFinalBlock(toEcryptArray, 0, toEcryptArray.Length);
     crypto.Clear();
     return Convert.ToBase64String(result, 0, result.Length);
 }
예제 #40
0
 /// <summary>
 /// Encrypts plaintext using AES 128bit key and a Chain Block Cipher and returns a base64 encoded string
 /// </summary>
 /// <param name="plainText">Plain text to encrypt</param>
 /// <param name="key">Secret key</param>
 /// <returns>Base64 encoded string</returns>
 public static String Encrypt(String plainText, string securityKey = "")
 {
     System.Configuration.AppSettingsReader settingsReader = new System.Configuration.AppSettingsReader();
     // Key web.config'den alınıyor
     string key = securityKey == "" ? (string)settingsReader.GetValue("SecurityKey", typeof(String)) : HttpUtility.UrlDecode(securityKey);
     var plainBytes = Encoding.UTF8.GetBytes(plainText);
     return Convert.ToBase64String(Encrypt(plainBytes, GetRijndaelManaged(key)));
 }
예제 #41
0
 public Conexion()
 {
     System.Configuration.AppSettingsReader config = new System.Configuration.AppSettingsReader();
     con = new SqlConnection();
     //Data Source=ANDROMEDA\SQL2008R2;Initial Catalog=BDSGCRM;User ID=sa;Password=sqlserver
     this.con.ConnectionString = (@"Data Source=ORION\SQL2008R2;Initial Catalog=TAXY_EMP;User ID=sa;Password=sqlserver");
     strCadena = this.con.ConnectionString;
 }
예제 #42
0
파일: DemoForm.cs 프로젝트: madhon/NetSpell
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     System.Configuration.AppSettingsReader configurationAppSettings = new System.Configuration.AppSettingsReader();
     this.spellButton = new System.Windows.Forms.Button();
     this.demoRichText = new System.Windows.Forms.RichTextBox();
     this.spelling = new NetSpell.SpellChecker.Spelling(this.components);
     this.wordDictionary = new NetSpell.SpellChecker.Dictionary.WordDictionary(this.components);
     this.SuspendLayout();
     //
     // spellButton
     //
     this.spellButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
     this.spellButton.Location = new System.Drawing.Point(344, 368);
     this.spellButton.Name = "spellButton";
     this.spellButton.Size = new System.Drawing.Size(80, 23);
     this.spellButton.TabIndex = 3;
     this.spellButton.Text = "Spell Check";
     this.spellButton.Click += new System.EventHandler(this.spellButton_Click);
     //
     // demoRichText
     //
     this.demoRichText.AcceptsTab = true;
     this.demoRichText.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
         | System.Windows.Forms.AnchorStyles.Left)
         | System.Windows.Forms.AnchorStyles.Right)));
     this.demoRichText.AutoWordSelection = true;
     this.demoRichText.Location = new System.Drawing.Point(16, 16);
     this.demoRichText.Name = "demoRichText";
     this.demoRichText.ShowSelectionMargin = true;
     this.demoRichText.Size = new System.Drawing.Size(408, 344);
     this.demoRichText.TabIndex = 2;
     this.demoRichText.Text = "Becuase people are realy bad spelers, ths produc was desinged to prevent speling " +
         "erors in a text area like ths.";
     //
     // spelling
     //
     this.spelling.Dictionary = this.wordDictionary;
     this.spelling.ReplacedWord += new NetSpell.SpellChecker.Spelling.ReplacedWordEventHandler(this.spelling_ReplacedWord);
     this.spelling.EndOfText += new NetSpell.SpellChecker.Spelling.EndOfTextEventHandler(this.spelling_EndOfText);
     this.spelling.DeletedWord += new NetSpell.SpellChecker.Spelling.DeletedWordEventHandler(this.spelling_DeletedWord);
     //
     // wordDictionary
     //
     this.wordDictionary.DictionaryFolder = ((string)(configurationAppSettings.GetValue("wordDictionary.DictionaryFolder", typeof(string))));
     //
     // DemoForm
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize = new System.Drawing.Size(440, 406);
     this.Controls.Add(this.spellButton);
     this.Controls.Add(this.demoRichText);
     this.Name = "DemoForm";
     this.Text = "NetSpell Demo";
     this.ResumeLayout(false);
 }
        // ////////////////////////////////////////////////////////////////////////
        // EVENTS
        //
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                // Security check
                if (!Convert.ToBoolean(Session["sgLFS_LABOUR_HOURS_FULL_EDITING"]))
                {
                    if (!Convert.ToBoolean(Session["sgLFS_LABOUR_HOURS_REPORTS"]))
                    {
                        Response.Redirect("./../../error_page.aspx?error=" + "You are not authorized to view this page. Contact your system administrator.");
                    }
                }

                // Initialize viewstate variables
                System.Configuration.AppSettingsReader appSettingReader = new System.Configuration.AppSettingsReader();
                ViewState["LHMode"] = appSettingReader.GetValue("LABOUR_HOURS_OPERATION_MODE", typeof(System.String)).ToString();

                // Tag page
                hdfCompanyId.Value = Convert.ToInt32(Session["companyID"]).ToString();

                // Databind
                ddlClient.DataBind();
                ddlProject.DataBind();

                // Prepare initial data
                ddlProjectTimeState.SelectedValue = "(All)";
                ddlClient.SelectedIndex = 0;
                ddlProject.SelectedIndex = 0;
                tkrdpStartDate.SelectedDate = DateTime.Now;
                tkrdpEndDate.SelectedDate = DateTime.Now;

                ProjectTimeWorkList projectTimeWorkList = new ProjectTimeWorkList(new DataSet());
                projectTimeWorkList.LoadAndAddItem("(All)");
                ddlTypeOfWork.DataSource = projectTimeWorkList.Table;
                ddlTypeOfWork.DataValueField = "Work_";
                ddlTypeOfWork.DataTextField = "Work_";
                ddlTypeOfWork.DataBind();
                ddlTypeOfWork.SelectedIndex = 0;

                ProjectTimeWorkFunctionList projectTimeWorkFunctionList = new ProjectTimeWorkFunctionList(new DataSet());
                projectTimeWorkFunctionList.LoadAndAddItem("(All)", "-1");
                ddlFunction.DataSource = projectTimeWorkFunctionList.Table;
                ddlFunction.DataValueField = "Function_";
                ddlFunction.DataTextField = "Function_";
                ddlFunction.DataBind();
                ddlFunction.SelectedIndex = 0;

                // Register delegates
                this.RegisterDelegates();
            }
            else
            {
                // Register delegates
                this.RegisterDelegates();
            }
        }
예제 #44
0
        public ClientTests()
        {
#if PORTABLE
            var appSettings = new System.Configuration.AppSettingsReader();
            _storeLocation = appSettings.GetValue("BrightstarDB.StoreLocation", typeof (string)) as string;
#else
            var appSettings = System.Configuration.ConfigurationManager.AppSettings;
            _storeLocation = appSettings.Get("BrightstarDB.StoreLocation");
#endif
        }
예제 #45
0
        public CCTerminal()
        {
            cc = new CardConsumer();

            System.Configuration.AppSettingsReader r = new System.Configuration.AppSettingsReader();
            string ip = (string)r.GetValue("CreditCardServiceIP", typeof(String));
            string port = (string)r.GetValue("CreditCardServicePort", typeof(String));

            cc.Bind(ip, port);
        }
예제 #46
0
 public static void Readfromfile()
 {
     System.Configuration.AppSettingsReader r = new System.Configuration.AppSettingsReader();
     string path = (string)r.GetValue("simulationsettings", typeof(String));
     var ser = new XmlSerializer(typeof(Sim));
     using (var ms = new StreamReader(path))
     {
         sim = (Sim)ser.Deserialize(ms);
         ms.Close();
     }
 }
예제 #47
0
        public static string ReadByKey(string key)
        {
            var reader = new System.Configuration.AppSettingsReader();
            var resultObject = reader.GetValue(key, typeof(string));
            if (resultObject == null)
            {
                throw new System.Exception("Không có key này trong DataConfig");
            }

            return resultObject.ToString();
        }
예제 #48
0
        protected void Application_Start()
        {
            // Run();
            // OnStart();
            System.Configuration.AppSettingsReader appReader = new System.Configuration.AppSettingsReader();//配置文件中取
            var isji = appReader.GetValue("IsJi", typeof(bool));
            Config.IsJi = Convert.ToBoolean(isji);
            AreaRegistration.RegisterAllAreas();

            RegisterRoutes(RouteTable.Routes);
        }
예제 #49
0
        FMSAxml SetupFMSAxml()
        {
            var asr = new System.Configuration.AppSettingsReader();

            var fms = new FMSAxml(
                theServer: (string)asr.GetValue("TestServerName", typeof(string)),
                theAccount: (string)asr.GetValue("TestServerUser", typeof(string)),
                thePort: (int)asr.GetValue("TestServerPort", typeof(int)),
                thePW: (string)asr.GetValue("TestServerPass", typeof(string))
                );
            return fms;
        }
예제 #50
0
        public static string SendMail3(string strTo, string strSubject, string strText, bool isBodyHtml, string smtpServer, string login, string password, string emailFrom)
        {
            string strResult;
            try
            {
                var emailClient = new System.Net.Mail.SmtpClient(smtpServer)
                    {
                        UseDefaultCredentials = false,
                        Credentials = new System.Net.NetworkCredential(login, password),
                        DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network
                    };
                string strMailList = string.Empty;
                string[] strMails = strTo.Split(';');
                foreach (string str in strMails)
                {
                    if ((str != null) && string.IsNullOrEmpty(str) == false)
                    {
                        strMailList += str + "; ";
                        var message = new System.Net.Mail.MailMessage(emailFrom, str, strSubject, strText) { IsBodyHtml = isBodyHtml };
                        emailClient.Send(message);

                    }
                }
                strMailList.TrimEnd(null);

                try
                {
                    var config = new System.Configuration.AppSettingsReader();
                    var cfgValue = (string)config.GetValue("MailDebug", typeof(System.String));
                    if (cfgValue != "")
                    {
                        strText += string.Format("   [SendList: {0}]", strMailList);
                        var message = new System.Net.Mail.MailMessage(emailFrom, "*****@*****.**", "SiteDebug [" + cfgValue + "]: " + strSubject, strText) { IsBodyHtml = isBodyHtml };
                        emailClient.Send(message);
                    }
                    else
                    {
                        strText += string.Format("   [SendList: {0}]", strMailList);
                        var message = new System.Net.Mail.MailMessage(emailFrom, "*****@*****.**", "SiteDebug: " + strSubject, strText) { IsBodyHtml = isBodyHtml };
                        emailClient.Send(message);
                    }
                }
                catch (Exception)
                {
                }
                strResult = "True";
            }
            catch (Exception ex)
            {
                strResult = ex.Message + " at SendMail";
            }
            return strResult;
        }
예제 #51
0
 public static string ReadString(string key)
 {
     try
     {
         System.Configuration.AppSettingsReader rd = new System.Configuration.AppSettingsReader();
         return rd.GetValue(key, typeof(String)).ToString();
     }
     catch
     {
         return string.Empty;
     }
 }
예제 #52
0
 public static void Persisttofile()
 {
     System.Configuration.AppSettingsReader r = new System.Configuration.AppSettingsReader();
     string path = (string)r.GetValue("simulationsettings", typeof(String));
     var ser = new XmlSerializer(typeof(Sim));
     using (var ms = new MemoryStream())
     {
         ser.Serialize(ms, sim);
         var bytes = ms.ToArray();
         System.IO.File.WriteAllBytes(path, bytes);
     }
 }
예제 #53
0
 /// <summary>
 /// M�todo necesario para admitir el Dise�ador, no se puede modificar
 /// el contenido del m�todo con el editor de c�digo.
 /// </summary>
 private void InitializeComponent()
 {
     System.Configuration.AppSettingsReader configurationAppSettings = new System.Configuration.AppSettingsReader();
     this.oleDbDataAdapter1 = new System.Data.OleDb.OleDbDataAdapter();
     this.oleDbSelectCommand1 = new System.Data.OleDb.OleDbCommand();
     this.oleDbConnection1 = new System.Data.OleDb.OleDbConnection();
     this.contrato1 = new reporte_contrato.contrato();
     ((System.ComponentModel.ISupportInitialize)(this.contrato1)).BeginInit();
     //
     // oleDbDataAdapter1
     //
     this.oleDbDataAdapter1.SelectCommand = this.oleDbSelectCommand1;
     this.oleDbDataAdapter1.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
                                                                                                 new System.Data.Common.DataTableMapping("Table", "contrato", new System.Data.Common.DataColumnMapping[] {
                                                                                                                                                                                                             new System.Data.Common.DataColumnMapping("NOMBRE_INSTITUCION", "NOMBRE_INSTITUCION"),
                                                                                                                                                                                                             new System.Data.Common.DataColumnMapping("RUT_INSTITUCION", "RUT_INSTITUCION"),
                                                                                                                                                                                                             new System.Data.Common.DataColumnMapping("RUT_POSTULANTE", "RUT_POSTULANTE"),
                                                                                                                                                                                                             new System.Data.Common.DataColumnMapping("EDAD", "EDAD"),
                                                                                                                                                                                                             new System.Data.Common.DataColumnMapping("NOMBRE_ALUMNO", "NOMBRE_ALUMNO"),
                                                                                                                                                                                                             new System.Data.Common.DataColumnMapping("CARRERA", "CARRERA"),
                                                                                                                                                                                                             new System.Data.Common.DataColumnMapping("RUT_CODEUDOR", "RUT_CODEUDOR"),
                                                                                                                                                                                                             new System.Data.Common.DataColumnMapping("NOMBRE_CODEUDOR", "NOMBRE_CODEUDOR"),
                                                                                                                                                                                                             new System.Data.Common.DataColumnMapping("DIRECCION", "DIRECCION"),
                                                                                                                                                                                                             new System.Data.Common.DataColumnMapping("CIUDAD", "CIUDAD"),
                                                                                                                                                                                                             new System.Data.Common.DataColumnMapping("COMUNA", "COMUNA"),
                                                                                                                                                                                                             new System.Data.Common.DataColumnMapping("TIPO_DOCUMENTO", "TIPO_DOCUMENTO"),
                                                                                                                                                                                                             new System.Data.Common.DataColumnMapping("DOCUMENTO", "DOCUMENTO"),
                                                                                                                                                                                                             new System.Data.Common.DataColumnMapping("NOMBRE_BANCO", "NOMBRE_BANCO"),
                                                                                                                                                                                                             new System.Data.Common.DataColumnMapping("VALOR_DOCTO", "VALOR_DOCTO"),
                                                                                                                                                                                                             new System.Data.Common.DataColumnMapping("FECHA_VENCIMIENTO", "FECHA_VENCIMIENTO"),
                                                                                                                                                                                                             new System.Data.Common.DataColumnMapping("TOTAL_M", "TOTAL_M"),
                                                                                                                                                                                                             new System.Data.Common.DataColumnMapping("TOTAL_A", "TOTAL_A")})});
     //
     // oleDbSelectCommand1
     //
     this.oleDbSelectCommand1.CommandText = @"SELECT '' AS NOMBRE_INSTITUCION, '' AS RUT_INSTITUCION, '' AS RUT_POSTULANTE, '' AS EDAD, '' AS NOMBRE_ALUMNO, '' AS CARRERA, '' AS RUT_CODEUDOR, '' AS NOMBRE_CODEUDOR, '' AS DIRECCION, '' AS CIUDAD, '' AS COMUNA, '' AS TIPO_DOCUMENTO, '' AS DOCUMENTO, '' AS NOMBRE_BANCO, '' AS VALOR_DOCTO, '' AS FECHA_VENCIMIENTO, '' AS TOTAL_M, '' AS TOTAL_A FROM DUAL";
     this.oleDbSelectCommand1.Connection = this.oleDbConnection1;
     //
     // oleDbConnection1
     //
     this.oleDbConnection1.ConnectionString = ((string)(configurationAppSettings.GetValue("cadenaConexion", typeof(string))));
     //
     // contrato1
     //
     this.contrato1.DataSetName = "contrato";
     this.contrato1.Locale = new System.Globalization.CultureInfo("es-ES");
     this.contrato1.Namespace = "http://www.tempuri.org/contrato.xsd";
     this.Load += new System.EventHandler(this.Page_Load);
     ((System.ComponentModel.ISupportInitialize)(this.contrato1)).EndInit();
 }
예제 #54
0
        public static int ReadInteger(string key)
        {
            System.Configuration.AppSettingsReader rd = new System.Configuration.AppSettingsReader();
            object value = rd.GetValue(key, typeof(int));

            if (value == null)
            {
                return 0;
            }
            else
            {
                return (int)(value);
            }
        }
예제 #55
0
파일: TestUtil.cs 프로젝트: ppXD/KoalaBlog
 public static void CleanUpData()
 {
     // Run the clean up script 
     System.Configuration.AppSettingsReader appReader = new System.Configuration.AppSettingsReader();
     string connStr = appReader.GetValue("KoalaBlog.ConnectionString", typeof(string)).ToString();
     SqlConnection conn = new SqlConnection(connStr);
     System.IO.StreamReader reader = new System.IO.StreamReader("../../../../SQL/cleanup.sql");
     string content = reader.ReadToEnd();
     SqlCommand cmd = new SqlCommand(content);
     cmd.CommandType = System.Data.CommandType.Text;
     cmd.Connection = conn;
     conn.Open();
     cmd.ExecuteNonQuery();
     conn.Close();
 }
예제 #56
0
 static AliyunHelper()
 {
     var value = new System.Configuration.AppSettingsReader().GetValue("aliyunAccessKey", typeof(String)) as string;
     if (value != null)
     {
         var arr = value.Split(new []{",", ";"}, StringSplitOptions.RemoveEmptyEntries);
         if (arr.Length > 1)
         {
             string id = arr[0], secret = arr[1];
             if (!String.IsNullOrWhiteSpace(id) && !String.IsNullOrWhiteSpace(secret))
             {
                 AliyunAccessKey = new AliyunAccessKey(id.Trim(), secret.Trim());
             }
         }
     }
 }
예제 #57
0
        public static string Decrypt(string cipherString, bool useHashing)
        {
            byte[] keyArray;
            //get the byte code of the string

            byte[] toEncryptArray = Convert.FromBase64String(cipherString);

            System.Configuration.AppSettingsReader settingsReader = new System.Configuration.AppSettingsReader();
            //Get your key from config file to open the lock!
            string key = (string)settingsReader.GetValue("SecurityKey", typeof(String));

            if (useHashing)
            {
                //if hashing was used get the hash code with regards to your key
                MD5CryptoServiceProvider hashmd5 = new MD5CryptoServiceProvider();
                keyArray = hashmd5.ComputeHash(UTF8Encoding.UTF8.GetBytes(key));
                //release any resource held by the MD5CryptoServiceProvider

                hashmd5.Clear();
            }
            else
            {
                //if hashing was not implemented get the byte code of the key
                keyArray = UTF8Encoding.UTF8.GetBytes(key);
            }

            TripleDESCryptoServiceProvider tdes = new TripleDESCryptoServiceProvider();
            //set the secret key for the tripleDES algorithm
            tdes.Key = keyArray;
            //mode of operation. there are other 4 modes.
            //We choose ECB(Electronic code Book)

            tdes.Mode = CipherMode.ECB;
            //padding mode(if any extra byte added)
            tdes.Padding = PaddingMode.PKCS7;

            ICryptoTransform cTransform = tdes.CreateDecryptor();
            byte[] resultArray = cTransform.TransformFinalBlock(
                                 toEncryptArray, 0, toEncryptArray.Length);
            //Release resources held by TripleDes Encryptor
            tdes.Clear();
            //return the Clear decrypted TEXT
            return UTF8Encoding.UTF8.GetString(resultArray);
        }
        public AmazonSQSMessageRetrievalInterface()
        {
            string awsAccessKeyId, awsSecretAccessKey;
            try
            {
                System.Configuration.AppSettingsReader settings = new System.Configuration.AppSettingsReader();
                awsAccessKeyId = (string)settings.GetValue("AwsAccessKeyId", typeof(string));
                awsSecretAccessKey = (string)settings.GetValue("AwsSecretAccessKey", typeof(string));
                queueUrl = (string)settings.GetValue("QueueUrl", typeof(string));
            }
            catch (InvalidOperationException)
            {
                throw new ApplicationException(
                    "Could not read AwsAccessKeyId or AwsSecretAccessKey from the configuration."
                    );
            }

            sqs = new AmazonSQSClient(awsAccessKeyId, awsSecretAccessKey);
        }
        public DataTable ExcelToDataTable(string excelFileName)
        {
            System.Configuration.AppSettingsReader app = new System.Configuration.AppSettingsReader();
            String provider = (String)app.GetValue("Provider", typeof(String));
            String extProperties = (String)app.GetValue("Extended Properties", typeof(String));
            
            string connString = "Provider=" + provider + ";Data Source=" + excelFileName + ";Extended Properties='" + extProperties + "'";

            DataTable dtExceldata = new DataTable();

            try
            {
                OleDbCommand excelCommand = new OleDbCommand();
                OleDbDataAdapter excelDataAdapter = new OleDbDataAdapter();

                using (OleDbConnection excelConn = new OleDbConnection(connString))
                {
                    excelConn.Open();

                    String sheetName = "";

                    DataTable dtExcelSheets = new DataTable();
                    dtExcelSheets = excelConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
                    if (dtExcelSheets.Rows.Count > 0)
                    {
                        sheetName = dtExcelSheets.Rows[0]["TABLE_NAME"].ToString();
                    }
                    OleDbCommand OleCmdSelect = new OleDbCommand("SELECT * FROM [" + sheetName + "]", excelConn);
                    OleDbDataAdapter OleAdapter = new OleDbDataAdapter(OleCmdSelect);

                    OleAdapter.FillSchema(dtExceldata, System.Data.SchemaType.Source);
                    OleAdapter.Fill(dtExceldata);
                    excelConn.Close();
                }

                return dtExceldata;
            }
            catch (Exception ex)
            {
                return null;
            }
        }
예제 #60
0
		public Publisher()
		{
			_subscribers = new Hashtable();
			fsw = new FileSystemWatcher();
			System.Configuration.AppSettingsReader configurationAppSettings = new System.Configuration.AppSettingsReader();
			string folderWatch =  ((string)(configurationAppSettings.GetValue("Publish.PublishFolder", typeof(string))));
			try
			{
				fsw = new System.IO.FileSystemWatcher(folderWatch);
			}
			catch
			{
				throw new Exception("Directory '" + folderWatch + "' referenced does not exist. " +
					"Change the fileName variable or create this directory in order to run this demo.");
			}
			fsw.Filter = "*.txt";
			fsw.Created += new FileSystemEventHandler(fsw_Created);
			fsw.Changed += new FileSystemEventHandler(fsw_Created);
			fsw.EnableRaisingEvents = true;
		}