private void btnBackup_Click(object sender, EventArgs e)
        {
            if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    string path = String.Format("{0}\\{1}PharmaInventory{2:MMMddyyyy}.bak", folderBrowserDialog1.SelectedPath, GeneralInfo.Current.HospitalName, DateTimeHelper.ServerDateTime);

                    string connectionString = readApp.GetValue("dbConnection", typeof(string)).ToString();

                    System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection(connectionString);
                    System.Data.SqlClient.SqlCommand com = new System.Data.SqlClient.SqlCommand();

                    if (!(conn.State == ConnectionState.Open))
                        conn.Open();
                    string dbName = conn.Database;
                    com.CommandText = "BACKUP DATABASE [" + dbName + "] TO  DISK = N'" + path + "' WITH NOFORMAT, NOINIT,  NAME = N'PharmaInventory" + DateTimeHelper.ServerDateTime.ToString("MMMddyyyy") + "-Full Database Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10";
                    com.Connection = conn;
                    com.ExecuteNonQuery();

                    GeneralInfo.Current.LastBackUp = DateTimeHelper.ServerDateTime;
                    GeneralInfo.Current.Save();
                    MessageBox.Show(@"Backup completed to " + path + @"!", @"Completed", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                catch
                {
                    MessageBox.Show(@"Backup has failed! Please Try Again.",@"Try Again",MessageBoxButtons.OK,MessageBoxIcon.Error);
                }
            }
        }
Ejemplo n.º 2
0
        protected void ExecutionConfirmed(object sender, EventArgs e)
        {
            panelMain.Visible = true;
            confirmPanel.Visible = false;

            System.ServiceProcess.ServiceController sc = new System.ServiceProcess.ServiceController("EOBProcessing");

            try
            {
                sc.Stop();
                System.Threading.Thread.Sleep(5000);

                dbProcedures db = new dbProcedures();
                System.Data.SqlClient.SqlCommand sqlCmd = new System.Data.SqlClient.SqlCommand("usp_AddOneTimeRunSchedule", new db().SqlConnection);
                sqlCmd.CommandType = System.Data.CommandType.StoredProcedure;

                sqlCmd.ExecuteNonQuery();
                db.Close();

                sc.Start();
                lblMessage.Text = "EOB System manual execution started.";

            }
            catch (Exception e1)
            {
                lblMessage.Text = "Failed to manually start EOB System service." + e1.Message();
            }
        }
 private void InitClass(int id, int groupID)
 {
     this.RoleID = id;
     this.GroupID = groupID;
     using (System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings[Configuration.ConnectionStringName].ConnectionString))
     {
         using (System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand("SELECT * FROM Authorization_RoleToControlGroup WHERE RoleID=@role AND GroupID=@group", conn))
         {
             try
             {
                 conn.Open();
                 cmd.Parameters.AddWithValue("@role", id);
                 cmd.Parameters.AddWithValue("@group", groupID);
                 System.Data.SqlClient.SqlDataReader reader = cmd.ExecuteReader();
                 while (reader.Read())
                     this.id = reader.GetInt32(0);
             }
             catch (Exception ex)
             {
                 if (Configuration.s_log != null)
                     Configuration.s_log.Error("[Ошибка модуля авторизации] [Инициализация класса роли группы элементов управления] ", ex);
             }
         }
     }
 }
Ejemplo n.º 4
0
        public static void Simulate车辆作业(车辆作业 车辆作业)
        {
            if (!车辆作业.Track.HasValue)
                System.Console.WriteLine("There is no track.");

            var sql = new System.Data.SqlClient.SqlCommand("DELETE FROM 业务作业_监控状态 WHERE 车辆作业 = @车辆作业");
            sql.Parameters.AddWithValue("@车辆作业", 车辆作业.Id);
            Feng.Data.DbHelper.Instance.ExecuteNonQuery(sql);

            sql = new System.Data.SqlClient.SqlCommand("DELETE FROM 业务作业_作业异常情况 WHERE 车辆作业 = @车辆作业");
            sql.Parameters.AddWithValue("@车辆作业", 车辆作业.Id);
            Feng.Data.DbHelper.Instance.ExecuteNonQuery(sql);

            var trackId = 车辆作业.Track.Value;

            DBDataBuffer.Instance.LoadData();
            //NameValueMappingCollection.Instance.Reload();

            SimulateTrack(trackId, (trackPoint) =>
                {
                    using (IRepository rep = ServiceProvider.GetService<IRepositoryFactory>().GenerateRepository<车辆作业>())
                    {
                        bool b = m_作业监控Dao.更新作业监控状态(rep, 车辆作业, trackPoint);
                    }
                });
        }
Ejemplo n.º 5
0
        public void SqlServerInsertQuery_ShouldGenQuery()
        {
            // Arrange
            var command = new System.Data.SqlClient.SqlCommand();
            ColumnMapCollection columns = MapRepository.Instance.GetColumns(typeof(Person));
            MappingHelper mappingHelper = new MappingHelper(command);

            Person person = new Person();
            person.ID = 1;
            person.Name = "Jordan";
            person.Age = 33;
            person.IsHappy = true;
            person.BirthDate = new DateTime(1977, 1, 22);

            mappingHelper.CreateParameters<Person>(person, columns, false, true);

            IQuery query = new SqlServerInsertQuery(columns, command, "dbo.People");

            // Act
            string queryText = query.Generate();

            // Assert
            Assert.IsNotNull(queryText);
            Assert.IsTrue(queryText.Contains("INSERT INTO dbo.People"));
            Assert.IsFalse(queryText.Contains("[ID]"), "Should not contain [ID] column since it is marked as AutoIncrement");
            Assert.IsTrue(queryText.Contains("[Name]"), "Should contain the name column");
        }
        public SystemRole(int baseID, int actionGroup = 0)
        {

            using (System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings[Ekzo.Web.Configuration.UsersStringName].ConnectionString))
            {
                using (System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand("SELECT group_name FROM groups WHERE group_id=@id", conn))
                {
                    try
                    {
                        conn.Open();
                        cmd.Parameters.AddWithValue("@id", baseID);
                        System.Data.SqlClient.SqlDataReader reader = cmd.ExecuteReader();
                        while (reader.Read())
                            this.Role = reader.GetString(0);
                        this.baseID = baseID;
                        this.ActionGroup = actionGroup;
                    }
                    catch (Exception ex)
                    {
                        if (Configuration.s_log != null)
                            Configuration.s_log.Error("[Ошибка модуля авторизации] [Инициализация роли из справочника] ", ex);
                    }
                }
            }
        }
Ejemplo n.º 7
0
 // Занесение новой записи в БД
 public static bool Insert(System.Data.SqlClient.SqlConnection connection, System.Data.DataRow row, out string message)
 {
     bool done = false;
     message = "";
     try{
         connection.Open();
         System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand();
         string sQuery = "INSERT INTO " + Maker.Table + "\n" +
                         "       (MakerID, Name, MakerCategory, Vendor, Address, Created, Updated)\n" +
                         "VALUES (@MakerID, @Name, @MakerCategory, @Vendor, @Address, GETDATE(), GETDATE())";
         cmd.Parameters.AddWithValue("@MakerID", row["MakerID"]);
         cmd.Parameters.AddWithValue("@Name", row["Name"]);
         cmd.Parameters.AddWithValue("@MakerCategory", row["MakerCategory"]);
         cmd.Parameters.AddWithValue("@Vendor", row["Vendor"]);
         cmd.Parameters.AddWithValue("@Address", row["Address"]);
         //cmd.Parameters.AddWithValue("@Created", row["Created"]);
         //cmd.Parameters.AddWithValue("@Updated", row["Updated"]);
         cmd.Connection = connection;
         cmd.CommandTimeout = 0;
         cmd.CommandType = System.Data.CommandType.Text;
         cmd.CommandText = sQuery;
         cmd.ExecuteNonQuery();
         connection.Close();
         done = true;
     }catch (System.Exception ex){
         message = ex.Message;
     }finally{
         if (connection.State == System.Data.ConnectionState.Open) connection.Close();
     }
     return done;
 }
        public static int GetUserId(System.Web.HttpContext HttpContext)
        {
            int result = 0;
            try
            {
                
                using (System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection(connString))
                {
                    using (System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand("SELECT employee_id FROM employee WHERE login LIKE @name", conn))
                    {
                        try
                        {
                            conn.Open();
                            cmd.Parameters.AddWithValue("@name", HttpContext.User.Identity.Name.Remove(0,3));
                            System.Data.SqlClient.SqlDataReader reader = cmd.ExecuteReader();
                            while (reader.Read())
                                result = reader.GetInt32(0);
                        }
                        catch (Exception ex)
                        {

                        }
                    }
                }
                return result;
            }
            catch (Exception ex)
            {
                AuthLib.Core.Logging.WriteEntry("Ошибка при получении идентификатора пользователя", ex);
                throw new Exception("Ошибка при получении идентификатора пользователя", ex);
            }
        }
Ejemplo n.º 9
0
        public void darDeBaja()
        {
            Conexion conn = Conexion.Instance;
            StringBuilder sentence = new StringBuilder().AppendFormat("SELECT C.UserId FROM TRANSA_SQL.Customer C WHERE C.PhoneNumber={0}", currentRow.Cells["Telefono"].Value.ToString());
            int userId = (int)conn.ejecutarQuery(sentence.ToString()).Rows[0][0];

            StringBuilder sentence2 = new StringBuilder().AppendFormat("SELECT CU.Deleted FROM TRANSA_SQL.CuponeteUser CU WHERE CU.UserId={0}", userId);
            bool deleted = (bool)conn.ejecutarQuery(sentence2.ToString()).Rows[0][0];

            if (deleted)
            {
                MessageBox.Show("El cliente ya se encontraba dado de baja");
            }
            else
            {
                System.Data.SqlClient.SqlCommand comando1 = new System.Data.SqlClient.SqlCommand();
                comando1.CommandType = CommandType.StoredProcedure;

                comando1.Parameters.Add("@UserId", SqlDbType.Int);
                comando1.Parameters[0].Value = userId;

                comando1.CommandText = "TRANSA_SQL.eliminarCliente";
                conn.ejecutarQueryConSP(comando1);

                MessageBox.Show("El cliente ha sido dado de baja con exito");
            }
        }
Ejemplo n.º 10
0
        public static blc.Grupo obtenerGrupo(string nombreGrupo, string codigoGrupo)
        {
            blc.Grupo grupo = new blc.Grupo();
            System.Data.SqlClient.SqlCommand Comando;
            System.Data.SqlClient.SqlDataReader DataReader;
            string query = "SELECT * FROM Grupo WHERE Nombre = '" + nombreGrupo + "' OR Codigo = '" + codigoGrupo + "'";

            Comando = new System.Data.SqlClient.SqlCommand(query);
            Comando.Connection = Program.dt.Connecion;
            Comando.Connection.Open();
            DataReader = Comando.ExecuteReader();

            while (DataReader.Read())
            {
                grupo.Codigo = (int)DataReader.GetValue(0);
                grupo.Nombre = DataReader.GetValue(1).ToString();
                grupo.PermisoGestion = DataReader.GetValue(2).ToString();
                grupo.PermisoCasos = DataReader.GetValue(3).ToString();
                grupo.PermisoClientes = DataReader.GetValue(4).ToString();
                grupo.PermisoTestigos = DataReader.GetValue(5).ToString();
                grupo.PermisoInventario = DataReader.GetValue(6).ToString();
                grupo.PermisoEvidencia = DataReader.GetValue(7).ToString();
                grupo.PermisoReportes = DataReader.GetValue(8).ToString();
                grupo.PermisoConfiguracion = DataReader.GetValue(9).ToString();
            }

            DataReader.Close();
            Comando.Connection.Close();
            return grupo;
        }
       public static bool AddGroup(string intranetGroupName)
        {
            try
            {
                int groupID = 0;
                //Получаем идентификатор группы
                using (System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection(connString))
                {
                    using (System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand("INSERT INTO groups(group_id,group_name) VALUES((SELECT MIN(group_id)-1 FROM groups WHERE id>-1000), @name)", conn))
                    {
                        try
                        {
                            conn.Open();
                            cmd.Parameters.AddWithValue("@name", intranetGroupName);
                            cmd.ExecuteNonQuery();
                        }
                        catch (Exception ex)
                        {

                        }
                    }
                }
                return true;
            }
            catch (Exception ex)
            {
                Core.Logging.WriteEntry("Ошибка добавления группы.", ex, 1);
                return false;
            }
        }
        public static string[] GetGroupUsers(string intranetGroup)
        {
            List<string> result = new List<string>();
            try
            {
                
                using (System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection(connString))
                {
                    using (System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand(@"SELECT employee.employee_name FROM groups INNER JOIN employee2group ON 
                                                                                                        groups.group_id=employee2group.group_id INNER JOIN
                                                                                                        employee ON employee2group.employee_id=employee.employee_id
                                                                                                        WHERE group_name=@name ORDER BY employee.employee_name", conn))
                    {
                        try
                        {
                            conn.Open();
                            cmd.Parameters.AddWithValue("@name",intranetGroup);
                            System.Data.SqlClient.SqlDataReader reader = cmd.ExecuteReader();
                            while(reader.Read())
                                result.Add(reader.GetString(0));
                        }
                        catch (Exception ex)
                        {

                        }
                    }
                }
                return result.ToArray();
            }
            catch (Exception ex)
            {
                AuthLib.Core.Logging.WriteEntry("Ошибка получения списка пользователей в роли.",ex);
                throw new Exception("Ошибка получения списка пользователей в роли.", ex);
            }
        }
Ejemplo n.º 13
0
        public static System.Data.SqlClient.SqlCommand ByProductTypes(Guid receipt_id, out string display_member, out string value_member)
        {
            display_member = "Name";
            value_member = "Spent";

            System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand();
            string where = "";
            if (receipt_id != Guid.Empty)
            {
                where = " WHERE rc.ReceiptID = @ReceiptID\n";
                cmd.Parameters.AddWithValue("@ReceiptID", receipt_id);
            }
            string query = "SELECT pt.Name, SUM(rc.Price * (1.0 - rc.Discount) * rc.Amount) AS Spent\n" +
                           "  FROM Purchases.ReceiptContents AS rc\n" +
                           "  JOIN Producer.Products AS p\n" +
                           "    ON p.ProductID = rc.ProductID\n" +
                           "  JOIN Producer.ProductTypes AS pt\n" +
                           "    ON pt.Category = p.Category AND\n" +
                           "       pt.TypeId = p.[Type]\n" +
                           where +
                           " GROUP BY pt.Name\n" +
                           " ORDER BY 2 DESC";
            cmd.CommandTimeout = 0;
            cmd.CommandType = System.Data.CommandType.Text;
            cmd.CommandText = query;
            return cmd;
        }
Ejemplo n.º 14
0
    private System.Data.DataRow GetParameter(string IDParametro, int? IDPortal, int? IDSistema, string IDUsuario)
    {
      // Aca se lee la informacion de la base de datos
      // y se preparan los layers
      string connStr = ValidacionSeguridad.Instance.GetSecurityConnectionString();
      System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection(connStr);
      conn.Open();

      System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand
        ("SELECT * FROM dbo.SF_VALOR_PARAMETRO(@IDParametro, @IDPortal, @IDSistema, @IDUsuario)", conn);

      System.Data.SqlClient.SqlParameter prm = new System.Data.SqlClient.SqlParameter("@IDParametro", System.Data.SqlDbType.VarChar, 100);
      prm.Value = IDParametro;
      cmd.Parameters.Add(prm);

      prm = new System.Data.SqlClient.SqlParameter("@IDPortal", System.Data.SqlDbType.Int);
      if (IDPortal.HasValue)
      {
        prm.Value = IDPortal.Value;
      }
      else
      {
        prm.Value = null;
      }
      cmd.Parameters.Add(prm);

      prm = new System.Data.SqlClient.SqlParameter("@IDSistema", System.Data.SqlDbType.Int);
      if (IDSistema.HasValue)
      {
        prm.Value = IDSistema.Value;
      }
      else
      {
        prm.Value = null;
      }
      cmd.Parameters.Add(prm);

      prm = new System.Data.SqlClient.SqlParameter("@IDUsuario", System.Data.SqlDbType.VarChar);
      if (IDUsuario != null)
      {
        prm.Value = IDUsuario;
      }
      else
      {
        prm.Value = null;
      }
      cmd.Parameters.Add(prm);

      //     IdParametro, Alcance, ValorTexto, ValorEntero, ValorDecimal, ValorLogico, ValorFechaHora
      cmd.CommandType = System.Data.CommandType.Text;
      System.Data.SqlClient.SqlDataAdapter da = new System.Data.SqlClient.SqlDataAdapter(cmd);

      System.Data.DataSet ds = new System.Data.DataSet();
      da.Fill(ds);

      conn.Close();

      return ds.Tables[0].Rows[0];
      //return resultado;
    }
Ejemplo n.º 15
0
        public static blc.Caso obtenerCaso(string num)
        {
            blc.Caso caso = new blc.Caso();
            System.Data.SqlClient.SqlCommand Comando;
            System.Data.SqlClient.SqlDataReader DataReader;
            string query = "SELECT * FROM Caso WHERE numAccion = '" + num + "'";

            Comando = new System.Data.SqlClient.SqlCommand(query);
            Comando.Connection = Program.dt.Connecion;
            Comando.Connection.Open();
            DataReader = Comando.ExecuteReader();

            while (DataReader.Read())
            {
                caso.NumAccion = DataReader.GetValue(0).ToString();
                caso.Accion = DataReader.GetValue(1).ToString();
                caso.Materia = DataReader.GetValue(2).ToString();
                caso.Oficina = DataReader.GetValue(3).ToString();
                caso.Cliente.ID = DataReader.GetValue(4).ToString();
                caso.Observaciones = DataReader.GetValue(6).ToString();
            }
            DataReader.Close();
            Comando.Connection.Close();
            return caso;
        }
Ejemplo n.º 16
0
 private void CbBackups_DropDown_1(object sender, EventArgs e)
 {
     using (var connection = new System.Data.SqlClient.SqlConnection(string.Format("Server={0};Database={1};Trusted_Connection=True;", TxtLocalBkp.Text, TxtDataBase.Text)))
     {
         connection.Open();
         using (var command = new System.Data.SqlClient.SqlCommand(
             "SELECT physical_device_name FROM msdb.dbo.backupmediafamily " +
             "INNER JOIN msdb.dbo.backupset ON msdb.dbo.backupmediafamily.media_set_id = msdb.dbo.backupset.media_set_id " +
             "WHERE (msdb.dbo.backupset.database_name LIKE @DatabaseName)", connection))
         {
             command.Parameters.AddWithValue("DatabaseName", TxtDataBase.Text);
             using (var reader = command.ExecuteReader())
             {
                 var table = new DataTable();
                 table.Load(reader);
                 table.Columns.Add("FriendlyName");
                 foreach (DataRow row in table.Rows)
                 {
                     row["FriendlyName"] = System.IO.Path.GetFileName(row["physical_device_name"].ToString());
                 }
                 if (CbBackups.DataSource != null && CbBackups.DataSource is DataTable)
                 {
                     var oldTable = ((DataTable)CbBackups.DataSource);
                     CbBackups.DataSource = null;
                     oldTable.Dispose();
                 }
                 CbBackups.DataSource = table;
                 CbBackups.DisplayMember = "FriendlyName";
                 CbBackups.ValueMember = "physical_device_name";
             }
         }
     }
 }
Ejemplo n.º 17
0
        public static System.Data.SqlClient.SqlCommand ByBuyer(Guid receipt_id, out string display_member, out string value_member)
        {
            display_member = "UserFullName";
            value_member = "Spent";

            System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand();
            string where = "";
            if (receipt_id != Guid.Empty)
            {
                where = " WHERE rc.ReceiptID = @ReceiptID\n";
                cmd.Parameters.AddWithValue("@ReceiptID", receipt_id);
            }
            string query = "SELECT u.Surname + ' ' + SUBSTRING(u.Name, 1,1) + '. ' +\n" +
                           "       SUBSTRING(u.SecondName, 1,1) + '.' AS UserFullName,\n" +
                           "       SUM(rc.Price * (1.0 - rc.Discount) * rc.Amount) AS Spent\n" +
                           "  FROM Purchases.ReceiptContents AS rc\n" +
                           "  JOIN Persons.Users AS u\n" +
                           "    ON u.UserID = rc.Buyer\n" +
                           where +
                           " GROUP BY u.Surname + ' ' + SUBSTRING(u.Name, 1,1) + '. ' +\n" +
                           "       SUBSTRING(u.SecondName, 1,1) + '.'\n" +
                           " ORDER BY 2 DESC";
            cmd.CommandTimeout = 0;
            cmd.CommandType = System.Data.CommandType.Text;
            cmd.CommandText = query;
            return cmd;
        }
Ejemplo n.º 18
0
        private void DoallThetracking(string trackkey, string value)
        {
            System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection();
            conn.ConnectionString = "Server=devrystudentsp10.db.6077598.hostedresource.com;User Id=DeVryStudentSP10;Password=OidLZqBv4;";
            conn.Open();
            // Console.WriteLine(conn.State);
            System.Data.SqlClient.SqlCommand comm = new System.Data.SqlClient.SqlCommand();
            comm.Connection = conn;

            string SQL = "insert into huber_tracker12 (usertrackerid, trackkey, value,trackwhen) values (NEWID(), @trackkey, @trackvalue, @trackwhen)";

            comm.CommandText = SQL;

            comm.Parameters.AddWithValue("@trackkey", trackkey);
            comm.Parameters.AddWithValue("@trackvalue", value);
            comm.Parameters.AddWithValue("@trackwhen", DateTime.Now);

            comm.ExecuteNonQuery();

            SQL = "delete from huber_tracker12 where usertrackerid not in (select top 300 usertrackerid from huber_tracker12 order by trackwhen desc)";
                comm.CommandText = SQL;
            comm.ExecuteNonQuery();

            conn.Close();
        }
Ejemplo n.º 19
0
        public void crearRol(string nombre, List<string> permisos)
        {
            StringBuilder getLastRoleId = new StringBuilder().AppendFormat("SELECT R.RoleId FROM TRANSA_SQL.Role R ORDER BY R.RoleId DESC", nombre);
            int roleId = (int)(Conexion.Instance.ejecutarQuery(getLastRoleId.ToString()).Rows[0][0]) + 1;

            StringBuilder sentence1 = new StringBuilder().AppendFormat("INSERT INTO TRANSA_SQL.Role(RoleId, Name, Enabled) VALUES ({0},'{1}',2)",roleId, nombre);
            Conexion.Instance.ejecutarQuery(sentence1.ToString());

            System.Data.SqlClient.SqlCommand comando1 = new System.Data.SqlClient.SqlCommand();
            comando1.CommandType = CommandType.StoredProcedure;

            comando1.Parameters.Add("@RoleId", SqlDbType.Int);
            comando1.Parameters.Add("@PermissionId", SqlDbType.Int);

            comando1.Parameters[0].Value = roleId;

            StringBuilder sentence4;
            comando1.CommandText = "TRANSA_SQL.agregarRolePermission";

            foreach (string permiso in permisos)
            {
                sentence4 = new StringBuilder().AppendFormat("SELECT P.PermissionId FROM TRANSA_SQL.Permission P WHERE P.Name='{0}'", permiso);
                comando1.Parameters[1].Value = (int)Conexion.Instance.ejecutarQuery(sentence4.ToString()).Rows[0][0];
                Conexion.Instance.ejecutarQueryConSP(comando1);
            }
        }
Ejemplo n.º 20
0
 public Home()
 {
     this.WebConfig = System.Configuration.ConfigurationManager.AppSettings["Setting"];
     this.Build = System.Configuration.ConfigurationManager.AppSettings["Build"];
     this.Version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(4);
     bool executeDB = false;
     #if AZURE
     this.WebRoleConfig = Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.GetConfigurationSettingValue("Environment");
     executeDB = Convert.ToBoolean(Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.GetConfigurationSettingValue("executeDB"));
     #else
     executeDB = Convert.ToBoolean(System.Configuration.ConfigurationManager.AppSettings["ExecuteDB"]);
     #endif
     string conn;
     #if AZURE
     conn = Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.GetConfigurationSettingValue("DBConn");
     #else
     conn = System.Configuration.ConfigurationManager.ConnectionStrings["DBConn"].ToString(); ;
     #endif
     if (executeDB)
     {
         var cn = new System.Data.SqlClient.SqlConnection(conn);
         cn.Open();
         var cmd = new System.Data.SqlClient.SqlCommand("SELECT TOP 1 Col1 FROM Items", cn);
         this.DatabaseValue = cmd.ExecuteScalar().ToString();
         cn.Close();
     }
 }
Ejemplo n.º 21
0
        /// <summary>
        /// �������� ������ � �� � ���������� �����
        /// </summary>
        /// <param name="connection">��������� � ��</param>
        /// <param name="row">������</param>
        /// <param name="message">�������� ��������� �� ������, ���� ����� ���������� ����</param>
        /// <returns>����� ���������� ������, ���� �� �������� ������; ���� - � ��������� ������</returns>
        public static bool Delete(System.Data.SqlClient.SqlConnection connection, System.Data.DataRow row, /*byte[] image,*/ out string message)
        {
            bool done = false;
            message = "";
            try{
                connection.Open();
                System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand();
                string sQuery = "IF EXISTS (SELECT DiscountCard\n" +
                                "             FROM Purchases.Receipts\n" +
                                "            WHERE Purchases.Receipts.DiscountCard = @CardID ) \n" +
                                "   UPDATE Purchases.DiscountCards\n" +
                                "      SET Expired = GETDATE()\n" +
                                "    WHERE CardID = @CardID\n" +
                                "ELSE\n" +
                                "   DELETE\n" +
                                "     FROM Purchases.DiscountCards\n" +
                                "    WHERE CardID = @CardID";

                cmd.Parameters.AddWithValue("@CardID", row["CardID"]);
                cmd.Connection = connection;
                cmd.CommandTimeout = 0;
                cmd.CommandType = System.Data.CommandType.Text;
                cmd.CommandText = sQuery;
                cmd.ExecuteNonQuery();
                connection.Close();
                done = true;
            }catch (System.Exception ex){
                message = ex.Message;
            }finally{
                if (connection.State == System.Data.ConnectionState.Open) connection.Close();
            }
            return done;
        }
Ejemplo n.º 22
0
 public static System.Data.SqlClient.SqlCommand InsertCommand( System.Data.DataRow row )
 {
     System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand();
     string sQuery = "INSERT INTO Purchases.Receipts\n" +
                     "           (ReceiptID, Paid, Price, Discount, DiscountCard, Comment, Vendor,\n" +
                     "            Deleted, Number, Created, Updated)\n" +
                     "VALUES (@Receipt, @Paid, @Price, @Discount, @DiscountCard, @Comment, @Vendor,\n" +
                     "        @Deleted, @Number, @Created, @Updated);"; //\n" +
     //                            "SELECT @ReceiptID = SCOPE_IDENTITY()";
     if (row != null)
     {
         cmd.Parameters.AddWithValue("@Receipt", row["ReceiptID"]);
         cmd.Parameters.AddWithValue("@Paid", row["Paid"]);
         cmd.Parameters.AddWithValue("@Price", row["Price"]);
         cmd.Parameters.AddWithValue("@Discount", row["Discount"]);
         cmd.Parameters.AddWithValue("@DiscountCard", row["DiscountCard"]);
         cmd.Parameters.AddWithValue("@Comment", row["Comment"]);
         cmd.Parameters.AddWithValue("@Vendor", row["Vendor"]);
         cmd.Parameters.AddWithValue("@Deleted", row["Deleted"]);
         cmd.Parameters.AddWithValue("@Number", row["Number"]);
         cmd.Parameters.AddWithValue("@Created", row["Created"]);
         cmd.Parameters.AddWithValue("@Updated", row["Updated"]);
     }
     else
     {
         cmd = Receipt.AddParameters(cmd);
     }
     cmd.CommandTimeout = 0;
     cmd.CommandType = System.Data.CommandType.Text;
     cmd.CommandText = sQuery;
     return cmd;
 }
Ejemplo n.º 23
0
        public DataTable listar(int semestre, int anio)
        {
            Conexion cnn = Conexion.Instance;

               System.Data.SqlClient.SqlCommand comando1 = new System.Data.SqlClient.SqlCommand();

               comando1.CommandType = CommandType.StoredProcedure;
               int contador = 0;

               comando1.Parameters.Add("@semestre", SqlDbType.Int);
               comando1.Parameters[contador].Value = semestre;
               contador++;

               comando1.Parameters.Add("@anio", SqlDbType.Int);
               comando1.Parameters[contador].Value = anio;
               contador++;

               comando1.CommandText = "TRANSA_SQL.listarTop5Dev";

               DataTable table = cnn.ejecutarQueryConSP(comando1);

               int cont = 0;
               for (int i = 0; i < table.Rows.Count; i++)
               {
               if (float.Parse(table.Rows[i][4].ToString()) == 0.000)
               {
                   cont += 1;
               }
               }
               if (cont != table.Rows.Count) return table;
               else return new DataTable();
        }
Ejemplo n.º 24
0
 public static bool Delete(System.Data.SqlClient.SqlConnection connection,
                           System.Data.SqlClient.SqlTransaction tran,
                           System.Data.DataRow row, out string message)
 {
     bool done = false;
     message = "";
     try
     {
         connection.Open();
         System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand();
         string sQuery = "DELETE FROM Producer.Products\n" +
                         " WHERE ProductID = @ProductID";
         cmd.Parameters.AddWithValue("@ProductID", row["ProductID"]);
         cmd.Connection = connection;
         if (tran != null) cmd.Transaction = tran;
         cmd.CommandTimeout = 0;
         cmd.CommandType = System.Data.CommandType.Text;
         cmd.CommandText = sQuery;
         cmd.ExecuteNonQuery();
         connection.Close();
         done = true;
     }
     catch (System.Exception ex)
     {
         message = ex.Message;
     }
     finally
     {
         if (connection.State == System.Data.ConnectionState.Open) connection.Close();
     }
     return done;
 }
Ejemplo n.º 25
0
        public void InsertError(Exception err, int refId, bool sendMail)
        {
            string conn = System.Configuration.ConfigurationManager.ConnectionStrings["MainConnection"].ConnectionString;
            string queryString = "INSERT INTO [MLB].[dbo].[Error] ([RefId],[ErrorMethod],[ErrorText],[ErrorDate]) VALUES (@RefId,@ErrorMethod,@ErrorText,@ErrorDate)";

            using (System.Data.SqlClient.SqlConnection connection = new System.Data.SqlClient.SqlConnection(conn))
            {
                // Create the Command and Parameter objects.
                System.Data.SqlClient.SqlCommand command = new System.Data.SqlClient.SqlCommand(queryString, connection);
                command.Parameters.AddWithValue("@RefId", refId);
                command.Parameters.AddWithValue("@ErrorMethod", err.Source);
                command.Parameters.AddWithValue("@ErrorText", err.InnerException);
                command.Parameters.AddWithValue("@ErrorDate", DateTime.Now);

                try
                {
                    connection.Open();
                    command.ExecuteNonQuery();
                }
                catch (Exception ex)
                { }
            }

            if (sendMail)
            {
                var email = EmailMessageFactory.GetErrorEmail(err);
                var result = EmailClient.SendEmail(email);
            }
        }
Ejemplo n.º 26
0
        private void FillDataSet()
        {

            //1. Make a Connection
            System.Data.SqlClient.SqlConnection objCon;
            objCon = new System.Data.SqlClient.SqlConnection();
            objCon.ConnectionString = @"Data Source=(localDB)\v11.0;Initial Catalog = EmployeeProjects; Integrated Security=True;";
            objCon.Open();

            //2. Issue a Command
            System.Data.SqlClient.SqlCommand objCmd;
            objCmd = new System.Data.SqlClient.SqlCommand();
            objCmd.Connection = objCon;
            objCmd.CommandType = CommandType.StoredProcedure;
            objCmd.CommandText = @"pSelEmployeeProjectHours";

            //3. Process the Results
            System.Data.DataSet objDS = new DataSet();
            System.Data.SqlClient.SqlDataAdapter objDA;
            objDA = new System.Data.SqlClient.SqlDataAdapter();
            objDA.SelectCommand = objCmd;
            objDA.Fill(objDS); // objCon.Open() is not needed!
            dataGridView1.DataSource = objDS.Tables[0];

            //4. Clean up code
            objCon.Close();
            dataGridView1.Refresh();
        }
Ejemplo n.º 27
0
        public static blc.Usuario cargarUsuario(string usuario)
        {
            blc.Usuario user = new blc.Usuario();
            System.Data.SqlClient.SqlCommand Comando;
            System.Data.SqlClient.SqlDataReader DataReader;
            string query = "SELECT * FROM Usuario WHERE Codigo = '" + usuario + "'";

            Comando = new System.Data.SqlClient.SqlCommand(query);
            Comando.Connection = Program.dt.Connecion;
            Comando.Connection.Open();
            DataReader = Comando.ExecuteReader();

            /* Cargar el objeto con toda su informacion */
            while (DataReader.Read())
            {
                user.Codigo = usuario;
                user.Password = DataReader.GetValue(1).ToString();
                user.Nombre = DataReader.GetValue(2).ToString();
                user.Apellido = DataReader.GetValue(3).ToString();
                user.Celular = DataReader.GetValue(4).ToString();
                user.Email = DataReader.GetValue(5).ToString();
                user.Grupo.Codigo = (int)DataReader.GetValue(6);
                user.Superusuario = DataReader.GetValue(7).ToString();
            }
            DataReader.Close();
            Comando.Connection.Close();
            return user;
        }
Ejemplo n.º 28
0
        protected void CreateUserWizard1_CreatedUser(object sender, EventArgs e)
        {
            String sqlstring;
               // sqlstring = "insert into sys_user values ((select max(sysuser_id)+1 from sys_user),'" +
               //     CreateUserWizard1.UserName + "','" + CreateUserWizard1.Password + "','1', GETDATE(), 3);";

            //SQL 2005 version
            sqlstring = "insert into sys_user select max(sysuser_id)+1, '" +
                CreateUserWizard1.UserName + "','" + CreateUserWizard1.Password +
                "', GETDATE(), (Select top 1 sysrole_id from sys_role where sysrole_name='Applicant') from sys_user ";

            // create a connection with sqldatabase
            //System.Data.SqlClient.SqlConnection con = new System.Data.SqlClient.SqlConnection(
             //            " Data Source=SD;Initial Catalog=SRS;User ID=sa;Password=Ab123456;Connect Timeout=10;TrustServerCertificate=True ");
            System.Data.SqlClient.SqlConnection con = new System.Data.SqlClient.SqlConnection(
                WebConfigurationManager.ConnectionStrings["SRSDB"].ConnectionString);
            // create a sql command which will user connection string and your select statement string
            System.Data.SqlClient.SqlCommand comm = new System.Data.SqlClient.SqlCommand(sqlstring, con);

            // create a sqldatabase reader which will execute the above command to get the values from sqldatabase
            try
            {
                con.Open();
                if (comm.ExecuteNonQuery() > 0)
                {
                }
            }
            finally
            {
                con.Close();
            }
        }
Ejemplo n.º 29
0
        private static List<KeyInfo> GetKeysInternal(Config config, String connectionString, String keyType)
        {
            Dictionary<String, KeyInfo> keys = new Dictionary<string, KeyInfo>();

            using (System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection(connectionString))
            {
                conn.Open();
                System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand(String.Format("select s.name, o.name, i.name from sys.objects o join sys.indexes i on i.object_id = o.object_id join sys.schemas s on s.schema_id = o.schema_id where i.type_desc = '{0}' and i.is_primary_key = 1 and o.type = 'U' order by 1", keyType), conn);
                using (System.Data.SqlClient.SqlDataReader r = cmd.ExecuteReader())
                {
                    while (r.Read())
                    {
                        String schemaName = r[0].ToString();
                        String tableName = r[1].ToString();
                        String keyName = r[2].ToString();
                        keys.Add((schemaName + tableName).ToLower(), new KeyInfo() { Name = keyName, SchemaName = schemaName, TableName = tableName });
                    }
                }
            }

            Dictionary<String, List<Entity>> schemas = config.EntitiesBySchema;
            List<KeyInfo> result = new List<KeyInfo>();
            foreach (KeyValuePair<String, KeyInfo> kvp in keys)
            {
                if (schemas.ContainsKey(kvp.Value.SchemaName))
                    result.Add(kvp.Value);
            }

            return result;
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Jenzabar.Portal.Framework.PortalUser.Current.HostID != null)
            {
                //**************************************************
                // if the logged in user has an ID, check for Time
                //**************************************************

                System.Data.SqlClient.SqlCommand sqlcmdSelectRegistrationTime = new System.Data.SqlClient.SqlCommand(
                    "SELECT ADD_BEG_DTE FROM TW_TIME_CTRL WHERE"
                    + " YR_CDE = (SELECT CURR_YR FROM CUST_INTRFC_CNTRL WHERE INTRFC_TYPE = 'REGTIME_PORTLET') AND TRM_CDE = (SELECT CURR_TRM FROM CUST_INTRFC_CNTRL WHERE INTRFC_TYPE = 'REGTIME_PORTLET') AND"
                    + " TEL_WEB_GRP_CDE = (SELECT TEL_WEB_GRP_CDE FROM STUDENT_MASTER WHERE ID_NUM = '" + Jenzabar.Portal.Framework.PortalUser.Current.HostID + "')",
                    new System.Data.SqlClient.SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["JenzabarConnectionString"].ConnectionString));

                try
                {
                    sqlcmdSelectRegistrationTime.Connection.Open();
                    System.Data.SqlClient.SqlDataReader sqlReader = sqlcmdSelectRegistrationTime.ExecuteReader();

                    if (sqlReader.HasRows)
                    {
                        sqlReader.Read();
                        lblMsg.Text = "<b>" + (Convert.ToDateTime(sqlReader["ADD_BEG_DTE"].ToString())).ToString("dddd, MMMM dd @ h:mm tt") + "</b>.";
                        sqlReader.Close();
                        sqlcmdSelectRegistrationTime.Connection.Close();
                    }
                    else
                    {
                        this.ParentPortlet.ShowFeedback(Jenzabar.Portal.Framework.Web.UI.FeedbackType.Message, "Your registration time has not been set. Contact the Office of Registration & Records (830-372-8040) for more details.");
                    }

                    System.Data.SqlClient.SqlCommand sqlcmdSelectRegEndTime = new System.Data.SqlClient.SqlCommand("SELECT last_drop_add_dte FROM year_term_table WHERE YR_CDE = (SELECT CURR_YR FROM CUST_INTRFC_CNTRL WHERE INTRFC_TYPE = 'REGTIME_PORTLET') AND TRM_CDE = (SELECT CURR_TRM FROM CUST_INTRFC_CNTRL WHERE INTRFC_TYPE = 'REGTIME_PORTLET')", new System.Data.SqlClient.SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["JenzabarConnectionString"].ConnectionString));
                    sqlcmdSelectRegEndTime.Connection.Open();
                    sqlReader = sqlcmdSelectRegEndTime.ExecuteReader();

                    if (sqlReader.HasRows)
                    {
                        sqlReader.Read();
                        lblMessage.Text = "You can register at the time below or any time after through the last day to register, <b>" + (Convert.ToDateTime(sqlReader["LAST_DROP_ADD_DTE"].ToString())).ToString("dddd, MMMM dd @ h:mm tt") + "</b>.";
                    }
                }
                catch (Exception critical)
                {
                    lblError.ErrorMessage = "Error: Registration time(s) unavailable. <BR />" + critical.GetBaseException().Message;
                    lblError.Visible = true;
                }
                finally
                {
                    if (sqlcmdSelectRegistrationTime.Connection != null && sqlcmdSelectRegistrationTime.Connection.State == ConnectionState.Open)
                    {
                        sqlcmdSelectRegistrationTime.Connection.Close();
                    }
                }
            }
            else
            {
                ParentPortlet.ShowFeedbackGlobalized(Jenzabar.Portal.Framework.Web.UI.FeedbackType.Error, "MSG_NO_HOST_ID");
            }
            //lblMessage.Text = "If you need to make an change to your existing Spring schedule, the add/drop period will open beginning Monday, January 11th, at 8:00am, and will remain open until Friday, January 15th, at 5:00pm. If you did not preregister for your spring courses, you will need to register in-person in the Office of Registration and Records on the first floor of the Beck Center.";
        }
Ejemplo n.º 31
0
 /// <summary>
 /// 设计器支持所需的方法 - 不要使用代码编辑器修改
 /// 此方法的内容。
 /// </summary>
 private void InitializeComponent()
 {
     this.groupBox1    = new System.Windows.Forms.GroupBox();
     this.zchtb        = new System.Windows.Forms.TextBox();
     this.tsflhtb      = new System.Windows.Forms.TextBox();
     this.wzhtb        = new System.Windows.Forms.TextBox();
     this.label3       = new System.Windows.Forms.Label();
     this.label2       = new System.Windows.Forms.Label();
     this.label1       = new System.Windows.Forms.Label();
     this.butquery     = new System.Windows.Forms.Button();
     this.butquit      = new System.Windows.Forms.Button();
     this.txtbname     = new System.Windows.Forms.TextBox();
     this.label4       = new System.Windows.Forms.Label();
     this.groupBox2    = new System.Windows.Forms.GroupBox();
     this.butbname     = new System.Windows.Forms.Button();
     this.groupBox3    = new System.Windows.Forms.GroupBox();
     this.booktv       = new System.Windows.Forms.TreeView();
     this.sqlConn      = new System.Data.SqlClient.SqlConnection();
     this.sqlComm      = new System.Data.SqlClient.SqlCommand();
     this.groupBox4    = new System.Windows.Forms.GroupBox();
     this.cmdQuery     = new System.Windows.Forms.Button();
     this.label5       = new System.Windows.Forms.Label();
     this.cmdRFidquery = new System.Windows.Forms.Button();
     this.BarCode      = new System.Windows.Forms.TextBox();
     this.buttonDetail = new System.Windows.Forms.Button();
     this.groupBox1.SuspendLayout();
     this.groupBox2.SuspendLayout();
     this.groupBox3.SuspendLayout();
     this.groupBox4.SuspendLayout();
     this.SuspendLayout();
     //
     // groupBox1
     //
     this.groupBox1.Controls.Add(this.zchtb);
     this.groupBox1.Controls.Add(this.tsflhtb);
     this.groupBox1.Controls.Add(this.wzhtb);
     this.groupBox1.Controls.Add(this.label3);
     this.groupBox1.Controls.Add(this.label2);
     this.groupBox1.Controls.Add(this.label1);
     this.groupBox1.Location = new System.Drawing.Point(8, 7);
     this.groupBox1.Name     = "groupBox1";
     this.groupBox1.Size     = new System.Drawing.Size(305, 121);
     this.groupBox1.TabIndex = 0;
     this.groupBox1.TabStop  = false;
     this.groupBox1.Text     = "图书查询参数";
     //
     // zchtb
     //
     this.zchtb.Location = new System.Drawing.Point(96, 88);
     this.zchtb.Name     = "zchtb";
     this.zchtb.Size     = new System.Drawing.Size(203, 21);
     this.zchtb.TabIndex = 2;
     //
     // tsflhtb
     //
     this.tsflhtb.Location = new System.Drawing.Point(96, 56);
     this.tsflhtb.Name     = "tsflhtb";
     this.tsflhtb.Size     = new System.Drawing.Size(203, 21);
     this.tsflhtb.TabIndex = 1;
     //
     // wzhtb
     //
     this.wzhtb.Location = new System.Drawing.Point(96, 24);
     this.wzhtb.Name     = "wzhtb";
     this.wzhtb.Size     = new System.Drawing.Size(203, 21);
     this.wzhtb.TabIndex = 0;
     //
     // label3
     //
     this.label3.Location = new System.Drawing.Point(40, 96);
     this.label3.Name     = "label3";
     this.label3.Size     = new System.Drawing.Size(64, 23);
     this.label3.TabIndex = 5;
     this.label3.Text     = "种次号:";
     //
     // label2
     //
     this.label2.Location = new System.Drawing.Point(16, 64);
     this.label2.Name     = "label2";
     this.label2.Size     = new System.Drawing.Size(80, 23);
     this.label2.TabIndex = 4;
     this.label2.Text     = "图书分类号:";
     //
     // label1
     //
     this.label1.Location = new System.Drawing.Point(40, 32);
     this.label1.Name     = "label1";
     this.label1.Size     = new System.Drawing.Size(64, 23);
     this.label1.TabIndex = 3;
     this.label1.Text     = "文种号:";
     //
     // butquery
     //
     this.butquery.Location = new System.Drawing.Point(18, 301);
     this.butquery.Name     = "butquery";
     this.butquery.Size     = new System.Drawing.Size(94, 54);
     this.butquery.TabIndex = 1;
     this.butquery.Text     = "查询";
     this.butquery.Click   += new System.EventHandler(this.butquery_Click);
     //
     // butquit
     //
     this.butquit.Location = new System.Drawing.Point(226, 301);
     this.butquit.Name     = "butquit";
     this.butquit.Size     = new System.Drawing.Size(75, 54);
     this.butquit.TabIndex = 2;
     this.butquit.Text     = "退出";
     this.butquit.Click   += new System.EventHandler(this.butquit_Click);
     //
     // txtbname
     //
     this.txtbname.Location = new System.Drawing.Point(64, 152);
     this.txtbname.Name     = "txtbname";
     this.txtbname.Size     = new System.Drawing.Size(243, 21);
     this.txtbname.TabIndex = 3;
     //
     // label4
     //
     this.label4.Location = new System.Drawing.Point(16, 160);
     this.label4.Name     = "label4";
     this.label4.Size     = new System.Drawing.Size(48, 23);
     this.label4.TabIndex = 4;
     this.label4.Text     = "书名:";
     //
     // groupBox2
     //
     this.groupBox2.Controls.Add(this.butbname);
     this.groupBox2.Location = new System.Drawing.Point(8, 128);
     this.groupBox2.Name     = "groupBox2";
     this.groupBox2.Size     = new System.Drawing.Size(305, 80);
     this.groupBox2.TabIndex = 5;
     this.groupBox2.TabStop  = false;
     this.groupBox2.Text     = "书名查询";
     //
     // butbname
     //
     this.butbname.Location = new System.Drawing.Point(118, 51);
     this.butbname.Name     = "butbname";
     this.butbname.Size     = new System.Drawing.Size(75, 23);
     this.butbname.TabIndex = 0;
     this.butbname.Text     = "书名查询";
     this.butbname.Click   += new System.EventHandler(this.butbname_Click);
     //
     // groupBox3
     //
     this.groupBox3.Controls.Add(this.booktv);
     this.groupBox3.Location = new System.Drawing.Point(319, 7);
     this.groupBox3.Name     = "groupBox3";
     this.groupBox3.Size     = new System.Drawing.Size(432, 403);
     this.groupBox3.TabIndex = 6;
     this.groupBox3.TabStop  = false;
     this.groupBox3.Text     = "书名查询结果";
     //
     // booktv
     //
     this.booktv.Dock         = System.Windows.Forms.DockStyle.Fill;
     this.booktv.Location     = new System.Drawing.Point(3, 17);
     this.booktv.Name         = "booktv";
     this.booktv.Size         = new System.Drawing.Size(426, 383);
     this.booktv.TabIndex     = 0;
     this.booktv.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.booktv_AfterSelect);
     this.booktv.DoubleClick += new System.EventHandler(this.booktv_DoubleClick);
     //
     // sqlConn
     //
     this.sqlConn.FireInfoMessageEventOnUserErrors = false;
     //
     // groupBox4
     //
     this.groupBox4.Controls.Add(this.cmdQuery);
     this.groupBox4.Controls.Add(this.label5);
     this.groupBox4.Controls.Add(this.cmdRFidquery);
     this.groupBox4.Controls.Add(this.BarCode);
     this.groupBox4.Location = new System.Drawing.Point(8, 208);
     this.groupBox4.Name     = "groupBox4";
     this.groupBox4.Size     = new System.Drawing.Size(299, 72);
     this.groupBox4.TabIndex = 7;
     this.groupBox4.TabStop  = false;
     this.groupBox4.Text     = "RFID查询";
     //
     // cmdQuery
     //
     this.cmdQuery.Location = new System.Drawing.Point(136, 42);
     this.cmdQuery.Name     = "cmdQuery";
     this.cmdQuery.Size     = new System.Drawing.Size(72, 24);
     this.cmdQuery.TabIndex = 3;
     this.cmdQuery.Text     = "查看";
     this.cmdQuery.Click   += new System.EventHandler(this.cmdQuery_Click);
     //
     // label5
     //
     this.label5.Location = new System.Drawing.Point(8, 24);
     this.label5.Name     = "label5";
     this.label5.Size     = new System.Drawing.Size(40, 15);
     this.label5.TabIndex = 2;
     this.label5.Text     = "编号:";
     //
     // cmdRFidquery
     //
     this.cmdRFidquery.Location = new System.Drawing.Point(213, 42);
     this.cmdRFidquery.Name     = "cmdRFidquery";
     this.cmdRFidquery.Size     = new System.Drawing.Size(80, 24);
     this.cmdRFidquery.TabIndex = 1;
     this.cmdRFidquery.Text     = "编号查询";
     this.cmdRFidquery.Click   += new System.EventHandler(this.cmdRFidquery_Click);
     //
     // BarCode
     //
     this.BarCode.Location = new System.Drawing.Point(48, 16);
     this.BarCode.Name     = "BarCode";
     this.BarCode.Size     = new System.Drawing.Size(245, 21);
     this.BarCode.TabIndex = 0;
     //
     // buttonDetail
     //
     this.buttonDetail.Location = new System.Drawing.Point(118, 301);
     this.buttonDetail.Name     = "buttonDetail";
     this.buttonDetail.Size     = new System.Drawing.Size(94, 54);
     this.buttonDetail.TabIndex = 8;
     this.buttonDetail.Text     = "查询细节";
     this.buttonDetail.Click   += new System.EventHandler(this.buttonDetail_Click);
     //
     // bookquery
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
     this.ClientSize        = new System.Drawing.Size(763, 422);
     this.Controls.Add(this.buttonDetail);
     this.Controls.Add(this.groupBox4);
     this.Controls.Add(this.groupBox3);
     this.Controls.Add(this.label4);
     this.Controls.Add(this.txtbname);
     this.Controls.Add(this.butquit);
     this.Controls.Add(this.butquery);
     this.Controls.Add(this.groupBox1);
     this.Controls.Add(this.groupBox2);
     this.Name          = "bookquery";
     this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
     this.Text          = "图书查询";
     this.Load         += new System.EventHandler(this.bookquery_Load);
     this.groupBox1.ResumeLayout(false);
     this.groupBox1.PerformLayout();
     this.groupBox2.ResumeLayout(false);
     this.groupBox3.ResumeLayout(false);
     this.groupBox4.ResumeLayout(false);
     this.groupBox4.PerformLayout();
     this.ResumeLayout(false);
     this.PerformLayout();
 }
Ejemplo n.º 32
0
        protected void SetCurrentAccountSession(System.Security.Principal.IPrincipal principal)
        {
            var accountType  = AccountType.None;
            var userId       = string.Empty;
            var portfolioId  = string.Empty;
            var portfolioIds = new List <string>();

            if (principal != null && principal.Identity.IsAuthenticated)
            {
                // note: we'll just read SQL directly until we get MongoDB web security figured out.
                var connectionString = System.Configuration.ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString;

                using (var sqlConnection = new System.Data.SqlClient.SqlConnection(connectionString))
                {
                    // open a connection to our SQL DB
                    sqlConnection.Open();

                    // find the Mongo Id for this email
                    var query  = new System.Data.SqlClient.SqlCommand(string.Format("SELECT MongoUserId FROM MEMBERSHIP WHERE Email = '{0}'", principal.Identity.Name), sqlConnection);
                    var reader = query.ExecuteReader();

                    try
                    {
                        // get our value
                        reader.Read();
                        userId = reader.GetValue(0).ToString();
                    }
                    catch
                    {
                    }
                    finally
                    {
                        // close the connection
                        sqlConnection.Close();
                    }

                    using (var mongoDbContext = new MongoDbContext())
                    {
                        var consumerMember = mongoDbContext.GetConsumerMember(userId);
                        if (consumerMember != null)
                        {
                            accountType = AccountType.Consumer;
                            portfolioIds.AddRange(consumerMember.PortfolioIds);
                        }
                        else
                        {
                            var providerMember = mongoDbContext.GetProviderMember(userId);
                            if (providerMember != null)
                            {
                                accountType = AccountType.Provider;
                                portfolioIds.AddRange(providerMember.PortfolioIds);
                            }
                            else
                            {
                                var administratorMember = mongoDbContext.GetAdministratorMember(userId);
                                if (administratorMember != null)
                                {
                                    accountType = AccountType.Administrator;
                                }
                            }
                        }
                    }
                }
            }

            // set properties
            _accountType = accountType;
            _memberId    = userId;
            _portfolioId = portfolioId;
            _portfolioIds.AddRange(portfolioIds);
        }
Ejemplo n.º 33
0
 public void SetupDBProviderFromConfig()
 {
     SetConnectionStringFromConfig();
     connection = new System.Data.SqlClient.SqlConnection(connstring);
     comm       = new System.Data.SqlClient.SqlCommand("", connection);
 }
Ejemplo n.º 34
0
 public void SetupDBProvider(string server, string port, string user, string password, string database)
 {
     SetConnectionString(server, port, user, password, database);
     connection = new System.Data.SqlClient.SqlConnection(connstring);
     comm       = new System.Data.SqlClient.SqlCommand("", connection);
 }
Ejemplo n.º 35
0
 /// <summary>
 /// 设计器支持所需的方法 - 不要使用代码编辑器修改
 /// 此方法的内容。
 /// </summary>
 private void InitializeComponent()
 {
     this.cn                = new System.Data.SqlClient.SqlConnection();
     this.daPermission      = new System.Data.SqlClient.SqlDataAdapter();
     this.sqlDeleteCommand1 = new System.Data.SqlClient.SqlCommand();
     this.sqlInsertCommand1 = new System.Data.SqlClient.SqlCommand();
     this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();
     this.sqlUpdateCommand1 = new System.Data.SqlClient.SqlCommand();
     this.sm1               = new LIMS.SystemManagement.SM();
     this.daPermissionType  = new System.Data.SqlClient.SqlDataAdapter();
     this.sqlDeleteCommand2 = new System.Data.SqlClient.SqlCommand();
     this.sqlInsertCommand2 = new System.Data.SqlClient.SqlCommand();
     this.sqlSelectCommand2 = new System.Data.SqlClient.SqlCommand();
     this.sqlUpdateCommand2 = new System.Data.SqlClient.SqlCommand();
     this.daMenu            = new System.Data.SqlClient.SqlDataAdapter();
     this.sqlDeleteCommand3 = new System.Data.SqlClient.SqlCommand();
     this.sqlInsertCommand3 = new System.Data.SqlClient.SqlCommand();
     this.sqlSelectCommand3 = new System.Data.SqlClient.SqlCommand();
     this.sqlUpdateCommand3 = new System.Data.SqlClient.SqlCommand();
     ((System.ComponentModel.ISupportInitialize)(this.sm1)).BeginInit();
     this.dgPermission.UpdateCellBatch += new Infragistics.WebUI.UltraWebGrid.UpdateCellBatchEventHandler(this.dgPermission_UpdateCellBatch);
     this.dgPermission.DeleteRowBatch  += new Infragistics.WebUI.UltraWebGrid.DeleteRowBatchEventHandler(this.dgPermission_DeleteRowBatch);
     this.dgPermission.AddRowBatch     += new Infragistics.WebUI.UltraWebGrid.AddRowBatchEventHandler(this.dgPermission_AddRowBatch);
     this.Sumbit.Click += new Infragistics.WebUI.WebDataInput.ClickHandler(this.Sumbit_Click);
     this.Cancel.Click += new Infragistics.WebUI.WebDataInput.ClickHandler(this.Cancel_Click);
     //
     // cn
     //
     this.cn.ConnectionString = "workstation id=QDMT;packet size=4096;user id=sa;integrated security=SSPI;data sou" +
                                "rce=\".\";persist security info=False;initial catalog=lims";
     //
     // daPermission
     //
     this.daPermission.DeleteCommand = this.sqlDeleteCommand1;
     this.daPermission.InsertCommand = this.sqlInsertCommand1;
     this.daPermission.SelectCommand = this.sqlSelectCommand1;
     this.daPermission.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "权限模块", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("ID", "ID"),
             new System.Data.Common.DataColumnMapping("权限模块名", "权限模块名"),
             new System.Data.Common.DataColumnMapping("类别", "类别"),
             new System.Data.Common.DataColumnMapping("菜单级别", "菜单级别"),
             new System.Data.Common.DataColumnMapping("菜单项目ID", "菜单项目ID"),
             new System.Data.Common.DataColumnMapping("链接地址", "链接地址"),
             new System.Data.Common.DataColumnMapping("备注", "备注")
         })
     });
     this.daPermission.UpdateCommand = this.sqlUpdateCommand1;
     //
     // sqlDeleteCommand1
     //
     this.sqlDeleteCommand1.CommandText = @"DELETE FROM 权限模块 WHERE (ID = @Original_ID) AND (权限模块名 = @Original_权限模块名) AND (类别 = @Original_类别) AND (菜单级别 = @Original_菜单级别 OR @Original_菜单级别 IS NULL AND 菜单级别 IS NULL) AND (菜单项目ID = @Original_菜单项目ID OR @Original_菜单项目ID IS NULL AND 菜单项目ID IS NULL) AND (链接地址 = @Original_链接地址 OR @Original_链接地址 IS NULL AND 链接地址 IS NULL)";
     this.sqlDeleteCommand1.Connection  = this.cn;
     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ID", System.Data.DataRowVersion.Original, null));
     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_权限模块名", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "权限模块名", System.Data.DataRowVersion.Original, null));
     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_类别", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "类别", System.Data.DataRowVersion.Original, null));
     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_菜单级别", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "菜单级别", System.Data.DataRowVersion.Original, null));
     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_菜单项目ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "菜单项目ID", System.Data.DataRowVersion.Original, null));
     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_链接地址", System.Data.SqlDbType.NVarChar, 1000, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "链接地址", System.Data.DataRowVersion.Original, null));
     //
     // sqlInsertCommand1
     //
     this.sqlInsertCommand1.CommandText = "INSERT INTO 权限模块(权限模块名, 类别, 菜单级别, 菜单项目ID, 链接地址, 备注) VALUES (@权限模块名, @类别, @菜单级别, @" +
                                          "菜单项目ID, @链接地址, @备注); SELECT ID, 权限模块名, 类别, 菜单级别, 菜单项目ID, 链接地址, 备注 FROM 权限模块 WHER" +
                                          "E (ID = @@IDENTITY)";
     this.sqlInsertCommand1.Connection = this.cn;
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@权限模块名", System.Data.SqlDbType.NVarChar, 50, "权限模块名"));
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@类别", System.Data.SqlDbType.Int, 4, "类别"));
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@菜单级别", System.Data.SqlDbType.Int, 4, "菜单级别"));
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@菜单项目ID", System.Data.SqlDbType.Int, 4, "菜单项目ID"));
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@链接地址", System.Data.SqlDbType.NVarChar, 1000, "链接地址"));
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@备注", System.Data.SqlDbType.NVarChar, 1073741823, "备注"));
     //
     // sqlSelectCommand1
     //
     this.sqlSelectCommand1.CommandText = "SELECT ID, 权限模块名, 类别, 菜单级别, 菜单项目ID, 链接地址, 备注 FROM 权限模块";
     this.sqlSelectCommand1.Connection  = this.cn;
     //
     // sqlUpdateCommand1
     //
     this.sqlUpdateCommand1.CommandText = @"UPDATE 权限模块 SET 权限模块名 = @权限模块名, 类别 = @类别, 菜单级别 = @菜单级别, 菜单项目ID = @菜单项目ID, 链接地址 = @链接地址, 备注 = @备注 WHERE (ID = @Original_ID) AND (权限模块名 = @Original_权限模块名) AND (类别 = @Original_类别) AND (菜单级别 = @Original_菜单级别 OR @Original_菜单级别 IS NULL AND 菜单级别 IS NULL) AND (菜单项目ID = @Original_菜单项目ID OR @Original_菜单项目ID IS NULL AND 菜单项目ID IS NULL) AND (链接地址 = @Original_链接地址 OR @Original_链接地址 IS NULL AND 链接地址 IS NULL); SELECT ID, 权限模块名, 类别, 菜单级别, 菜单项目ID, 链接地址, 备注 FROM 权限模块 WHERE (ID = @ID)";
     this.sqlUpdateCommand1.Connection  = this.cn;
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@权限模块名", System.Data.SqlDbType.NVarChar, 50, "权限模块名"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@类别", System.Data.SqlDbType.Int, 4, "类别"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@菜单级别", System.Data.SqlDbType.Int, 4, "菜单级别"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@菜单项目ID", System.Data.SqlDbType.Int, 4, "菜单项目ID"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@链接地址", System.Data.SqlDbType.NVarChar, 1000, "链接地址"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@备注", System.Data.SqlDbType.NVarChar, 1073741823, "备注"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ID", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_权限模块名", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "权限模块名", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_类别", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "类别", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_菜单级别", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "菜单级别", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_菜单项目ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "菜单项目ID", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_链接地址", System.Data.SqlDbType.NVarChar, 1000, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "链接地址", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ID", System.Data.SqlDbType.Int, 4, "ID"));
     //
     // sm1
     //
     this.sm1.DataSetName = "SM";
     this.sm1.Locale      = new System.Globalization.CultureInfo("zh-CN");
     //
     // daPermissionType
     //
     this.daPermissionType.DeleteCommand = this.sqlDeleteCommand2;
     this.daPermissionType.InsertCommand = this.sqlInsertCommand2;
     this.daPermissionType.SelectCommand = this.sqlSelectCommand2;
     this.daPermissionType.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "权限类别", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("ID", "ID"),
             new System.Data.Common.DataColumnMapping("Type", "Type")
         })
     });
     this.daPermissionType.UpdateCommand = this.sqlUpdateCommand2;
     //
     // sqlDeleteCommand2
     //
     this.sqlDeleteCommand2.CommandText = "DELETE FROM 权限类别 WHERE (ID = @Original_ID) AND (类别 = @Original_Type OR @Original_" +
                                          "Type IS NULL AND 类别 IS NULL)";
     this.sqlDeleteCommand2.Connection = this.cn;
     this.sqlDeleteCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ID", System.Data.DataRowVersion.Original, null));
     this.sqlDeleteCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Type", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Type", System.Data.DataRowVersion.Original, null));
     //
     // sqlInsertCommand2
     //
     this.sqlInsertCommand2.CommandText = "INSERT INTO 权限类别(类别) VALUES (@类别); SELECT ID, 类别 AS Type FROM 权限类别 WHERE (ID = @@" +
                                          "IDENTITY)";
     this.sqlInsertCommand2.Connection = this.cn;
     this.sqlInsertCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@类别", System.Data.SqlDbType.NVarChar, 50, "Type"));
     //
     // sqlSelectCommand2
     //
     this.sqlSelectCommand2.CommandText = "SELECT ID, 类别 AS Type FROM 权限类别";
     this.sqlSelectCommand2.Connection  = this.cn;
     //
     // sqlUpdateCommand2
     //
     this.sqlUpdateCommand2.CommandText = "UPDATE 权限类别 SET 类别 = @类别 WHERE (ID = @Original_ID) AND (类别 = @Original_Type OR @O" +
                                          "riginal_Type IS NULL AND 类别 IS NULL); SELECT ID, 类别 AS Type FROM 权限类别 WHERE (ID " +
                                          "= @ID)";
     this.sqlUpdateCommand2.Connection = this.cn;
     this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@类别", System.Data.SqlDbType.NVarChar, 50, "Type"));
     this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ID", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Type", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Type", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ID", System.Data.SqlDbType.Int, 4, "ID"));
     //
     // daMenu
     //
     this.daMenu.DeleteCommand = this.sqlDeleteCommand3;
     this.daMenu.InsertCommand = this.sqlInsertCommand3;
     this.daMenu.SelectCommand = this.sqlSelectCommand3;
     this.daMenu.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "菜单", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("ID", "ID"),
             new System.Data.Common.DataColumnMapping("item", "item")
         })
     });
     this.daMenu.UpdateCommand = this.sqlUpdateCommand3;
     //
     // sqlDeleteCommand3
     //
     this.sqlDeleteCommand3.CommandText = "DELETE FROM 菜单 WHERE (ID = @Original_ID) AND (菜单项目名 = @Original_item OR @Original" +
                                          "_item IS NULL AND 菜单项目名 IS NULL)";
     this.sqlDeleteCommand3.Connection = this.cn;
     this.sqlDeleteCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ID", System.Data.DataRowVersion.Original, null));
     this.sqlDeleteCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_item", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "item", System.Data.DataRowVersion.Original, null));
     //
     // sqlInsertCommand3
     //
     this.sqlInsertCommand3.CommandText = "INSERT INTO 菜单(菜单项目名) VALUES (@菜单项目名); SELECT ID, 菜单项目名 AS item FROM 菜单 WHERE (ID" +
                                          " = @@IDENTITY)";
     this.sqlInsertCommand3.Connection = this.cn;
     this.sqlInsertCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@菜单项目名", System.Data.SqlDbType.NVarChar, 50, "item"));
     //
     // sqlSelectCommand3
     //
     this.sqlSelectCommand3.CommandText = "SELECT ID, 菜单项目名 AS item FROM 菜单";
     this.sqlSelectCommand3.Connection  = this.cn;
     //
     // sqlUpdateCommand3
     //
     this.sqlUpdateCommand3.CommandText = "UPDATE 菜单 SET 菜单项目名 = @菜单项目名 WHERE (ID = @Original_ID) AND (菜单项目名 = @Original_ite" +
                                          "m OR @Original_item IS NULL AND 菜单项目名 IS NULL); SELECT ID, 菜单项目名 AS item FROM 菜单" +
                                          " WHERE (ID = @ID)";
     this.sqlUpdateCommand3.Connection = this.cn;
     this.sqlUpdateCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@菜单项目名", System.Data.SqlDbType.NVarChar, 50, "item"));
     this.sqlUpdateCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "ID", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_item", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "item", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ID", System.Data.SqlDbType.Int, 4, "ID"));
     this.Load += new System.EventHandler(this.Page_Load);
     ((System.ComponentModel.ISupportInitialize)(this.sm1)).EndInit();
 }
Ejemplo n.º 36
0
        private void buttonGuardar_Click(object sender, EventArgs e)
        {
            int    documento     = 0;
            int    nro_calle_val = 0;
            int    nro_piso_val  = 0;
            string tipoDoc       = "";

            List <string> listaValidacion = new List <string>();

            //Validamos los campos obligatorios
            if (this.cliNombre.Text == String.Empty)
            {
                listaValidacion.Add("El campo Nombre es obligatorio");
            }

            if (this.cliApellido.Text == String.Empty)
            {
                listaValidacion.Add("El campo Apellido es obligatorio");
            }

            if (this.cliDni.Text == String.Empty)
            {
                listaValidacion.Add("El campo Dni es obligatorio");
            }

            if (this.cliEmail.Text == String.Empty)
            {
                listaValidacion.Add("El campo de Email es obligatorio");
            }

            if (this.cliTelefono.Text == String.Empty)
            {
                listaValidacion.Add("El campo de Telefono es obligatorio");
            }

            if (this.cliDireccion.Text == String.Empty)
            {
                listaValidacion.Add("El campo de Calle es obligatorio");
            }

            if (this.nroCalle.Text == String.Empty)
            {
                listaValidacion.Add("El campo de Numero de calle es obligatorio");
            }

            if (this.cuil.Text == String.Empty)
            {
                listaValidacion.Add("El campo de CUIL es obligatorio");
            }

            if (this.cliLocalidad.Text == String.Empty)
            {
                listaValidacion.Add("El campo Localidad es obligatorio");
            }
            if (this.cliCiudad.Text == String.Empty)
            {
                listaValidacion.Add("El campo Ciudad es obligatorio");
            }
            if (this.cliFechaNac.Text == String.Empty)
            {
                listaValidacion.Add("El campo Fecha de nacimiento es obligatorio");
            }


            //Valido los campos numericos
            try
            {
                documento = Convert.ToInt32(this.cliDni.Text);
            }
            catch
            {
                listaValidacion.Add("El Documento debe ser numerico");
            }

            try
            {
                nro_calle_val = Convert.ToInt32(this.nroCalle.Text);
            }
            catch
            {
                listaValidacion.Add("El Nro de calle debe ser numerico");
            }

            try
            {
                if (this.cliPiso.Text != String.Empty)
                {
                    nro_piso_val = Convert.ToInt32(this.cliPiso.Text);
                }
            }
            catch
            {
                listaValidacion.Add("El Piso debe ser numerico");
            }

            //Valido el formato del CUIL
            if (Tools.Validacion.validarCUIT(this.cuil.Text) == -1)
            {
                listaValidacion.Add("El CUIL esta mal formado");
            }


            //Muestro un mensaje con los datos mal cargados
            if (listaValidacion.Count > 0)
            {
                StringBuilder error = new StringBuilder();
                error.AppendLine("Por favor corrija los siguientes campos:");

                foreach (var i in listaValidacion)
                {
                    error.AppendLine(i);
                }

                MessageBox.Show(error.ToString());
                return;
            }

            //Verifico que el TELEFONO no este repetido
            System.Data.SqlClient.SqlCommand comDupTel = new System.Data.SqlClient.SqlCommand("LOS_GESTORES.sp_app_getUsuarioXTelefono");

            //Defino los parametros
            System.Data.SqlClient.SqlParameter pTel = new System.Data.SqlClient.SqlParameter("@telefono", cliTelefono.Text.Trim());
            comDupTel.Parameters.Add(pTel);

            // Abro la conexion
            AccesoDatos.getInstancia().abrirConexion();

            System.Data.SqlClient.SqlDataReader dupTel = AccesoDatos.getInstancia().ejecutaSP(comDupTel);

            if (dupTel.HasRows)
            {
                MessageBox.Show("Ya existe un usuario con ese numero de Telefono.");
                // Cierro la conexion
                dupTel.Close();
                AccesoDatos.getInstancia().cerrarConexion();
                return;
            }

            // Cierro la conexion
            dupTel.Close();
            AccesoDatos.getInstancia().cerrarConexion();


            //Verifico que el CUIT / CUIL no este repetido
            System.Data.SqlClient.SqlCommand comDupCUIT = new System.Data.SqlClient.SqlCommand("LOS_GESTORES.sp_app_getUsuarioXCUIT");

            //Defino los parametros
            System.Data.SqlClient.SqlParameter pcuit1 = new System.Data.SqlClient.SqlParameter("@cuit", cuil.Text.Trim());
            comDupCUIT.Parameters.Add(pcuit1);

            // Abro la conexion
            AccesoDatos.getInstancia().abrirConexion();

            System.Data.SqlClient.SqlDataReader dupCUIT = AccesoDatos.getInstancia().ejecutaSP(comDupCUIT);

            if (dupCUIT.HasRows)
            {
                MessageBox.Show("Ya existe un usuario con ese numero de CUIT - CUIL.");
                // Cierro la conexion
                dupCUIT.Close();
                AccesoDatos.getInstancia().cerrarConexion();
                return;
            }

            // Cierro la conexion
            dupCUIT.Close();
            AccesoDatos.getInstancia().cerrarConexion();


            //Verifico que el dni no este repetido
            System.Data.SqlClient.SqlCommand comDup = new System.Data.SqlClient.SqlCommand("LOS_GESTORES.sp_app_getClienteXTipoNroDoc");

            //Defino los parametros
            System.Data.SqlClient.SqlParameter p1 = new System.Data.SqlClient.SqlParameter("@tipo_doc", int.Parse(cliTipoDoc.SelectedValue.ToString()));
            comDup.Parameters.Add(p1);

            System.Data.SqlClient.SqlParameter p2 = new System.Data.SqlClient.SqlParameter("@nro_doc", documento);
            comDup.Parameters.Add(p2);

            // Abro la conexion
            AccesoDatos.getInstancia().abrirConexion();

            System.Data.SqlClient.SqlDataReader dup = AccesoDatos.getInstancia().ejecutaSP(comDup);

            if (dup.HasRows)
            {
                MessageBox.Show("Ya existe un usuario con ese tipo y numero de documento.");
                // Cierro la conexion
                dup.Close();
                AccesoDatos.getInstancia().cerrarConexion();
                return;
            }

            // Cierro la conexion
            dup.Close();
            AccesoDatos.getInstancia().cerrarConexion();

            ///////////////////////////////
            //Persisto el usuario cliente//
            ///////////////////////////////

            tipoDoc = this.cliTipoDoc.SelectedValue.ToString();

            // Nombre del SP
            string sql_qry = "LOS_GESTORES.sp_app_creaUsuarioCliente";

            //comando pasado como parametro
            System.Data.SqlClient.SqlCommand com = new System.Data.SqlClient.SqlCommand(sql_qry);

            //Defino los parametros y los agrego a la lista de parametros
            System.Data.SqlClient.SqlParameter nombre_usu = new System.Data.SqlClient.SqlParameter("@nombre_usu", this.usr_nombre);
            com.Parameters.Add(nombre_usu);

            System.Data.SqlClient.SqlParameter pass_usu = new System.Data.SqlClient.SqlParameter("@pass", this.usr_pass);
            com.Parameters.Add(pass_usu);

            System.Data.SqlClient.SqlParameter calle_usu = new System.Data.SqlClient.SqlParameter("@calle", this.cliDireccion.Text);
            com.Parameters.Add(calle_usu);

            System.Data.SqlClient.SqlParameter nro_calle_usu = new System.Data.SqlClient.SqlParameter("@nro_calle", nro_calle_val);
            com.Parameters.Add(nro_calle_usu);

            if (this.cliPiso.Text != String.Empty)
            {
                System.Data.SqlClient.SqlParameter piso_usu = new System.Data.SqlClient.SqlParameter("@piso", nro_piso_val);
                com.Parameters.Add(piso_usu);
            }

            System.Data.SqlClient.SqlParameter depto_usu = new System.Data.SqlClient.SqlParameter("@depto", this.cliDpto.Text);
            com.Parameters.Add(depto_usu);

            System.Data.SqlClient.SqlParameter cp_usu = new System.Data.SqlClient.SqlParameter("@cp", this.cliCodPostal.Text);
            com.Parameters.Add(cp_usu);

            System.Data.SqlClient.SqlParameter loc_usu = new System.Data.SqlClient.SqlParameter("@loc", this.cliLocalidad.Text);
            com.Parameters.Add(loc_usu);

            System.Data.SqlClient.SqlParameter ciudad_usu = new System.Data.SqlClient.SqlParameter("@ciudad", this.cliCiudad.Text);
            com.Parameters.Add(ciudad_usu);

            System.Data.SqlClient.SqlParameter mail_usu = new System.Data.SqlClient.SqlParameter("@mail", this.cliEmail.Text);
            com.Parameters.Add(mail_usu);

            System.Data.SqlClient.SqlParameter tipo_doc_usu = new System.Data.SqlClient.SqlParameter("@id_tipodoc", int.Parse(this.cliTipoDoc.SelectedValue.ToString()));
            com.Parameters.Add(tipo_doc_usu);

            System.Data.SqlClient.SqlParameter nro_doc_usu = new System.Data.SqlClient.SqlParameter("@nro_doc", documento);
            com.Parameters.Add(nro_doc_usu);

            System.Data.SqlClient.SqlParameter apellido_usu = new System.Data.SqlClient.SqlParameter("@apellido", this.cliApellido.Text);
            com.Parameters.Add(apellido_usu);

            System.Data.SqlClient.SqlParameter nombre_cli = new System.Data.SqlClient.SqlParameter("@nombre_cli", this.cliNombre.Text);
            com.Parameters.Add(nombre_cli);

            System.Data.SqlClient.SqlParameter fnac_usu = new System.Data.SqlClient.SqlParameter("@f_nac", this.cliFechaNac.Value);
            com.Parameters.Add(fnac_usu);

            System.Data.SqlClient.SqlParameter cuil_usu = new System.Data.SqlClient.SqlParameter("@cuil", this.cuil.Text);
            com.Parameters.Add(cuil_usu);

            System.Data.SqlClient.SqlParameter tel_usu = new System.Data.SqlClient.SqlParameter("@tel", cliTelefono.Text.Trim());
            com.Parameters.Add(tel_usu);


            // Abro la conexion
            AccesoDatos.getInstancia().abrirConexion();

            System.Data.SqlClient.SqlDataReader datos
                = AccesoDatos.getInstancia().ejecutaSP(com);

            MessageBox.Show("Felicitaciones se ha registrado exitosamente");

            // Cierro la conexion
            AccesoDatos.getInstancia().cerrarConexion();

            this.Close();
        }
Ejemplo n.º 37
0
        public Boolean Delete_Job_Record(String jobNumber, DateTime timeStamp, System.Data.SqlClient.SqlTransaction trnEnvelope)
        {
            Boolean isSuccessful = true;

            System.Data.DataTable myJob = new System.Data.DataTable();

            ErrorMessage = string.Empty;

            try
            {
                String strSQL = "SELECT * FROM Jobs WHERE JobNumber = '" + jobNumber + "'";
                System.Data.SqlClient.SqlCommand    cmdGet = new System.Data.SqlClient.SqlCommand(strSQL, myVPSConnection, trnEnvelope);
                System.Data.SqlClient.SqlDataReader rdrGet = cmdGet.ExecuteReader();
                if (rdrGet.HasRows == true)
                {
                    myJob.Load(rdrGet);

                    // Delete Associated Extra Services
                    strSQL = "DELETE FROM JobExtraServices WHERE JobId = " + Convert.ToInt32(myJob.Rows[0]["JobId"]).ToString();
                    System.Data.SqlClient.SqlCommand cmdDeleteS = new System.Data.SqlClient.SqlCommand(strSQL, myVPSConnection, trnEnvelope);
                    cmdDeleteS.ExecuteNonQuery();

                    // Delete Assoication Parts
                    strSQL = "DELETE FROM JobDetails WHERE JobId = " + Convert.ToInt32(myJob.Rows[0]["JobId"]).ToString();
                    System.Data.SqlClient.SqlCommand cmdDeleteP = new System.Data.SqlClient.SqlCommand(strSQL, myVPSConnection, trnEnvelope);
                    cmdDeleteP.ExecuteNonQuery();

                    // Delete Job
                    strSQL = "DELETE FROM Jobs WHERE JobId = " + Convert.ToInt32(myJob.Rows[0]["JobId"]).ToString();
                    System.Data.SqlClient.SqlCommand cmdDeleteJ = new System.Data.SqlClient.SqlCommand(strSQL, myVPSConnection, trnEnvelope);
                    cmdDeleteJ.ExecuteNonQuery();

                    // Update Job Status Table
                    strSQL = "INSERT INTO JobStatusLog (";
                    strSQL = strSQL + "JobNumber, ";
                    strSQL = strSQL + "JobStatus, ";
                    strSQL = strSQL + "Updated, ";
                    strSQL = strSQL + "Source) VALUES (";
                    strSQL = strSQL + "'" + jobNumber + "', ";
                    strSQL = strSQL + "'Deferred', ";
                    strSQL = strSQL + "CONVERT(datetime, '" + DateTime.Now.ToString() + "', 103), ";
                    strSQL = strSQL + "'Factory')";
                    System.Data.SqlClient.SqlCommand cmdInsert = new System.Data.SqlClient.SqlCommand(strSQL, myVPSConnection, trnEnvelope);
                    cmdInsert.ExecuteNonQuery();
                }
                else
                {
                    isSuccessful = false;
                    ErrorMessage = "Delete Job Record - Job Record Not Found";
                }

                rdrGet.Close();
                cmdGet.Dispose();
            }
            catch (Exception ex)
            {
                isSuccessful = false;
                ErrorMessage = "Delete Job Record - " + ex.Message;
            }

            return(isSuccessful);
        }
Ejemplo n.º 38
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.dgSpies           = new System.Windows.Forms.DataGrid();
     this.myDS              = new VisQuery.theData();
     this.chkAgentID        = new System.Windows.Forms.CheckBox();
     this.chkCodeName       = new System.Windows.Forms.CheckBox();
     this.chkSpecialty      = new System.Windows.Forms.CheckBox();
     this.chkAssignment     = new System.Windows.Forms.CheckBox();
     this.label1            = new System.Windows.Forms.Label();
     this.label2            = new System.Windows.Forms.Label();
     this.lstField          = new System.Windows.Forms.ListBox();
     this.label3            = new System.Windows.Forms.Label();
     this.txtMatch          = new System.Windows.Forms.TextBox();
     this.lblQuery          = new System.Windows.Forms.Label();
     this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();
     this.myConnection      = new System.Data.SqlClient.SqlConnection();
     this.sqlInsertCommand1 = new System.Data.SqlClient.SqlCommand();
     this.sqlUpdateCommand1 = new System.Data.SqlClient.SqlCommand();
     this.sqlDeleteCommand1 = new System.Data.SqlClient.SqlCommand();
     this.myAdapter         = new System.Data.SqlClient.SqlDataAdapter();
     ((System.ComponentModel.ISupportInitialize)(this.dgSpies)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.myDS)).BeginInit();
     this.SuspendLayout();
     //
     // dgSpies
     //
     this.dgSpies.DataMember      = "Agents";
     this.dgSpies.DataSource      = this.myDS;
     this.dgSpies.HeaderForeColor = System.Drawing.SystemColors.ControlText;
     this.dgSpies.Location        = new System.Drawing.Point(48, 16);
     this.dgSpies.Name            = "dgSpies";
     this.dgSpies.Size            = new System.Drawing.Size(392, 144);
     this.dgSpies.TabIndex        = 0;
     //
     // myDS
     //
     this.myDS.DataSetName = "theData";
     this.myDS.Locale      = new System.Globalization.CultureInfo("en-US");
     this.myDS.Namespace   = "http://www.tempuri.org/theData.xsd";
     //
     // chkAgentID
     //
     this.chkAgentID.Location        = new System.Drawing.Point(40, 200);
     this.chkAgentID.Name            = "chkAgentID";
     this.chkAgentID.Size            = new System.Drawing.Size(112, 24);
     this.chkAgentID.TabIndex        = 1;
     this.chkAgentID.Text            = "AgentID";
     this.chkAgentID.CheckedChanged += new System.EventHandler(this.buildQuery);
     //
     // chkCodeName
     //
     this.chkCodeName.Location        = new System.Drawing.Point(40, 224);
     this.chkCodeName.Name            = "chkCodeName";
     this.chkCodeName.Size            = new System.Drawing.Size(112, 24);
     this.chkCodeName.TabIndex        = 2;
     this.chkCodeName.Text            = "CodeName";
     this.chkCodeName.CheckedChanged += new System.EventHandler(this.buildQuery);
     //
     // chkSpecialty
     //
     this.chkSpecialty.Location        = new System.Drawing.Point(40, 248);
     this.chkSpecialty.Name            = "chkSpecialty";
     this.chkSpecialty.Size            = new System.Drawing.Size(112, 24);
     this.chkSpecialty.TabIndex        = 3;
     this.chkSpecialty.Text            = "Specialty";
     this.chkSpecialty.CheckedChanged += new System.EventHandler(this.buildQuery);
     //
     // chkAssignment
     //
     this.chkAssignment.Location        = new System.Drawing.Point(40, 272);
     this.chkAssignment.Name            = "chkAssignment";
     this.chkAssignment.Size            = new System.Drawing.Size(112, 32);
     this.chkAssignment.TabIndex        = 4;
     this.chkAssignment.Text            = "Assignment";
     this.chkAssignment.CheckedChanged += new System.EventHandler(this.buildQuery);
     //
     // label1
     //
     this.label1.Font      = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
     this.label1.Location  = new System.Drawing.Point(32, 168);
     this.label1.Name      = "label1";
     this.label1.Size      = new System.Drawing.Size(120, 32);
     this.label1.TabIndex  = 5;
     this.label1.Text      = "SELECT";
     this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     //
     // label2
     //
     this.label2.Font      = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
     this.label2.Location  = new System.Drawing.Point(208, 168);
     this.label2.Name      = "label2";
     this.label2.Size      = new System.Drawing.Size(120, 32);
     this.label2.TabIndex  = 6;
     this.label2.Text      = "WHERE";
     this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     //
     // lstField
     //
     this.lstField.Items.AddRange(new object[] {
         "<ALL>",
         "AgentID",
         "CodeName",
         "Specialty",
         "Assignment"
     });
     this.lstField.Location              = new System.Drawing.Point(200, 216);
     this.lstField.Name                  = "lstField";
     this.lstField.Size                  = new System.Drawing.Size(72, 69);
     this.lstField.TabIndex              = 7;
     this.lstField.SelectedIndexChanged += new System.EventHandler(this.buildQuery);
     //
     // label3
     //
     this.label3.Font      = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
     this.label3.Location  = new System.Drawing.Point(280, 232);
     this.label3.Name      = "label3";
     this.label3.Size      = new System.Drawing.Size(32, 32);
     this.label3.TabIndex  = 8;
     this.label3.Text      = "=";
     this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     //
     // txtMatch
     //
     this.txtMatch.Location     = new System.Drawing.Point(328, 240);
     this.txtMatch.Name         = "txtMatch";
     this.txtMatch.Size         = new System.Drawing.Size(136, 20);
     this.txtMatch.TabIndex     = 9;
     this.txtMatch.Text         = "";
     this.txtMatch.TextChanged += new System.EventHandler(this.buildQuery);
     //
     // lblQuery
     //
     this.lblQuery.Location = new System.Drawing.Point(24, 328);
     this.lblQuery.Name     = "lblQuery";
     this.lblQuery.Size     = new System.Drawing.Size(424, 40);
     this.lblQuery.TabIndex = 10;
     this.lblQuery.Text     = "SELECT * FROM Agents";
     //
     // sqlSelectCommand1
     //
     this.sqlSelectCommand1.CommandText = "SELECT AgentID, CodeName, Specialty, Assignment FROM Agents";
     this.sqlSelectCommand1.Connection  = this.myConnection;
     //
     // myConnection
     //
     this.myConnection.ConnectionString = "data source=ANDY-MPECR6VC86\\VSTE;initial catalog=simpleSpy;integrated security=SS" +
                                          "PI;persist security info=False;workstation id=ANDY-MPECR6VC86;packet size=4096";
     //
     // sqlInsertCommand1
     //
     this.sqlInsertCommand1.CommandText = "INSERT INTO Agents(AgentID, CodeName, Specialty, Assignment) VALUES (@AgentID, @C" +
                                          "odeName, @Specialty, @Assignment); SELECT AgentID, CodeName, Specialty, Assignme" +
                                          "nt FROM Agents WHERE (AgentID = @AgentID)";
     this.sqlInsertCommand1.Connection = this.myConnection;
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@AgentID", System.Data.SqlDbType.Int, 4, "AgentID"));
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@CodeName", System.Data.SqlDbType.VarChar, 20, "CodeName"));
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Specialty", System.Data.SqlDbType.VarChar, 20, "Specialty"));
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Assignment", System.Data.SqlDbType.VarChar, 20, "Assignment"));
     //
     // sqlUpdateCommand1
     //
     this.sqlUpdateCommand1.CommandText = @"UPDATE Agents SET AgentID = @AgentID, CodeName = @CodeName, Specialty = @Specialty, Assignment = @Assignment WHERE (AgentID = @Original_AgentID) AND (Assignment = @Original_Assignment OR @Original_Assignment IS NULL AND Assignment IS NULL) AND (CodeName = @Original_CodeName OR @Original_CodeName IS NULL AND CodeName IS NULL) AND (Specialty = @Original_Specialty OR @Original_Specialty IS NULL AND Specialty IS NULL); SELECT AgentID, CodeName, Specialty, Assignment FROM Agents WHERE (AgentID = @AgentID)";
     this.sqlUpdateCommand1.Connection  = this.myConnection;
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@AgentID", System.Data.SqlDbType.Int, 4, "AgentID"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@CodeName", System.Data.SqlDbType.VarChar, 20, "CodeName"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Specialty", System.Data.SqlDbType.VarChar, 20, "Specialty"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Assignment", System.Data.SqlDbType.VarChar, 20, "Assignment"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_AgentID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "AgentID", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Assignment", System.Data.SqlDbType.VarChar, 20, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Assignment", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_CodeName", System.Data.SqlDbType.VarChar, 20, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "CodeName", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Specialty", System.Data.SqlDbType.VarChar, 20, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Specialty", System.Data.DataRowVersion.Original, null));
     //
     // sqlDeleteCommand1
     //
     this.sqlDeleteCommand1.CommandText = @"DELETE FROM Agents WHERE (AgentID = @Original_AgentID) AND (Assignment = @Original_Assignment OR @Original_Assignment IS NULL AND Assignment IS NULL) AND (CodeName = @Original_CodeName OR @Original_CodeName IS NULL AND CodeName IS NULL) AND (Specialty = @Original_Specialty OR @Original_Specialty IS NULL AND Specialty IS NULL)";
     this.sqlDeleteCommand1.Connection  = this.myConnection;
     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_AgentID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "AgentID", System.Data.DataRowVersion.Original, null));
     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Assignment", System.Data.SqlDbType.VarChar, 20, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Assignment", System.Data.DataRowVersion.Original, null));
     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_CodeName", System.Data.SqlDbType.VarChar, 20, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "CodeName", System.Data.DataRowVersion.Original, null));
     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Specialty", System.Data.SqlDbType.VarChar, 20, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Specialty", System.Data.DataRowVersion.Original, null));
     //
     // myAdapter
     //
     this.myAdapter.DeleteCommand = this.sqlDeleteCommand1;
     this.myAdapter.InsertCommand = this.sqlInsertCommand1;
     this.myAdapter.SelectCommand = this.sqlSelectCommand1;
     this.myAdapter.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "Agents", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("AgentID", "AgentID"),
             new System.Data.Common.DataColumnMapping("CodeName", "CodeName"),
             new System.Data.Common.DataColumnMapping("Specialty", "Specialty"),
             new System.Data.Common.DataColumnMapping("Assignment", "Assignment")
         })
     });
     this.myAdapter.UpdateCommand = this.sqlUpdateCommand1;
     //
     // VisQueryForm
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize        = new System.Drawing.Size(488, 381);
     this.Controls.AddRange(new System.Windows.Forms.Control[] {
         this.lblQuery,
         this.txtMatch,
         this.label3,
         this.lstField,
         this.label2,
         this.label1,
         this.chkAssignment,
         this.chkSpecialty,
         this.chkCodeName,
         this.chkAgentID,
         this.dgSpies
     });
     this.Name  = "VisQueryForm";
     this.Text  = "Visual Query Example";
     this.Load += new System.EventHandler(this.VisQueryForm_Load);
     ((System.ComponentModel.ISupportInitialize)(this.dgSpies)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.myDS)).EndInit();
     this.ResumeLayout(false);
 }
Ejemplo n.º 39
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.dsInterestRate1      = new BPS.BLL.Clients.DataSets.dsInterestRate();
     this.dsReqTypes1          = new BPS.BLL.ClientRequest.DataSets.dsReqTypes();
     this.sqlSelectClientsOrgs = new System.Data.SqlClient.SqlCommand();
     this.sqlSelectCommand3    = new System.Data.SqlClient.SqlCommand();
     this.sqlConnection1       = new System.Data.SqlClient.SqlConnection();
     this.daInterestRateList   = new System.Data.SqlClient.SqlDataAdapter();
     this.sqlDeleteCommand1    = new System.Data.SqlClient.SqlCommand();
     this.sqlInsertCommand1    = new System.Data.SqlClient.SqlCommand();
     this.sqlSelectCommand1    = new System.Data.SqlClient.SqlCommand();
     this.sqlUpdateCommand1    = new System.Data.SqlClient.SqlCommand();
     this.daReqTypes           = new System.Data.SqlClient.SqlDataAdapter();
     this.sqlSelectCommand4    = new System.Data.SqlClient.SqlCommand();
     this.dsInterestRateList1  = new BPS.BLL.Clients.DataSets.dsInterestRateList();
     ((System.ComponentModel.ISupportInitialize)(this.dsInterestRate1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.dsReqTypes1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.dsInterestRateList1)).BeginInit();
     //
     // dsInterestRate1
     //
     this.dsInterestRate1.DataSetName = "dsInterestRate";
     this.dsInterestRate1.Locale      = new System.Globalization.CultureInfo("en-US");
     //
     // dsReqTypes1
     //
     this.dsReqTypes1.DataSetName = "dsReqTypes";
     this.dsReqTypes1.Locale      = new System.Globalization.CultureInfo("ru-RU");
     //
     // sqlSelectClientsOrgs
     //
     this.sqlSelectClientsOrgs.CommandText = @"SELECT OrgsClients.ClientID, OrgsClients.OrgID, OrgsClients.Direction, OrgsClients.IsAvailable, Orgs.OrgName, Orgs.CodeINN, Orgs.IsRemoved FROM OrgsClients INNER JOIN Orgs ON OrgsClients.OrgID = Orgs.OrgID WHERE (OrgsClients.ClientID = @ClientID) AND (Orgs.IsRemoved = 0)";
     this.sqlSelectClientsOrgs.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ClientID", System.Data.SqlDbType.Int, 4, "ClientID"));
     //
     // sqlSelectCommand3
     //
     this.sqlSelectCommand3.CommandText = "[InterestRatesSelectCommand]";
     this.sqlSelectCommand3.CommandType = System.Data.CommandType.StoredProcedure;
     this.sqlSelectCommand3.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
     //
     // sqlConnection1
     //
     this.sqlConnection1.ConnectionString = ((string)(configurationAppSettings.GetValue("ConnectionString", typeof(string))));
     //
     // daInterestRateList
     //
     this.daInterestRateList.DeleteCommand = this.sqlDeleteCommand1;
     this.daInterestRateList.InsertCommand = this.sqlInsertCommand1;
     this.daInterestRateList.SelectCommand = this.sqlSelectCommand1;
     this.daInterestRateList.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "InterestRates", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("RateID", "RateID"),
             new System.Data.Common.DataColumnMapping("ClientID", "ClientID"),
             new System.Data.Common.DataColumnMapping("RequestTypeID", "RequestTypeID"),
             new System.Data.Common.DataColumnMapping("IsNormal", "IsNormal"),
             new System.Data.Common.DataColumnMapping("ServiceCharge", "ServiceCharge"),
             new System.Data.Common.DataColumnMapping("MaxSum", "MaxSum")
         })
     });
     this.daInterestRateList.UpdateCommand = this.sqlUpdateCommand1;
     //
     // sqlDeleteCommand1
     //
     this.sqlDeleteCommand1.CommandText = "DELETE FROM InterestRates WHERE (RateID = @Original_RateID)";
     this.sqlDeleteCommand1.Connection  = this.sqlConnection1;
     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_RateID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "RateID", System.Data.DataRowVersion.Original, null));
     //
     // sqlInsertCommand1
     //
     this.sqlInsertCommand1.CommandText = @"INSERT INTO InterestRates(ClientID, RequestTypeID, IsNormal, ServiceCharge, MaxSum) VALUES (@ClientID, @RequestTypeID, @IsNormal, @ServiceCharge, @MaxSum); SELECT RateID, ClientID, RequestTypeID, IsNormal, ServiceCharge, MaxSum FROM InterestRates WHERE (RateID = @@IDENTITY)";
     this.sqlInsertCommand1.Connection  = this.sqlConnection1;
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ClientID", System.Data.SqlDbType.Int, 4, "ClientID"));
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RequestTypeID", System.Data.SqlDbType.Int, 4, "RequestTypeID"));
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNormal", System.Data.SqlDbType.Bit, 1, "IsNormal"));
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ServiceCharge", System.Data.SqlDbType.Float, 8, "ServiceCharge"));
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MaxSum", System.Data.SqlDbType.Float, 8, "MaxSum"));
     //
     // sqlSelectCommand1
     //
     this.sqlSelectCommand1.CommandText = "SELECT RateID, ClientID, RequestTypeID, IsNormal, ServiceCharge, MaxSum FROM Inte" +
                                          "restRates";
     this.sqlSelectCommand1.Connection = this.sqlConnection1;
     //
     // sqlUpdateCommand1
     //
     this.sqlUpdateCommand1.CommandText = @"UPDATE InterestRates SET ClientID = @ClientID, RequestTypeID = @RequestTypeID, IsNormal = @IsNormal, ServiceCharge = @ServiceCharge, MaxSum = @MaxSum WHERE (RateID = @Original_RateID); SELECT RateID, ClientID, RequestTypeID, IsNormal, ServiceCharge, MaxSum FROM InterestRates WHERE (RateID = @RateID)";
     this.sqlUpdateCommand1.Connection  = this.sqlConnection1;
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ClientID", System.Data.SqlDbType.Int, 4, "ClientID"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RequestTypeID", System.Data.SqlDbType.Int, 4, "RequestTypeID"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsNormal", System.Data.SqlDbType.Bit, 1, "IsNormal"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ServiceCharge", System.Data.SqlDbType.Float, 8, "ServiceCharge"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@MaxSum", System.Data.SqlDbType.Float, 8, "MaxSum"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_RateID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "RateID", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RateID", System.Data.SqlDbType.Int, 4, "RateID"));
     //
     // daReqTypes
     //
     this.daReqTypes.SelectCommand = this.sqlSelectCommand4;
     this.daReqTypes.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "ClientsRequestTypes", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("RequestTypeID", "RequestTypeID"),
             new System.Data.Common.DataColumnMapping("RequestTypeName", "RequestTypeName"),
             new System.Data.Common.DataColumnMapping("IsInner", "IsInner")
         })
     });
     //
     // sqlSelectCommand4
     //
     this.sqlSelectCommand4.CommandText = "SELECT RequestTypeID, RequestTypeName, IsInner FROM ClientsRequestTypes";
     this.sqlSelectCommand4.Connection  = this.sqlConnection1;
     //
     // dsInterestRateList1
     //
     this.dsInterestRateList1.DataSetName = "dsInterestRateList";
     this.dsInterestRateList1.Locale      = new System.Globalization.CultureInfo("ru-RU");
     ((System.ComponentModel.ISupportInitialize)(this.dsInterestRate1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.dsReqTypes1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.dsInterestRateList1)).EndInit();
 }
Ejemplo n.º 40
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();
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(InfTabique));
     this.sqlDAInfTabiqueMdor = new System.Data.SqlClient.SqlDataAdapter();
     this.sqlSelectCommand1   = new System.Data.SqlClient.SqlCommand();
     this.sqlConn             = new System.Data.SqlClient.SqlConnection();
     this.dsInfTabiqueMdor1   = new LancNeo.dsInfTabiqueMdor();
     this.sqlDABusObra        = new System.Data.SqlClient.SqlDataAdapter();
     this.sqlCommand1         = new System.Data.SqlClient.SqlCommand();
     this.sqlDAFirmas         = new System.Data.SqlClient.SqlDataAdapter();
     this.sqlSelectCommand7   = new System.Data.SqlClient.SqlCommand();
     this.dsBusObra1          = new LancNeo.dsBusObra();
     this.dsFirmas1           = new LancNeo.dsFirmas();
     this.panel1              = new System.Windows.Forms.Panel();
     this.buscaBtn1           = new Soluciones2000.Tools.WinLib.BuscaBtn();
     this.dsTabiqueMdor1      = new LancNeo.dsTabiqueMdor();
     this.btnVistaPrevia      = new Soluciones2000.Tools.WinLib.tbBtn();
     this.chbLab              = new System.Windows.Forms.CheckBox();
     this.chbDuplicado        = new System.Windows.Forms.CheckBox();
     this.txtFolio            = new System.Windows.Forms.TextBox();
     this.Fecha               = new System.Windows.Forms.Label();
     this.cmbUnidad           = new System.Windows.Forms.ComboBox();
     this.dsUnidad1           = new LancNeo.dsUnidad();
     this.label5              = new System.Windows.Forms.Label();
     this.label2              = new System.Windows.Forms.Label();
     this.cmbIdObra           = new System.Windows.Forms.ComboBox();
     this.label1              = new System.Windows.Forms.Label();
     this.txtIdobra           = new System.Windows.Forms.TextBox();
     this.chbLeyenda          = new System.Windows.Forms.CheckBox();
     this.chbLab1             = new System.Windows.Forms.CheckBox();
     this.crvInfTabique       = new CrystalDecisions.Windows.Forms.CrystalReportViewer();
     this.sqlDAInfTabiqueResC = new System.Data.SqlClient.SqlDataAdapter();
     this.sqlSelectCommand2   = new System.Data.SqlClient.SqlCommand();
     this.sqlDAInfTabiqueResA = new System.Data.SqlClient.SqlDataAdapter();
     this.sqlCommand2         = new System.Data.SqlClient.SqlCommand();
     this.sqlDATabiqueMdor    = new System.Data.SqlClient.SqlDataAdapter();
     this.sqlSelectCommand3   = new System.Data.SqlClient.SqlCommand();
     this.cryRepTabique1      = new LancNeo.CryRepTabique();
     this.sqlDAUnidad         = new System.Data.SqlClient.SqlDataAdapter();
     this.sqlCommand3         = new System.Data.SqlClient.SqlCommand();
     this.sqlDANorma          = new System.Data.SqlClient.SqlDataAdapter();
     this.sqlSelectCommand4   = new System.Data.SqlClient.SqlCommand();
     ((System.ComponentModel.ISupportInitialize)(this.dsInfTabiqueMdor1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.dsBusObra1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.dsFirmas1)).BeginInit();
     this.panel1.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.dsTabiqueMdor1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.dsUnidad1)).BeginInit();
     this.SuspendLayout();
     //
     // sqlDAInfTabiqueMdor
     //
     this.sqlDAInfTabiqueMdor.SelectCommand = this.sqlSelectCommand1;
     this.sqlDAInfTabiqueMdor.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "TabiqueRep", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("Folio", "Folio"),
             new System.Data.Common.DataColumnMapping("IdObra", "IdObra"),
             new System.Data.Common.DataColumnMapping("ConsObra", "ConsObra"),
             new System.Data.Common.DataColumnMapping("FMuestreo", "FMuestreo"),
             new System.Data.Common.DataColumnMapping("FEnsaye", "FEnsaye"),
             new System.Data.Common.DataColumnMapping("Finforme", "Finforme"),
             new System.Data.Common.DataColumnMapping("Lab", "Lab"),
             new System.Data.Common.DataColumnMapping("Anos", "Anos"),
             new System.Data.Common.DataColumnMapping("Semana", "Semana"),
             new System.Data.Common.DataColumnMapping("Hoja", "Hoja"),
             new System.Data.Common.DataColumnMapping("MReducida", "MReducida"),
             new System.Data.Common.DataColumnMapping("Unidad", "Unidad"),
             new System.Data.Common.DataColumnMapping("Cumple", "Cumple"),
             new System.Data.Common.DataColumnMapping("Norma", "Norma"),
             new System.Data.Common.DataColumnMapping("Como", "Como"),
             new System.Data.Common.DataColumnMapping("ObsComo", "ObsComo"),
             new System.Data.Common.DataColumnMapping("Tipo", "Tipo"),
             new System.Data.Common.DataColumnMapping("Subtipo", "Subtipo"),
             new System.Data.Common.DataColumnMapping("Grado", "Grado"),
             new System.Data.Common.DataColumnMapping("Empleado", "Empleado"),
             new System.Data.Common.DataColumnMapping("Observac", "Observac"),
             new System.Data.Common.DataColumnMapping("Razonsocial", "Razonsocial"),
             new System.Data.Common.DataColumnMapping("Ubicacion", "Ubicacion"),
             new System.Data.Common.DataColumnMapping("Colonia", "Colonia"),
             new System.Data.Common.DataColumnMapping("Zona", "Zona")
         })
     });
     //
     // sqlSelectCommand1
     //
     this.sqlSelectCommand1.CommandText = "[TabiqueRep]";
     this.sqlSelectCommand1.CommandType = System.Data.CommandType.StoredProcedure;
     this.sqlSelectCommand1.Connection  = this.sqlConn;
     this.sqlSelectCommand1.Parameters.AddRange(new System.Data.SqlClient.SqlParameter[] {
         new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((byte)(0)), ((byte)(0)), "", System.Data.DataRowVersion.Current, null),
         new System.Data.SqlClient.SqlParameter("@IdObra", System.Data.SqlDbType.NVarChar, 6),
         new System.Data.SqlClient.SqlParameter("@Folio1", System.Data.SqlDbType.VarChar, 10)
     });
     //
     // sqlConn
     //
     this.sqlConn.ConnectionString = ((string)(configurationAppSettings.GetValue("sqlConn.ConnectionString", typeof(string))));
     this.sqlConn.FireInfoMessageEventOnUserErrors = false;
     //
     // dsInfTabiqueMdor1
     //
     this.dsInfTabiqueMdor1.DataSetName             = "dsInfTabiqueMdor";
     this.dsInfTabiqueMdor1.Locale                  = new System.Globalization.CultureInfo("es-MX");
     this.dsInfTabiqueMdor1.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;
     //
     // sqlDABusObra
     //
     this.sqlDABusObra.SelectCommand = this.sqlCommand1;
     this.sqlDABusObra.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "Obra", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("Idobra", "Idobra"),
             new System.Data.Common.DataColumnMapping("Ubicacion", "Ubicacion"),
             new System.Data.Common.DataColumnMapping("RFC", "RFC"),
             new System.Data.Common.DataColumnMapping("Facturar", "Facturar")
         })
     });
     //
     // sqlCommand1
     //
     this.sqlCommand1.CommandText = resources.GetString("sqlCommand1.CommandText");
     this.sqlCommand1.Connection  = this.sqlConn;
     //
     // sqlDAFirmas
     //
     this.sqlDAFirmas.SelectCommand = this.sqlSelectCommand7;
     this.sqlDAFirmas.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "Firmas", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("IdFirma", "IdFirma"),
             new System.Data.Common.DataColumnMapping("Nombre", "Nombre"),
             new System.Data.Common.DataColumnMapping("Cargo", "Cargo"),
             new System.Data.Common.DataColumnMapping("Imprime", "Imprime")
         })
     });
     //
     // sqlSelectCommand7
     //
     this.sqlSelectCommand7.CommandText = "SELECT IdFirma, Nombre, Cargo, Imprime FROM Firmas WHERE (Imprime = 1) ORDER BY I" +
                                          "dFirma";
     this.sqlSelectCommand7.Connection = this.sqlConn;
     //
     // dsBusObra1
     //
     this.dsBusObra1.DataSetName             = "dsBusObra";
     this.dsBusObra1.Locale                  = new System.Globalization.CultureInfo("es-MX");
     this.dsBusObra1.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;
     //
     // dsFirmas1
     //
     this.dsFirmas1.DataSetName             = "dsFirmas";
     this.dsFirmas1.Locale                  = new System.Globalization.CultureInfo("es-MX");
     this.dsFirmas1.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;
     //
     // panel1
     //
     this.panel1.BackColor   = System.Drawing.SystemColors.Highlight;
     this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
     this.panel1.Controls.Add(this.buscaBtn1);
     this.panel1.Controls.Add(this.btnVistaPrevia);
     this.panel1.Controls.Add(this.chbLab);
     this.panel1.Controls.Add(this.chbDuplicado);
     this.panel1.Controls.Add(this.txtFolio);
     this.panel1.Controls.Add(this.Fecha);
     this.panel1.Controls.Add(this.cmbUnidad);
     this.panel1.Controls.Add(this.label5);
     this.panel1.Controls.Add(this.label2);
     this.panel1.Controls.Add(this.cmbIdObra);
     this.panel1.Controls.Add(this.label1);
     this.panel1.Controls.Add(this.txtIdobra);
     this.panel1.Controls.Add(this.chbLeyenda);
     this.panel1.Controls.Add(this.chbLab1);
     this.panel1.Dock     = System.Windows.Forms.DockStyle.Top;
     this.panel1.Location = new System.Drawing.Point(0, 0);
     this.panel1.Name     = "panel1";
     this.panel1.Size     = new System.Drawing.Size(856, 109);
     this.panel1.TabIndex = 12;
     //
     // buscaBtn1
     //
     this.buscaBtn1.AnchoColTit  = true;
     this.buscaBtn1.AnchoDlgBusq = 450;
     this.buscaBtn1.BackColor    = System.Drawing.Color.Transparent;
     this.buscaBtn1.Datos        = this.dsTabiqueMdor1.TabiqueMdor;
     this.buscaBtn1.Icon         = ((System.Drawing.Icon)(resources.GetObject("buscaBtn1.Icon")));
     this.buscaBtn1.Location     = new System.Drawing.Point(560, 0);
     this.buscaBtn1.Name         = "buscaBtn1";
     this.buscaBtn1.Size         = new System.Drawing.Size(64, 64);
     this.buscaBtn1.TabIndex     = 2;
     this.buscaBtn1.Visible      = false;
     this.buscaBtn1.Click       += new System.EventHandler(this.buscaBtn1_Click);
     //
     // dsTabiqueMdor1
     //
     this.dsTabiqueMdor1.DataSetName             = "dsTabiqueMdor";
     this.dsTabiqueMdor1.Locale                  = new System.Globalization.CultureInfo("es-MX");
     this.dsTabiqueMdor1.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;
     //
     // btnVistaPrevia
     //
     this.btnVistaPrevia.BackColor = System.Drawing.Color.Transparent;
     this.btnVistaPrevia.Icon      = ((System.Drawing.Icon)(resources.GetObject("btnVistaPrevia.Icon")));
     this.btnVistaPrevia.Location  = new System.Drawing.Point(748, 7);
     this.btnVistaPrevia.Name      = "btnVistaPrevia";
     this.btnVistaPrevia.Size      = new System.Drawing.Size(64, 64);
     this.btnVistaPrevia.TabIndex  = 11;
     this.btnVistaPrevia.Visible   = false;
     this.btnVistaPrevia.Load     += new System.EventHandler(this.btnVistaPrevia_Load);
     this.btnVistaPrevia.Click    += new System.EventHandler(this.btnVistaPrevia_Click);
     //
     // chbLab
     //
     this.chbLab.Checked    = true;
     this.chbLab.CheckState = System.Windows.Forms.CheckState.Checked;
     this.chbLab.Location   = new System.Drawing.Point(562, 76);
     this.chbLab.Name       = "chbLab";
     this.chbLab.Size       = new System.Drawing.Size(115, 24);
     this.chbLab.TabIndex   = 78;
     this.chbLab.Text       = "Incluye laboratorio";
     //
     // chbDuplicado
     //
     this.chbDuplicado.Location = new System.Drawing.Point(628, 32);
     this.chbDuplicado.Name     = "chbDuplicado";
     this.chbDuplicado.Size     = new System.Drawing.Size(89, 24);
     this.chbDuplicado.TabIndex = 34;
     this.chbDuplicado.Text     = "¿Duplicado?";
     //
     // txtFolio
     //
     this.txtFolio.Location = new System.Drawing.Point(665, 6);
     this.txtFolio.Name     = "txtFolio";
     this.txtFolio.Size     = new System.Drawing.Size(56, 20);
     this.txtFolio.TabIndex = 33;
     //
     // Fecha
     //
     this.Fecha.AutoSize = true;
     this.Fecha.Location = new System.Drawing.Point(628, 8);
     this.Fecha.Name     = "Fecha";
     this.Fecha.Size     = new System.Drawing.Size(32, 13);
     this.Fecha.TabIndex = 32;
     this.Fecha.Text     = "Folio:";
     //
     // cmbUnidad
     //
     this.cmbUnidad.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.dsUnidad1, "Unidad.Undescr", true));
     this.cmbUnidad.DataBindings.Add(new System.Windows.Forms.Binding("SelectedValue", this.dsUnidad1, "Unidad.IdUnidad", true));
     this.cmbUnidad.DataSource    = this.dsUnidad1.Unidad;
     this.cmbUnidad.DisplayMember = "Undescr";
     this.cmbUnidad.Location      = new System.Drawing.Point(472, 32);
     this.cmbUnidad.Name          = "cmbUnidad";
     this.cmbUnidad.Size          = new System.Drawing.Size(80, 21);
     this.cmbUnidad.TabIndex      = 25;
     this.cmbUnidad.ValueMember   = "IdUnidad";
     //
     // dsUnidad1
     //
     this.dsUnidad1.DataSetName             = "dsUnidad";
     this.dsUnidad1.Locale                  = new System.Globalization.CultureInfo("es-MX");
     this.dsUnidad1.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;
     //
     // label5
     //
     this.label5.AutoSize = true;
     this.label5.Location = new System.Drawing.Point(429, 34);
     this.label5.Name     = "label5";
     this.label5.Size     = new System.Drawing.Size(44, 13);
     this.label5.TabIndex = 26;
     this.label5.Text     = "Unidad:";
     //
     // label2
     //
     this.label2.AutoSize = true;
     this.label2.Location = new System.Drawing.Point(440, 8);
     this.label2.Name     = "label2";
     this.label2.Size     = new System.Drawing.Size(33, 13);
     this.label2.TabIndex = 8;
     this.label2.Text     = "Obra:";
     //
     // cmbIdObra
     //
     this.cmbIdObra.DataSource            = this.dsBusObra1.Obra;
     this.cmbIdObra.DisplayMember         = "Idobra";
     this.cmbIdObra.Location              = new System.Drawing.Point(472, 6);
     this.cmbIdObra.Name                  = "cmbIdObra";
     this.cmbIdObra.Size                  = new System.Drawing.Size(80, 21);
     this.cmbIdObra.TabIndex              = 1;
     this.cmbIdObra.ValueMember           = "IdObra";
     this.cmbIdObra.SelectedIndexChanged += new System.EventHandler(this.cmbIdObra_SelectedIndexChanged);
     //
     // label1
     //
     this.label1.Font     = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.label1.Location = new System.Drawing.Point(8, 0);
     this.label1.Name     = "label1";
     this.label1.Size     = new System.Drawing.Size(392, 75);
     this.label1.TabIndex = 0;
     this.label1.Text     = "Informe de verificación de las propiedades físicas del ladrillo, tabique, block y" +
                            " adoquin";
     //
     // txtIdobra
     //
     this.txtIdobra.Location = new System.Drawing.Point(560, 32);
     this.txtIdobra.Name     = "txtIdobra";
     this.txtIdobra.ReadOnly = true;
     this.txtIdobra.Size     = new System.Drawing.Size(48, 20);
     this.txtIdobra.TabIndex = 2;
     this.txtIdobra.Visible  = false;
     //
     // chbLeyenda
     //
     this.chbLeyenda.Checked    = true;
     this.chbLeyenda.CheckState = System.Windows.Forms.CheckState.Checked;
     this.chbLeyenda.Location   = new System.Drawing.Point(432, 76);
     this.chbLeyenda.Name       = "chbLeyenda";
     this.chbLeyenda.Size       = new System.Drawing.Size(116, 24);
     this.chbLeyenda.TabIndex   = 33;
     this.chbLeyenda.Text       = "Formato leyenda";
     //
     // chbLab1
     //
     this.chbLab1.Checked    = true;
     this.chbLab1.CheckState = System.Windows.Forms.CheckState.Checked;
     this.chbLab1.Location   = new System.Drawing.Point(686, 76);
     this.chbLab1.Name       = "chbLab1";
     this.chbLab1.Size       = new System.Drawing.Size(140, 28);
     this.chbLab1.TabIndex   = 41;
     this.chbLab1.Text       = "Incluye laboratorista";
     //
     // crvInfTabique
     //
     this.crvInfTabique.ActiveViewIndex     = -1;
     this.crvInfTabique.BorderStyle         = System.Windows.Forms.BorderStyle.FixedSingle;
     this.crvInfTabique.Cursor              = System.Windows.Forms.Cursors.Default;
     this.crvInfTabique.Dock                = System.Windows.Forms.DockStyle.Fill;
     this.crvInfTabique.EnableRefresh       = false;
     this.crvInfTabique.Location            = new System.Drawing.Point(0, 109);
     this.crvInfTabique.Name                = "crvInfTabique";
     this.crvInfTabique.ShowCloseButton     = false;
     this.crvInfTabique.ShowGroupTreeButton = false;
     this.crvInfTabique.ShowLogo            = false;
     this.crvInfTabique.Size                = new System.Drawing.Size(856, 415);
     this.crvInfTabique.TabIndex            = 13;
     this.crvInfTabique.ToolPanelView       = CrystalDecisions.Windows.Forms.ToolPanelViewType.None;
     //
     // sqlDAInfTabiqueResC
     //
     this.sqlDAInfTabiqueResC.SelectCommand = this.sqlSelectCommand2;
     this.sqlDAInfTabiqueResC.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "TabiqueRep1", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("Folio", "Folio"),
             new System.Data.Common.DataColumnMapping("Muestra", "Muestra"),
             new System.Data.Common.DataColumnMapping("TMuestra", "TMuestra"),
             new System.Data.Common.DataColumnMapping("Largo", "Largo"),
             new System.Data.Common.DataColumnMapping("Ancho", "Ancho"),
             new System.Data.Common.DataColumnMapping("Peralte", "Peralte"),
             new System.Data.Common.DataColumnMapping("Area", "Area"),
             new System.Data.Common.DataColumnMapping("RcAInd", "RcAInd"),
             new System.Data.Common.DataColumnMapping("RcAPro", "RcAPro"),
             new System.Data.Common.DataColumnMapping("EspInd", "EspInd"),
             new System.Data.Common.DataColumnMapping("EspPro", "EspPro")
         })
     });
     //
     // sqlSelectCommand2
     //
     this.sqlSelectCommand2.CommandText = "[TabiqueRep1]";
     this.sqlSelectCommand2.CommandType = System.Data.CommandType.StoredProcedure;
     this.sqlSelectCommand2.Connection  = this.sqlConn;
     this.sqlSelectCommand2.Parameters.AddRange(new System.Data.SqlClient.SqlParameter[] {
         new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((byte)(0)), ((byte)(0)), "", System.Data.DataRowVersion.Current, null),
         new System.Data.SqlClient.SqlParameter("@IdObra", System.Data.SqlDbType.NVarChar, 6),
         new System.Data.SqlClient.SqlParameter("@Folio1", System.Data.SqlDbType.VarChar, 10),
         new System.Data.SqlClient.SqlParameter("@Prueba", System.Data.SqlDbType.Bit, 1),
         new System.Data.SqlClient.SqlParameter("@IdUnidad", System.Data.SqlDbType.SmallInt, 2)
     });
     //
     // sqlDAInfTabiqueResA
     //
     this.sqlDAInfTabiqueResA.SelectCommand = this.sqlCommand2;
     this.sqlDAInfTabiqueResA.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "TabiqueRep1", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("Folio", "Folio"),
             new System.Data.Common.DataColumnMapping("Muestra", "Muestra"),
             new System.Data.Common.DataColumnMapping("TMuestra", "TMuestra"),
             new System.Data.Common.DataColumnMapping("Largo", "Largo"),
             new System.Data.Common.DataColumnMapping("Ancho", "Ancho"),
             new System.Data.Common.DataColumnMapping("Peralte", "Peralte"),
             new System.Data.Common.DataColumnMapping("Area", "Area"),
             new System.Data.Common.DataColumnMapping("RcAInd", "RcAInd"),
             new System.Data.Common.DataColumnMapping("RcAPro", "RcAPro"),
             new System.Data.Common.DataColumnMapping("EspInd", "EspInd"),
             new System.Data.Common.DataColumnMapping("EspPro", "EspPro")
         })
     });
     //
     // sqlCommand2
     //
     this.sqlCommand2.CommandText = "[TabiqueRep1]";
     this.sqlCommand2.CommandType = System.Data.CommandType.StoredProcedure;
     this.sqlCommand2.Connection  = this.sqlConn;
     this.sqlCommand2.Parameters.AddRange(new System.Data.SqlClient.SqlParameter[] {
         new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((byte)(0)), ((byte)(0)), "", System.Data.DataRowVersion.Current, null),
         new System.Data.SqlClient.SqlParameter("@IdObra", System.Data.SqlDbType.NVarChar, 6),
         new System.Data.SqlClient.SqlParameter("@Folio1", System.Data.SqlDbType.VarChar, 10),
         new System.Data.SqlClient.SqlParameter("@Prueba", System.Data.SqlDbType.Bit, 1),
         new System.Data.SqlClient.SqlParameter("@IdUnidad", System.Data.SqlDbType.SmallInt, 2)
     });
     //
     // sqlDATabiqueMdor
     //
     this.sqlDATabiqueMdor.SelectCommand = this.sqlSelectCommand3;
     this.sqlDATabiqueMdor.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "TabiqueMdor", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("FOLIO", "FOLIO"),
             new System.Data.Common.DataColumnMapping("IdObra", "IdObra"),
             new System.Data.Common.DataColumnMapping("ConsObra", "ConsObra"),
             new System.Data.Common.DataColumnMapping("FMuestreo", "FMuestreo"),
             new System.Data.Common.DataColumnMapping("FEnsaye", "FEnsaye"),
             new System.Data.Common.DataColumnMapping("FInforme", "FInforme"),
             new System.Data.Common.DataColumnMapping("NoEco", "NoEco"),
             new System.Data.Common.DataColumnMapping("Semana", "Semana"),
             new System.Data.Common.DataColumnMapping("MReducida", "MReducida"),
             new System.Data.Common.DataColumnMapping("Unidad", "Unidad"),
             new System.Data.Common.DataColumnMapping("Cumple", "Cumple"),
             new System.Data.Common.DataColumnMapping("Norma", "Norma"),
             new System.Data.Common.DataColumnMapping("Como", "Como"),
             new System.Data.Common.DataColumnMapping("ObsComo", "ObsComo"),
             new System.Data.Common.DataColumnMapping("Tipo", "Tipo"),
             new System.Data.Common.DataColumnMapping("Subtipo", "Subtipo"),
             new System.Data.Common.DataColumnMapping("Grado", "Grado"),
             new System.Data.Common.DataColumnMapping("Empleado", "Empleado"),
             new System.Data.Common.DataColumnMapping("Observaciones", "Observaciones")
         })
     });
     //
     // sqlSelectCommand3
     //
     this.sqlSelectCommand3.CommandText = resources.GetString("sqlSelectCommand3.CommandText");
     this.sqlSelectCommand3.Connection  = this.sqlConn;
     this.sqlSelectCommand3.Parameters.AddRange(new System.Data.SqlClient.SqlParameter[] {
         new System.Data.SqlClient.SqlParameter("@IdObra", System.Data.SqlDbType.NVarChar, 6, "IdObra")
     });
     //
     // sqlDAUnidad
     //
     this.sqlDAUnidad.SelectCommand = this.sqlCommand3;
     this.sqlDAUnidad.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "Unidad", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("IdUnidad", "IdUnidad"),
             new System.Data.Common.DataColumnMapping("Factor", "Factor"),
             new System.Data.Common.DataColumnMapping("Undescr", "Undescr"),
             new System.Data.Common.DataColumnMapping("MaxagrUn", "MaxagrUn"),
             new System.Data.Common.DataColumnMapping("RevenUn", "RevenUn")
         })
     });
     //
     // sqlCommand3
     //
     this.sqlCommand3.CommandText = "SELECT IdUnidad, Factor, Undescr, MaxagrUn, RevenUn FROM Unidad";
     this.sqlCommand3.Connection  = this.sqlConn;
     //
     // sqlDANorma
     //
     this.sqlDANorma.SelectCommand = this.sqlSelectCommand4;
     this.sqlDANorma.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "Normas", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("IdNorma", "IdNorma"),
             new System.Data.Common.DataColumnMapping("Informe", "Informe"),
             new System.Data.Common.DataColumnMapping("Normas", "Normas"),
             new System.Data.Common.DataColumnMapping("Titulo", "Titulo"),
             new System.Data.Common.DataColumnMapping("IdInforme", "IdInforme"),
             new System.Data.Common.DataColumnMapping("Norma1", "Norma1"),
             new System.Data.Common.DataColumnMapping("Norma2", "Norma2"),
             new System.Data.Common.DataColumnMapping("Norma3", "Norma3"),
             new System.Data.Common.DataColumnMapping("Norma4", "Norma4"),
             new System.Data.Common.DataColumnMapping("Norma5", "Norma5")
         })
     });
     //
     // sqlSelectCommand4
     //
     this.sqlSelectCommand4.CommandText = "SELECT IdNorma, Informe, Normas, Titulo, IdInforme, Norma1, Norma2, Norma3, Norma" +
                                          "4, Norma5 FROM Normas WHERE (IdNorma = @IdNorma)";
     this.sqlSelectCommand4.Connection = this.sqlConn;
     this.sqlSelectCommand4.Parameters.AddRange(new System.Data.SqlClient.SqlParameter[] {
         new System.Data.SqlClient.SqlParameter("@IdNorma", System.Data.SqlDbType.SmallInt, 2, "IdNorma")
     });
     //
     // InfTabique
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize        = new System.Drawing.Size(856, 524);
     this.Controls.Add(this.crvInfTabique);
     this.Controls.Add(this.panel1);
     this.Name        = "InfTabique";
     this.Text        = "infTabique";
     this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
     this.Load       += new System.EventHandler(this.InfTabique_Load);
     ((System.ComponentModel.ISupportInitialize)(this.dsInfTabiqueMdor1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.dsBusObra1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.dsFirmas1)).EndInit();
     this.panel1.ResumeLayout(false);
     this.panel1.PerformLayout();
     ((System.ComponentModel.ISupportInitialize)(this.dsTabiqueMdor1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.dsUnidad1)).EndInit();
     this.ResumeLayout(false);
 }
Ejemplo n.º 41
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));
     Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor gridColumnDescriptor1 = new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor();
     Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor gridColumnDescriptor2 = new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor();
     Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor gridColumnDescriptor3 = new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor();
     Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor gridColumnDescriptor4 = new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor();
     this.dataSet11            = new XMLSerialization.DataSet1();
     this.sqlSelectCommand1    = new System.Data.SqlClient.SqlCommand();
     this.sqlConnection1       = new System.Data.SqlClient.SqlConnection();
     this.sqlInsertCommand1    = new System.Data.SqlClient.SqlCommand();
     this.sqlUpdateCommand1    = new System.Data.SqlClient.SqlCommand();
     this.sqlDeleteCommand1    = new System.Data.SqlClient.SqlCommand();
     this.sqlDataAdapter1      = new System.Data.SqlClient.SqlDataAdapter();
     this.reset                = new Syncfusion.Windows.Forms.ButtonAdv();
     this.btnLoadXmlSchema     = new Syncfusion.Windows.Forms.ButtonAdv();
     this.btnSaveXmlSchema     = new Syncfusion.Windows.Forms.ButtonAdv();
     this.gridGroupingControl1 = new Syncfusion.Windows.Forms.Grid.Grouping.GridGroupingControl();
     this.propertyGrid1        = new System.Windows.Forms.PropertyGrid();
     ((System.ComponentModel.ISupportInitialize)(this.dataSet11)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.gridGroupingControl1)).BeginInit();
     this.SuspendLayout();
     //
     // dataSet11
     //
     this.dataSet11.DataSetName             = "DataSet1";
     this.dataSet11.Locale                  = new System.Globalization.CultureInfo("en-US");
     this.dataSet11.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;
     //
     // sqlSelectCommand1
     //
     this.sqlSelectCommand1.CommandText = "SELECT CategoryID, CategoryName, Description, Picture FROM Categories";
     this.sqlSelectCommand1.Connection  = this.sqlConnection1;
     //
     // sqlConnection1
     //
     this.sqlConnection1.ConnectionString = "data source=(local)\\NETSDK;initial catalog=Northwind;integrated security=SSPI;per" +
                                            "sist security info=True;workstation id=localhost;packet size=4096";
     this.sqlConnection1.FireInfoMessageEventOnUserErrors = false;
     //
     // sqlInsertCommand1
     //
     this.sqlInsertCommand1.CommandText = resources.GetString("sqlInsertCommand1.CommandText");
     this.sqlInsertCommand1.Connection  = this.sqlConnection1;
     this.sqlInsertCommand1.Parameters.AddRange(new System.Data.SqlClient.SqlParameter[] {
         new System.Data.SqlClient.SqlParameter("@CategoryName", System.Data.SqlDbType.NVarChar, 15, "CategoryName"),
         new System.Data.SqlClient.SqlParameter("@Description", System.Data.SqlDbType.NVarChar, 1073741823, "Description"),
         new System.Data.SqlClient.SqlParameter("@Picture", System.Data.SqlDbType.VarBinary, 2147483647, "Picture")
     });
     //
     // sqlUpdateCommand1
     //
     this.sqlUpdateCommand1.CommandText = resources.GetString("sqlUpdateCommand1.CommandText");
     this.sqlUpdateCommand1.Connection  = this.sqlConnection1;
     this.sqlUpdateCommand1.Parameters.AddRange(new System.Data.SqlClient.SqlParameter[] {
         new System.Data.SqlClient.SqlParameter("@CategoryName", System.Data.SqlDbType.NVarChar, 15, "CategoryName"),
         new System.Data.SqlClient.SqlParameter("@Description", System.Data.SqlDbType.NVarChar, 1073741823, "Description"),
         new System.Data.SqlClient.SqlParameter("@Picture", System.Data.SqlDbType.VarBinary, 2147483647, "Picture"),
         new System.Data.SqlClient.SqlParameter("@Original_CategoryID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "CategoryID", System.Data.DataRowVersion.Original, null),
         new System.Data.SqlClient.SqlParameter("@Original_CategoryName", System.Data.SqlDbType.NVarChar, 15, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "CategoryName", System.Data.DataRowVersion.Original, null),
         new System.Data.SqlClient.SqlParameter("@CategoryID", System.Data.SqlDbType.Int, 4, "CategoryID")
     });
     //
     // sqlDeleteCommand1
     //
     this.sqlDeleteCommand1.CommandText = "DELETE FROM Categories WHERE (CategoryID = @Original_CategoryID) AND (CategoryNam" +
                                          "e = @Original_CategoryName)";
     this.sqlDeleteCommand1.Connection = this.sqlConnection1;
     this.sqlDeleteCommand1.Parameters.AddRange(new System.Data.SqlClient.SqlParameter[] {
         new System.Data.SqlClient.SqlParameter("@Original_CategoryID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "CategoryID", System.Data.DataRowVersion.Original, null),
         new System.Data.SqlClient.SqlParameter("@Original_CategoryName", System.Data.SqlDbType.NVarChar, 15, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "CategoryName", System.Data.DataRowVersion.Original, null)
     });
     //
     // sqlDataAdapter1
     //
     this.sqlDataAdapter1.DeleteCommand = this.sqlDeleteCommand1;
     this.sqlDataAdapter1.InsertCommand = this.sqlInsertCommand1;
     this.sqlDataAdapter1.SelectCommand = this.sqlSelectCommand1;
     this.sqlDataAdapter1.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "Categories", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("CategoryID", "CategoryID"),
             new System.Data.Common.DataColumnMapping("CategoryName", "CategoryName"),
             new System.Data.Common.DataColumnMapping("Description", "Description"),
             new System.Data.Common.DataColumnMapping("Picture", "Picture")
         })
     });
     this.sqlDataAdapter1.UpdateCommand = this.sqlUpdateCommand1;
     //
     // reset
     //
     this.reset.Anchor            = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     this.reset.Appearance        = Syncfusion.Windows.Forms.ButtonAppearance.Metro;
     this.reset.FlatStyle         = FlatStyle.Flat;
     this.reset.BackColor         = System.Drawing.Color.FromArgb(((int)(((byte)(22)))), ((int)(((byte)(165)))), ((int)(((byte)(220)))));
     this.reset.BeforeTouchSize   = new System.Drawing.Size(130, 28);
     this.reset.BorderStyleAdv    = Syncfusion.Windows.Forms.ButtonAdvBorderStyle.RaisedInner;
     this.reset.Font              = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.reset.ForeColor         = System.Drawing.Color.White;
     this.reset.IsBackStageButton = false;
     this.reset.Location          = new System.Drawing.Point(340, 615);
     this.reset.Name              = "reset";
     this.reset.Size              = new System.Drawing.Size(130, 28);
     this.reset.TabIndex          = 12;
     this.reset.Text              = "Reset Schema";
     this.reset.Click            += new System.EventHandler(this.reset_Click);
     //
     // btnLoadXmlSchema
     //
     this.btnLoadXmlSchema.Anchor            = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     this.btnLoadXmlSchema.Appearance        = Syncfusion.Windows.Forms.ButtonAppearance.Metro;
     this.btnLoadXmlSchema.FlatStyle         = FlatStyle.Flat;
     this.btnLoadXmlSchema.BackColor         = System.Drawing.Color.FromArgb(((int)(((byte)(22)))), ((int)(((byte)(165)))), ((int)(((byte)(220)))));
     this.btnLoadXmlSchema.BeforeTouchSize   = new System.Drawing.Size(130, 28);
     this.btnLoadXmlSchema.BorderStyleAdv    = Syncfusion.Windows.Forms.ButtonAdvBorderStyle.RaisedInner;
     this.btnLoadXmlSchema.Font              = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.btnLoadXmlSchema.ForeColor         = System.Drawing.Color.White;
     this.btnLoadXmlSchema.IsBackStageButton = false;
     this.btnLoadXmlSchema.Location          = new System.Drawing.Point(199, 615);
     this.btnLoadXmlSchema.Name              = "btnLoadXmlSchema";
     this.btnLoadXmlSchema.Size              = new System.Drawing.Size(130, 28);
     this.btnLoadXmlSchema.TabIndex          = 11;
     this.btnLoadXmlSchema.Text              = "Load Xml Schema";
     this.btnLoadXmlSchema.Click            += new System.EventHandler(this.btnLoadXmlSchema_Click);
     //
     // btnSaveXmlSchema
     //
     this.btnSaveXmlSchema.Anchor            = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     this.btnSaveXmlSchema.Appearance        = Syncfusion.Windows.Forms.ButtonAppearance.Metro;
     this.btnSaveXmlSchema.FlatStyle         = FlatStyle.Flat;
     this.btnSaveXmlSchema.BackColor         = System.Drawing.Color.FromArgb(((int)(((byte)(22)))), ((int)(((byte)(165)))), ((int)(((byte)(220)))));
     this.btnSaveXmlSchema.BeforeTouchSize   = new System.Drawing.Size(130, 28);
     this.btnSaveXmlSchema.BorderStyleAdv    = Syncfusion.Windows.Forms.ButtonAdvBorderStyle.RaisedInner;
     this.btnSaveXmlSchema.Font              = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.btnSaveXmlSchema.ForeColor         = System.Drawing.Color.White;
     this.btnSaveXmlSchema.IsBackStageButton = false;
     this.btnSaveXmlSchema.Location          = new System.Drawing.Point(60, 615);
     this.btnSaveXmlSchema.Name              = "btnSaveXmlSchema";
     this.btnSaveXmlSchema.Size              = new System.Drawing.Size(130, 28);
     this.btnSaveXmlSchema.TabIndex          = 10;
     this.btnSaveXmlSchema.Text              = "Save Xml Schema";
     this.btnSaveXmlSchema.Click            += new System.EventHandler(this.btnSaveXmlSchema_Click);
     //
     // gridGroupingControl1
     //
     this.gridGroupingControl1.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.gridGroupingControl1.BackColor        = System.Drawing.SystemColors.Window;
     this.gridGroupingControl1.DataSource       = this.dataSet11.Categories;
     this.gridGroupingControl1.Font             = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.gridGroupingControl1.FreezeCaption    = false;
     this.gridGroupingControl1.Location         = new System.Drawing.Point(15, 16);
     this.gridGroupingControl1.Name             = "gridGroupingControl1";
     this.gridGroupingControl1.Size             = new System.Drawing.Size(697, 589);
     this.gridGroupingControl1.TabIndex         = 9;
     gridColumnDescriptor1.HeaderImage          = null;
     gridColumnDescriptor1.HeaderImageAlignment = Syncfusion.Windows.Forms.Grid.Grouping.HeaderImageAlignment.Left;
     gridColumnDescriptor1.MappingName          = "CategoryID";
     gridColumnDescriptor1.SerializedImageArray = "";
     gridColumnDescriptor1.Width                = 80;
     gridColumnDescriptor2.HeaderImage          = null;
     gridColumnDescriptor2.HeaderImageAlignment = Syncfusion.Windows.Forms.Grid.Grouping.HeaderImageAlignment.Left;
     gridColumnDescriptor2.MappingName          = "CategoryName";
     gridColumnDescriptor2.SerializedImageArray = "";
     gridColumnDescriptor3.HeaderImage          = null;
     gridColumnDescriptor3.HeaderImageAlignment = Syncfusion.Windows.Forms.Grid.Grouping.HeaderImageAlignment.Left;
     gridColumnDescriptor3.MappingName          = "Description";
     gridColumnDescriptor3.SerializedImageArray = "";
     gridColumnDescriptor3.Width                = 250;
     gridColumnDescriptor4.HeaderImage          = null;
     gridColumnDescriptor4.HeaderImageAlignment = Syncfusion.Windows.Forms.Grid.Grouping.HeaderImageAlignment.Left;
     gridColumnDescriptor4.MappingName          = "Picture";
     gridColumnDescriptor4.SerializedImageArray = "";
     this.gridGroupingControl1.TableDescriptor.Columns.AddRange(new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnDescriptor[] {
         gridColumnDescriptor1,
         gridColumnDescriptor2,
         gridColumnDescriptor3,
         gridColumnDescriptor4
     });
     this.gridGroupingControl1.TableOptions.RecordRowHeight = 57;
     this.gridGroupingControl1.Text = "gridGroupingControl1";
     //
     // propertyGrid1
     //
     this.propertyGrid1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                       | System.Windows.Forms.AnchorStyles.Right)));
     this.propertyGrid1.BackColor                 = System.Drawing.Color.White;
     this.propertyGrid1.CommandsBackColor         = System.Drawing.Color.White;
     this.propertyGrid1.CommandsDisabledLinkColor = System.Drawing.Color.White;
     this.propertyGrid1.Font          = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.propertyGrid1.HelpBackColor = System.Drawing.Color.White;
     this.propertyGrid1.LineColor     = System.Drawing.Color.White;
     this.propertyGrid1.Location      = new System.Drawing.Point(720, 16);
     this.propertyGrid1.Name          = "propertyGrid1";
     this.propertyGrid1.Size          = new System.Drawing.Size(276, 589);
     this.propertyGrid1.TabIndex      = 13;
     //
     // Form1
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.ClientSize          = new System.Drawing.Size(1012, 653);
     this.Controls.Add(this.propertyGrid1);
     this.Controls.Add(this.reset);
     this.Controls.Add(this.btnLoadXmlSchema);
     this.Controls.Add(this.btnSaveXmlSchema);
     this.Controls.Add(this.gridGroupingControl1);
     this.MinimumSize = new System.Drawing.Size(800, 400);
     this.Name        = "Form1";
     this.Text        = "XML Serialization";
     ((System.ComponentModel.ISupportInitialize)(this.dataSet11)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.gridGroupingControl1)).EndInit();
     this.ResumeLayout(false);
 }
 public IDbCommand GetNewCommand()
 {
     System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand();
     return(cmd);
 }
Ejemplo n.º 43
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
     this.groupBox1         = new System.Windows.Forms.GroupBox();
     this.comboBoxBase1     = new Syncfusion.Windows.Forms.Tools.ComboBoxBase();
     this.gridListControl1  = new Syncfusion.Windows.Forms.Grid.GridListControl();
     this.dataSet11         = new ComboBoxBaseGridDemo.DataSet1();
     this.groupBox2         = new System.Windows.Forms.GroupBox();
     this.textLog           = new System.Windows.Forms.TextBox();
     this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();
     this.sqlConnection1    = new System.Data.SqlClient.SqlConnection();
     this.sqlInsertCommand1 = new System.Data.SqlClient.SqlCommand();
     this.sqlUpdateCommand1 = new System.Data.SqlClient.SqlCommand();
     this.sqlDeleteCommand1 = new System.Data.SqlClient.SqlCommand();
     this.sqlDataAdapter1   = new System.Data.SqlClient.SqlDataAdapter();
     this.groupBox1.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.comboBoxBase1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.gridListControl1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.dataSet11)).BeginInit();
     this.groupBox2.SuspendLayout();
     this.SuspendLayout();
     //
     // groupBox1
     //
     this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                   | System.Windows.Forms.AnchorStyles.Right)));
     this.groupBox1.Controls.Add(this.comboBoxBase1);
     this.groupBox1.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this.groupBox1.Font      = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.groupBox1.Location  = new System.Drawing.Point(106, 64);
     this.groupBox1.Name      = "groupBox1";
     this.groupBox1.Size      = new System.Drawing.Size(459, 56);
     this.groupBox1.TabIndex  = 0;
     this.groupBox1.TabStop   = false;
     this.groupBox1.Text      = "ComboBoxBase";
     //
     // comboBoxBase1
     //
     this.comboBoxBase1.Anchor                    = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
     this.comboBoxBase1.BackColor                 = System.Drawing.Color.White;
     this.comboBoxBase1.BeforeTouchSize           = new System.Drawing.Size(427, 21);
     this.comboBoxBase1.DropDownWidth             = 400;
     this.comboBoxBase1.Font                      = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.comboBoxBase1.ListControl               = this.gridListControl1;
     this.comboBoxBase1.Location                  = new System.Drawing.Point(16, 24);
     this.comboBoxBase1.Name                      = "comboBoxBase1";
     this.comboBoxBase1.Size                      = new System.Drawing.Size(427, 21);
     this.comboBoxBase1.Style                     = Syncfusion.Windows.Forms.VisualStyle.Metro;
     this.comboBoxBase1.TabIndex                  = 0;
     this.comboBoxBase1.DropDownCloseOnClick     += new Syncfusion.Windows.Forms.Tools.MouseClickCancelEventHandler(this.comboBoxBase1_DropDownCloseOnClick);
     this.comboBoxBase1.DropDown                 += new System.EventHandler(this.comboBoxBase1_DropDown);
     this.comboBoxBase1.SelectionChangeCommitted += new System.EventHandler(this.comboBoxBase1_SelectionChangeCommitted);
     this.comboBoxBase1.TextChanged              += new System.EventHandler(this.comboBoxBase1_TextChanged);
     this.comboBoxBase1.Validating               += new System.ComponentModel.CancelEventHandler(this.comboBoxBase1_Validating);
     this.comboBoxBase1.Validated                += new System.EventHandler(this.comboBoxBase1_Validated);
     //
     // gridListControl1
     //
     this.gridListControl1.AlphaBlendSelectionColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(94)))), ((int)(((byte)(171)))), ((int)(((byte)(222)))));
     this.gridListControl1.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.gridListControl1.BackColor                    = System.Drawing.Color.White;
     this.gridListControl1.BorderStyle                  = System.Windows.Forms.BorderStyle.FixedSingle;
     this.gridListControl1.DataSource                   = this.dataSet11.Products;
     this.gridListControl1.DisplayMember                = "ProductName";
     this.gridListControl1.GridVisualStyles             = Syncfusion.Windows.Forms.GridVisualStyles.Metro;
     this.gridListControl1.ItemHeight                   = 22;
     this.gridListControl1.Location                     = new System.Drawing.Point(-67, -75);
     this.gridListControl1.MultiColumn                  = true;
     this.gridListControl1.Name                         = "gridListControl1";
     this.gridListControl1.Properties.BackgroundColor   = System.Drawing.SystemColors.Window;
     this.gridListControl1.Properties.GridLineColor     = System.Drawing.Color.FromArgb(((int)(((byte)(212)))), ((int)(((byte)(212)))), ((int)(((byte)(212)))));
     this.gridListControl1.SelectedIndex                = -1;
     this.gridListControl1.Size                         = new System.Drawing.Size(552, 200);
     this.gridListControl1.SupportsTransparentBackColor = true;
     this.gridListControl1.TabIndex                     = 3;
     this.gridListControl1.ThemeName                    = "Metro";
     this.gridListControl1.ThemesEnabled                = true;
     this.gridListControl1.TopIndex                     = 0;
     this.gridListControl1.ValueMember                  = "ProductID";
     //
     // dataSet11
     //
     this.dataSet11.DataSetName             = "DataSet1";
     this.dataSet11.Locale                  = new System.Globalization.CultureInfo("en-US");
     this.dataSet11.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;
     //
     // groupBox2
     //
     this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                   | System.Windows.Forms.AnchorStyles.Right)));
     this.groupBox2.Controls.Add(this.gridListControl1);
     this.groupBox2.Controls.Add(this.textLog);
     this.groupBox2.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this.groupBox2.Font      = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.groupBox2.Location  = new System.Drawing.Point(106, 228);
     this.groupBox2.Name      = "groupBox2";
     this.groupBox2.Size      = new System.Drawing.Size(459, 144);
     this.groupBox2.TabIndex  = 4;
     this.groupBox2.TabStop   = false;
     this.groupBox2.Text      = "Event Log";
     //
     // textLog
     //
     this.textLog.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
                                                                 | System.Windows.Forms.AnchorStyles.Right)));
     this.textLog.Font       = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.textLog.Location   = new System.Drawing.Point(3, 18);
     this.textLog.Multiline  = true;
     this.textLog.Name       = "textLog";
     this.textLog.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
     this.textLog.Size       = new System.Drawing.Size(453, 123);
     this.textLog.TabIndex   = 0;
     //
     // sqlSelectCommand1
     //
     this.sqlSelectCommand1.CommandText = "SELECT ProductID, ProductName, SupplierID, CategoryID, QuantityPerUnit, UnitPrice" +
                                          ", UnitsInStock, UnitsOnOrder, ReorderLevel, Discontinued FROM Products";
     this.sqlSelectCommand1.Connection = this.sqlConnection1;
     //
     // sqlConnection1
     //
     this.sqlConnection1.ConnectionString = "Network Address=66.135.59.108,49489;initial catalog=NORTHWIND;password=Sync_sampl" +
                                            "es;persist security info=True;user id=sa;packet size=4096;Pooling=true";
     this.sqlConnection1.FireInfoMessageEventOnUserErrors = false;
     //
     // sqlInsertCommand1
     //
     this.sqlInsertCommand1.CommandText = resources.GetString("sqlInsertCommand1.CommandText");
     this.sqlInsertCommand1.Connection  = this.sqlConnection1;
     this.sqlInsertCommand1.Parameters.AddRange(new System.Data.SqlClient.SqlParameter[] {
         new System.Data.SqlClient.SqlParameter("@ProductName", System.Data.SqlDbType.NVarChar, 40, "ProductName"),
         new System.Data.SqlClient.SqlParameter("@SupplierID", System.Data.SqlDbType.Int, 4, "SupplierID"),
         new System.Data.SqlClient.SqlParameter("@CategoryID", System.Data.SqlDbType.Int, 4, "CategoryID"),
         new System.Data.SqlClient.SqlParameter("@QuantityPerUnit", System.Data.SqlDbType.NVarChar, 20, "QuantityPerUnit"),
         new System.Data.SqlClient.SqlParameter("@UnitPrice", System.Data.SqlDbType.Money, 8, "UnitPrice"),
         new System.Data.SqlClient.SqlParameter("@UnitsInStock", System.Data.SqlDbType.SmallInt, 2, "UnitsInStock"),
         new System.Data.SqlClient.SqlParameter("@UnitsOnOrder", System.Data.SqlDbType.SmallInt, 2, "UnitsOnOrder"),
         new System.Data.SqlClient.SqlParameter("@ReorderLevel", System.Data.SqlDbType.SmallInt, 2, "ReorderLevel"),
         new System.Data.SqlClient.SqlParameter("@Discontinued", System.Data.SqlDbType.Bit, 1, "Discontinued")
     });
     //
     // sqlUpdateCommand1
     //
     this.sqlUpdateCommand1.CommandText = resources.GetString("sqlUpdateCommand1.CommandText");
     this.sqlUpdateCommand1.Connection  = this.sqlConnection1;
     this.sqlUpdateCommand1.Parameters.AddRange(new System.Data.SqlClient.SqlParameter[] {
         new System.Data.SqlClient.SqlParameter("@ProductName", System.Data.SqlDbType.NVarChar, 40, "ProductName"),
         new System.Data.SqlClient.SqlParameter("@SupplierID", System.Data.SqlDbType.Int, 4, "SupplierID"),
         new System.Data.SqlClient.SqlParameter("@CategoryID", System.Data.SqlDbType.Int, 4, "CategoryID"),
         new System.Data.SqlClient.SqlParameter("@QuantityPerUnit", System.Data.SqlDbType.NVarChar, 20, "QuantityPerUnit"),
         new System.Data.SqlClient.SqlParameter("@UnitPrice", System.Data.SqlDbType.Money, 8, "UnitPrice"),
         new System.Data.SqlClient.SqlParameter("@UnitsInStock", System.Data.SqlDbType.SmallInt, 2, "UnitsInStock"),
         new System.Data.SqlClient.SqlParameter("@UnitsOnOrder", System.Data.SqlDbType.SmallInt, 2, "UnitsOnOrder"),
         new System.Data.SqlClient.SqlParameter("@ReorderLevel", System.Data.SqlDbType.SmallInt, 2, "ReorderLevel"),
         new System.Data.SqlClient.SqlParameter("@Discontinued", System.Data.SqlDbType.Bit, 1, "Discontinued"),
         new System.Data.SqlClient.SqlParameter("@Original_ProductID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "ProductID", System.Data.DataRowVersion.Original, null),
         new System.Data.SqlClient.SqlParameter("@Original_CategoryID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "CategoryID", System.Data.DataRowVersion.Original, null),
         new System.Data.SqlClient.SqlParameter("@Original_Discontinued", System.Data.SqlDbType.Bit, 1, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "Discontinued", System.Data.DataRowVersion.Original, null),
         new System.Data.SqlClient.SqlParameter("@Original_ProductName", System.Data.SqlDbType.NVarChar, 40, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "ProductName", System.Data.DataRowVersion.Original, null),
         new System.Data.SqlClient.SqlParameter("@Original_QuantityPerUnit", System.Data.SqlDbType.NVarChar, 20, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "QuantityPerUnit", System.Data.DataRowVersion.Original, null),
         new System.Data.SqlClient.SqlParameter("@Original_ReorderLevel", System.Data.SqlDbType.SmallInt, 2, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "ReorderLevel", System.Data.DataRowVersion.Original, null),
         new System.Data.SqlClient.SqlParameter("@Original_SupplierID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "SupplierID", System.Data.DataRowVersion.Original, null),
         new System.Data.SqlClient.SqlParameter("@Original_UnitPrice", System.Data.SqlDbType.Money, 8, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "UnitPrice", System.Data.DataRowVersion.Original, null),
         new System.Data.SqlClient.SqlParameter("@Original_UnitsInStock", System.Data.SqlDbType.SmallInt, 2, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "UnitsInStock", System.Data.DataRowVersion.Original, null),
         new System.Data.SqlClient.SqlParameter("@Original_UnitsOnOrder", System.Data.SqlDbType.SmallInt, 2, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "UnitsOnOrder", System.Data.DataRowVersion.Original, null),
         new System.Data.SqlClient.SqlParameter("@ProductID", System.Data.SqlDbType.Int, 4, "ProductID")
     });
     //
     // sqlDeleteCommand1
     //
     this.sqlDeleteCommand1.CommandText = resources.GetString("sqlDeleteCommand1.CommandText");
     this.sqlDeleteCommand1.Connection  = this.sqlConnection1;
     this.sqlDeleteCommand1.Parameters.AddRange(new System.Data.SqlClient.SqlParameter[] {
         new System.Data.SqlClient.SqlParameter("@Original_ProductID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "ProductID", System.Data.DataRowVersion.Original, null),
         new System.Data.SqlClient.SqlParameter("@Original_CategoryID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "CategoryID", System.Data.DataRowVersion.Original, null),
         new System.Data.SqlClient.SqlParameter("@Original_Discontinued", System.Data.SqlDbType.Bit, 1, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "Discontinued", System.Data.DataRowVersion.Original, null),
         new System.Data.SqlClient.SqlParameter("@Original_ProductName", System.Data.SqlDbType.NVarChar, 40, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "ProductName", System.Data.DataRowVersion.Original, null),
         new System.Data.SqlClient.SqlParameter("@Original_QuantityPerUnit", System.Data.SqlDbType.NVarChar, 20, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "QuantityPerUnit", System.Data.DataRowVersion.Original, null),
         new System.Data.SqlClient.SqlParameter("@Original_ReorderLevel", System.Data.SqlDbType.SmallInt, 2, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "ReorderLevel", System.Data.DataRowVersion.Original, null),
         new System.Data.SqlClient.SqlParameter("@Original_SupplierID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "SupplierID", System.Data.DataRowVersion.Original, null),
         new System.Data.SqlClient.SqlParameter("@Original_UnitPrice", System.Data.SqlDbType.Money, 8, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "UnitPrice", System.Data.DataRowVersion.Original, null),
         new System.Data.SqlClient.SqlParameter("@Original_UnitsInStock", System.Data.SqlDbType.SmallInt, 2, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "UnitsInStock", System.Data.DataRowVersion.Original, null),
         new System.Data.SqlClient.SqlParameter("@Original_UnitsOnOrder", System.Data.SqlDbType.SmallInt, 2, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "UnitsOnOrder", System.Data.DataRowVersion.Original, null)
     });
     //
     // sqlDataAdapter1
     //
     this.sqlDataAdapter1.DeleteCommand = this.sqlDeleteCommand1;
     this.sqlDataAdapter1.InsertCommand = this.sqlInsertCommand1;
     this.sqlDataAdapter1.SelectCommand = this.sqlSelectCommand1;
     this.sqlDataAdapter1.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "Products", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("ProductID", "ProductID"),
             new System.Data.Common.DataColumnMapping("ProductName", "ProductName"),
             new System.Data.Common.DataColumnMapping("SupplierID", "SupplierID"),
             new System.Data.Common.DataColumnMapping("CategoryID", "CategoryID"),
             new System.Data.Common.DataColumnMapping("QuantityPerUnit", "QuantityPerUnit"),
             new System.Data.Common.DataColumnMapping("UnitPrice", "UnitPrice"),
             new System.Data.Common.DataColumnMapping("UnitsInStock", "UnitsInStock"),
             new System.Data.Common.DataColumnMapping("UnitsOnOrder", "UnitsOnOrder"),
             new System.Data.Common.DataColumnMapping("ReorderLevel", "ReorderLevel"),
             new System.Data.Common.DataColumnMapping("Discontinued", "Discontinued")
         })
     });
     this.sqlDataAdapter1.UpdateCommand = this.sqlUpdateCommand1;
     //
     // Form1
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.ClientSize          = new System.Drawing.Size(687, 464);
     this.Controls.Add(this.groupBox1);
     this.Controls.Add(this.groupBox2);
     this.MinimumSize = new System.Drawing.Size(600, 400);
     this.Name        = "Form1";
     this.Text        = "&";
     this.groupBox1.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.comboBoxBase1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.gridListControl1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.dataSet11)).EndInit();
     this.groupBox2.ResumeLayout(false);
     this.groupBox2.PerformLayout();
     this.ResumeLayout(false);
 }
Ejemplo n.º 44
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();
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Concretera));
     this.sqlDAConcretera   = new System.Data.SqlClient.SqlDataAdapter();
     this.sqlDeleteCommand1 = new System.Data.SqlClient.SqlCommand();
     this.sqlConn           = new System.Data.SqlClient.SqlConnection();
     this.sqlInsertCommand1 = new System.Data.SqlClient.SqlCommand();
     this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();
     this.sqlUpdateCommand1 = new System.Data.SqlClient.SqlCommand();
     this.dsConcretera1     = new LancNeo.dsConcretera();
     this.lblIdConcretera   = new System.Windows.Forms.Label();
     this.lblConcretera     = new System.Windows.Forms.Label();
     this.lblDireccion      = new System.Windows.Forms.Label();
     this.txtIdConcretera   = new System.Windows.Forms.TextBox();
     this.txtConcretera     = new System.Windows.Forms.TextBox();
     this.txtDireccion      = new System.Windows.Forms.TextBox();
     this.panel1            = new System.Windows.Forms.Panel();
     this.buscaBtn1         = new Soluciones2000.Tools.WinLib.BuscaBtn();
     this.panelToolBar.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.dsConcretera1)).BeginInit();
     this.panel1.SuspendLayout();
     this.SuspendLayout();
     //
     // statusBar1
     //
     this.statusBar1.ShowPanels = true;
     this.statusBar1.Size       = new System.Drawing.Size(576, 22);
     //
     // panelToolBar
     //
     this.panelToolBar.Size = new System.Drawing.Size(576, 64);
     //
     // sqlDAConcretera
     //
     this.sqlDAConcretera.DeleteCommand = this.sqlDeleteCommand1;
     this.sqlDAConcretera.InsertCommand = this.sqlInsertCommand1;
     this.sqlDAConcretera.SelectCommand = this.sqlSelectCommand1;
     this.sqlDAConcretera.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "Concretera", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("IdConcretera", "IdConcretera"),
             new System.Data.Common.DataColumnMapping("Concretera", "Concretera"),
             new System.Data.Common.DataColumnMapping("Direccion", "Direccion")
         })
     });
     this.sqlDAConcretera.UpdateCommand = this.sqlUpdateCommand1;
     //
     // sqlDeleteCommand1
     //
     this.sqlDeleteCommand1.CommandText = "DELETE FROM Concretera WHERE (IdConcretera = @Original_IdConcretera) AND (Concret" +
                                          "era = @Original_Concretera) AND (Direccion = @Original_Direccion OR @Original_Di" +
                                          "reccion IS NULL AND Direccion IS NULL)";
     this.sqlDeleteCommand1.Connection = this.sqlConn;
     this.sqlDeleteCommand1.Parameters.AddRange(new System.Data.SqlClient.SqlParameter[] {
         new System.Data.SqlClient.SqlParameter("@Original_IdConcretera", System.Data.SqlDbType.NVarChar, 10, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "IdConcretera", System.Data.DataRowVersion.Original, null),
         new System.Data.SqlClient.SqlParameter("@Original_Concretera", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "Concretera", System.Data.DataRowVersion.Original, null),
         new System.Data.SqlClient.SqlParameter("@Original_Direccion", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "Direccion", System.Data.DataRowVersion.Original, null)
     });
     //
     // sqlConn
     //
     this.sqlConn.ConnectionString = ((string)(configurationAppSettings.GetValue("sqlConn.ConnectionString", typeof(string))));
     this.sqlConn.FireInfoMessageEventOnUserErrors = false;
     //
     // sqlInsertCommand1
     //
     this.sqlInsertCommand1.CommandText = resources.GetString("sqlInsertCommand1.CommandText");
     this.sqlInsertCommand1.Connection  = this.sqlConn;
     this.sqlInsertCommand1.Parameters.AddRange(new System.Data.SqlClient.SqlParameter[] {
         new System.Data.SqlClient.SqlParameter("@IdConcretera", System.Data.SqlDbType.NVarChar, 10, "IdConcretera"),
         new System.Data.SqlClient.SqlParameter("@Concretera", System.Data.SqlDbType.NVarChar, 50, "Concretera"),
         new System.Data.SqlClient.SqlParameter("@Direccion", System.Data.SqlDbType.NVarChar, 50, "Direccion")
     });
     //
     // sqlSelectCommand1
     //
     this.sqlSelectCommand1.CommandText = "SELECT IdConcretera, Concretera, Direccion FROM Concretera";
     this.sqlSelectCommand1.Connection  = this.sqlConn;
     //
     // sqlUpdateCommand1
     //
     this.sqlUpdateCommand1.CommandText = resources.GetString("sqlUpdateCommand1.CommandText");
     this.sqlUpdateCommand1.Connection  = this.sqlConn;
     this.sqlUpdateCommand1.Parameters.AddRange(new System.Data.SqlClient.SqlParameter[] {
         new System.Data.SqlClient.SqlParameter("@IdConcretera", System.Data.SqlDbType.NVarChar, 10, "IdConcretera"),
         new System.Data.SqlClient.SqlParameter("@Concretera", System.Data.SqlDbType.NVarChar, 50, "Concretera"),
         new System.Data.SqlClient.SqlParameter("@Direccion", System.Data.SqlDbType.NVarChar, 50, "Direccion"),
         new System.Data.SqlClient.SqlParameter("@Original_IdConcretera", System.Data.SqlDbType.NVarChar, 10, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "IdConcretera", System.Data.DataRowVersion.Original, null),
         new System.Data.SqlClient.SqlParameter("@Original_Concretera", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "Concretera", System.Data.DataRowVersion.Original, null),
         new System.Data.SqlClient.SqlParameter("@Original_Direccion", System.Data.SqlDbType.NVarChar, 50, System.Data.ParameterDirection.Input, false, ((byte)(0)), ((byte)(0)), "Direccion", System.Data.DataRowVersion.Original, null)
     });
     //
     // dsConcretera1
     //
     this.dsConcretera1.DataSetName             = "dsConcretera";
     this.dsConcretera1.Locale                  = new System.Globalization.CultureInfo("es-MX");
     this.dsConcretera1.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;
     //
     // lblIdConcretera
     //
     this.lblIdConcretera.Location  = new System.Drawing.Point(16, 48);
     this.lblIdConcretera.Name      = "lblIdConcretera";
     this.lblIdConcretera.Size      = new System.Drawing.Size(80, 23);
     this.lblIdConcretera.TabIndex  = 3;
     this.lblIdConcretera.Text      = "Id Concretera:";
     this.lblIdConcretera.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
     //
     // lblConcretera
     //
     this.lblConcretera.Location  = new System.Drawing.Point(16, 88);
     this.lblConcretera.Name      = "lblConcretera";
     this.lblConcretera.Size      = new System.Drawing.Size(80, 23);
     this.lblConcretera.TabIndex  = 3;
     this.lblConcretera.Text      = "Concretera:";
     this.lblConcretera.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
     //
     // lblDireccion
     //
     this.lblDireccion.Location  = new System.Drawing.Point(16, 128);
     this.lblDireccion.Name      = "lblDireccion";
     this.lblDireccion.Size      = new System.Drawing.Size(80, 23);
     this.lblDireccion.TabIndex  = 3;
     this.lblDireccion.Text      = "Dirección:";
     this.lblDireccion.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
     //
     // txtIdConcretera
     //
     this.txtIdConcretera.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.dsConcretera1, "Concretera.IdConcretera", true));
     this.txtIdConcretera.Location = new System.Drawing.Point(112, 48);
     this.txtIdConcretera.Name     = "txtIdConcretera";
     this.txtIdConcretera.Size     = new System.Drawing.Size(128, 20);
     this.txtIdConcretera.TabIndex = 4;
     this.txtIdConcretera.Text     = "textBox1";
     //
     // txtConcretera
     //
     this.txtConcretera.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.dsConcretera1, "Concretera.Concretera", true));
     this.txtConcretera.Location = new System.Drawing.Point(112, 88);
     this.txtConcretera.Name     = "txtConcretera";
     this.txtConcretera.Size     = new System.Drawing.Size(256, 20);
     this.txtConcretera.TabIndex = 4;
     this.txtConcretera.Text     = "textBox1";
     //
     // txtDireccion
     //
     this.txtDireccion.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.dsConcretera1, "Concretera.Direccion", true));
     this.txtDireccion.Location = new System.Drawing.Point(112, 128);
     this.txtDireccion.Name     = "txtDireccion";
     this.txtDireccion.Size     = new System.Drawing.Size(256, 20);
     this.txtDireccion.TabIndex = 4;
     this.txtDireccion.Text     = "textBox1";
     //
     // panel1
     //
     this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
     this.panel1.Controls.Add(this.buscaBtn1);
     this.panel1.Controls.Add(this.lblIdConcretera);
     this.panel1.Controls.Add(this.lblConcretera);
     this.panel1.Controls.Add(this.lblDireccion);
     this.panel1.Controls.Add(this.txtIdConcretera);
     this.panel1.Controls.Add(this.txtConcretera);
     this.panel1.Controls.Add(this.txtDireccion);
     this.panel1.Location = new System.Drawing.Point(96, 96);
     this.panel1.Name     = "panel1";
     this.panel1.Size     = new System.Drawing.Size(384, 192);
     this.panel1.TabIndex = 9;
     //
     // buscaBtn1
     //
     this.buscaBtn1.AnchoDlgBusq = 0;
     this.buscaBtn1.BackColor    = System.Drawing.Color.Transparent;
     this.buscaBtn1.Datos        = this.dsConcretera1.Concretera;
     this.buscaBtn1.Icon         = ((System.Drawing.Icon)(resources.GetObject("buscaBtn1.Icon")));
     this.buscaBtn1.Location     = new System.Drawing.Point(240, 16);
     this.buscaBtn1.Name         = "buscaBtn1";
     this.buscaBtn1.Size         = new System.Drawing.Size(64, 64);
     this.buscaBtn1.TabIndex     = 5;
     this.toolTip1.SetToolTip(this.buscaBtn1, "Buscar");
     //
     // Concretera
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize        = new System.Drawing.Size(576, 423);
     this.Controls.Add(this.panel1);
     this.DAGeneral   = this.sqlDAConcretera;
     this.dsGeneral   = this.dsConcretera1;
     this.Name        = "Concretera";
     this.NombreTabla = "Concretera";
     this.Text        = "Catálogo de Concreteras y Premezcladoras";
     this.Load       += new System.EventHandler(this.Concretera_Load);
     this.Controls.SetChildIndex(this.statusBar1, 0);
     this.Controls.SetChildIndex(this.panelToolBar, 0);
     this.Controls.SetChildIndex(this.panel1, 0);
     this.panelToolBar.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.dsConcretera1)).EndInit();
     this.panel1.ResumeLayout(false);
     this.panel1.PerformLayout();
     this.ResumeLayout(false);
 }
Ejemplo n.º 45
0
        private void login_btnIngresar_Click(object sender, EventArgs e)
        {
            //Valido el usuario y contraseña
            List <string> listaValidacion = new List <string>();
            string        pass_BD;
            string        pass_ingresada;
            int           id_usuario;
            int           intentos_fallidos;
            string        estado_usu;
            int           forzar_cambio;
            SHA256Managed encriptacionSha256 = new SHA256Managed();

            //Validamos los campos obligatorios
            if (this.login_txtUsr.Text == String.Empty)
            {
                listaValidacion.Add("El Nombre de usuario es obligatorio");
            }

            if (this.login_txtpass.Text == String.Empty)
            {
                listaValidacion.Add("La Contraseña es obligatoria");
            }

            //Muestro un mensaje con los datos mal cargados
            if (listaValidacion.Count > 0)
            {
                StringBuilder error = new StringBuilder();
                error.AppendLine("Por favor corrija los siguientes campos:");

                foreach (var i in listaValidacion)
                {
                    error.AppendLine(i);
                }

                MessageBox.Show(error.ToString());
                return;
            }

            /////////////////////////
            //Validacion del login //
            /////////////////////////
            pass_ingresada =
                Convert.ToBase64String(encriptacionSha256.ComputeHash(System.Text.Encoding.UTF8.GetBytes(this.login_txtpass.Text)));

            //Traigo la contraseña de la BD
            System.Data.SqlClient.SqlCommand comPass = new System.Data.SqlClient.SqlCommand("LOS_GESTORES.sp_app_getPassXNombre");

            //Defino los parametros
            System.Data.SqlClient.SqlParameter p1 = new System.Data.SqlClient.SqlParameter("@nombre", this.login_txtUsr.Text.Trim());

            //Agrego el parametro a la lista de parametros
            comPass.Parameters.Add(p1);

            // Abro la conexion
            AccesoDatos.getInstancia().abrirConexion();

            System.Data.SqlClient.SqlDataReader dup = AccesoDatos.getInstancia().ejecutaSP(comPass);

            if (!dup.HasRows)
            {
                // Cierro la conexion
                dup.Close();
                AccesoDatos.getInstancia().cerrarConexion();

                MessageBox.Show("Usuario Inexistente");
                return;
            }

            dup.Read();
            pass_BD           = dup.GetString(0);
            intentos_fallidos = dup.GetInt16(1);
            estado_usu        = dup.GetString(2);
            forzar_cambio     = dup.GetInt16(3);

            // Cierro la conexion
            dup.Close();
            AccesoDatos.getInstancia().cerrarConexion();

            if (!estado_usu.Equals("Habilitado"))
            {
                MessageBox.Show("Su usuario no puede ingresar al sistema, contactese con los administradores");
                return;
            }

            if (!pass_ingresada.Equals(pass_BD))
            {
                //Registro el intento fallido
                System.Data.SqlClient.SqlCommand comFalla = new System.Data.SqlClient.SqlCommand("LOS_GESTORES.sp_app_setFallaLoginXNombre");

                //Defino los parametros
                System.Data.SqlClient.SqlParameter pFalla = new System.Data.SqlClient.SqlParameter("@nombre", this.login_txtUsr.Text.Trim());

                //Agrego el parametro a la lista de parametros
                comFalla.Parameters.Add(pFalla);

                // Abro la conexion
                AccesoDatos.getInstancia().abrirConexion();

                System.Data.SqlClient.SqlDataReader falla = AccesoDatos.getInstancia().ejecutaSP(comFalla);

                // Cierro la conexion
                falla.Close();
                AccesoDatos.getInstancia().cerrarConexion();

                MessageBox.Show("Contraseña incorrecta");
                return;
            }

            //Reseteo los intentos fallidos
            System.Data.SqlClient.SqlCommand comReset = new System.Data.SqlClient.SqlCommand("LOS_GESTORES.sp_app_resetIntentosXNombre");

            //Defino los parametros
            System.Data.SqlClient.SqlParameter pReset = new System.Data.SqlClient.SqlParameter("@nombre", this.login_txtUsr.Text.Trim());

            //Agrego el parametro a la lista de parametros
            comReset.Parameters.Add(pReset);

            // Abro la conexion
            AccesoDatos.getInstancia().abrirConexion();

            System.Data.SqlClient.SqlDataReader reset = AccesoDatos.getInstancia().ejecutaSP(comReset);

            // Cierro la conexion
            reset.Close();
            AccesoDatos.getInstancia().cerrarConexion();

            ////////////////////////////////
            //     Roles del usuario      //
            ////////////////////////////////
            //Primero traigo el ID de Usuario
            System.Data.SqlClient.SqlCommand comUsuario = new System.Data.SqlClient.SqlCommand("LOS_GESTORES.sp_app_getIdUsuarioXNombre");
            //Defino los parametros
            System.Data.SqlClient.SqlParameter pUsu = new System.Data.SqlClient.SqlParameter("@nombre", this.login_txtUsr.Text.Trim());
            //Agrego el parametro a la lista de parametros
            comUsuario.Parameters.Add(pUsu);
            // Abro la conexion
            AccesoDatos.getInstancia().abrirConexion();
            System.Data.SqlClient.SqlDataReader idusuario = AccesoDatos.getInstancia().ejecutaSP(comUsuario);

            idusuario.Read();
            id_usuario = idusuario.GetInt32(0);

            // Cierro la conexion
            reset.Close();
            AccesoDatos.getInstancia().cerrarConexion();

            //Traigo los roles asociados
            System.Data.SqlClient.SqlCommand   comRoles = new System.Data.SqlClient.SqlCommand("LOS_GESTORES.sp_app_getRolesUsuario");
            System.Data.SqlClient.SqlParameter pRoles   = new System.Data.SqlClient.SqlParameter("@id_usuario", id_usuario);
            comRoles.Parameters.Add(pRoles);

            // Abro la conexion
            AccesoDatos.getInstancia().abrirConexion();
            System.Data.SqlClient.SqlDataReader roles = AccesoDatos.getInstancia().ejecutaSP(comRoles);

            //Cargo el array del resultado
            ArrayList listaRoles = new ArrayList();
            int       it         = 0;

            while (roles.Read())
            {
                listaRoles.Add(new DTO.RolDTO(roles.GetInt32(0), roles.GetString(1)));
                it++;
            }

            // Cierro la conexion
            roles.Close();
            AccesoDatos.getInstancia().cerrarConexion();

            if (listaRoles.Count == 0)
            {
                MessageBox.Show("No posee roles habilitados en el sistema. Contactese con los administradores");
                return;
            }

            //guardo el id_usuario en el aplicativo
            this.ppal_id_usuario = id_usuario;

            if (forzar_cambio == 1)
            {
                MessageBox.Show("Debe modificar su contraseña.");

                Pass.ModPass fPass = new FrbaCommerce.Pass.ModPass();
                fPass.idusuario = this.ppal_id_usuario;
                fPass.ShowDialog();
                return;
            }

            //Si tiene mas de un rol despliego el form de seleccion
            int id_rol_seleccionado;

            if (listaRoles.Count > 1)
            {
                Perfil fPerfil = new Perfil(listaRoles);
                fPerfil.ShowDialog();
                id_rol_seleccionado = fPerfil.getRolSeleccionado();
            }
            else
            {
                id_rol_seleccionado = ((DTO.RolDTO)listaRoles[0]).idRol;
            }

            //guardo el id_rol en el aplicativo
            this.ppal_id_rol = id_rol_seleccionado;

            //Traigo las funciones asociadas al rol
            System.Data.SqlClient.SqlCommand   comFunc = new System.Data.SqlClient.SqlCommand("LOS_GESTORES.sp_app_getFuncionesRol");
            System.Data.SqlClient.SqlParameter pFunc   = new System.Data.SqlClient.SqlParameter("@id_rol", ppal_id_rol);
            comFunc.Parameters.Add(pFunc);

            // Abro la conexion
            AccesoDatos.getInstancia().abrirConexion();
            System.Data.SqlClient.SqlDataReader funciones = AccesoDatos.getInstancia().ejecutaSP(comFunc);

            //Cargo el array del resultado
            ArrayList listaFunc = new ArrayList();

            while (funciones.Read())
            {
                listaFunc.Add(new DTO.RolDTO(funciones.GetInt32(0), funciones.GetString(1)));
            }

            // Cierro la conexion
            funciones.Close();
            AccesoDatos.getInstancia().cerrarConexion();

            listaFunciones.DataSource    = listaFunc;
            listaFunciones.DisplayMember = "descRol";
            listaFunciones.ValueMember   = "idRol";


            // Blanqueo y Habilito el proximo panel
            this.login_txtUsr.Clear();
            this.login_txtpass.Clear();
            this.panelInicio.Hide();
            this.panelPpal.Show();
        }
Ejemplo n.º 46
0
 /// <summary>
 /// 设计器支持所需的方法 - 不要使用代码编辑器修改
 /// 此方法的内容。
 /// </summary>
 private void InitializeComponent()
 {
     this.sqlConnection1    = new System.Data.SqlClient.SqlConnection();
     this.sqlDataAdapter_ly = new System.Data.SqlClient.SqlDataAdapter();
     this.sqlDeleteCommand1 = new System.Data.SqlClient.SqlCommand();
     this.sqlInsertCommand1 = new System.Data.SqlClient.SqlCommand();
     this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();
     this.sqlUpdateCommand1 = new System.Data.SqlClient.SqlCommand();
     this.dataSet_ly        = new tickets.DataSet_ly();
     ((System.ComponentModel.ISupportInitialize)(this.dataSet_ly)).BeginInit();
     this.Button_sc.Click       += new System.EventHandler(this.Button_sc_Click);
     this.Button_fh.Click       += new System.EventHandler(this.Button_fh_Click);
     this.Button_cx.Click       += new System.EventHandler(this.Button_cx_Click);
     this.Button_plsc.Click     += new System.EventHandler(this.Button_plsc_Click);
     this.DataGrid1.ItemCommand += new System.Web.UI.WebControls.DataGridCommandEventHandler(this.DataGrid1_ItemCommand);
     //
     // sqlConnection1
     //
     this.sqlConnection1.ConnectionString = "workstation id=ZHAOWEIPING;packet size=4096;user id=sa;integrated security=SSPI;d" +
                                            "ata source=ZHAOWEIPING;persist security info=False;initial catalog=selltickets";
     //
     // sqlDataAdapter_ly
     //
     this.sqlDataAdapter_ly.DeleteCommand = this.sqlDeleteCommand1;
     this.sqlDataAdapter_ly.InsertCommand = this.sqlInsertCommand1;
     this.sqlDataAdapter_ly.SelectCommand = this.sqlSelectCommand1;
     this.sqlDataAdapter_ly.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "liuyan", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("序号", "序号"),
             new System.Data.Common.DataColumnMapping("标题", "标题"),
             new System.Data.Common.DataColumnMapping("内容", "内容"),
             new System.Data.Common.DataColumnMapping("作者", "作者"),
             new System.Data.Common.DataColumnMapping("时间", "时间")
         })
     });
     this.sqlDataAdapter_ly.UpdateCommand = this.sqlUpdateCommand1;
     //
     // sqlDeleteCommand1
     //
     this.sqlDeleteCommand1.Connection = this.sqlConnection1;
     //
     // sqlInsertCommand1
     //
     this.sqlInsertCommand1.CommandText = "INSERT INTO liuyan(标题, 内容, 作者, 时间) VALUES (@标题, @内容, @作者, @时间)";
     this.sqlInsertCommand1.Connection  = this.sqlConnection1;
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@标题", System.Data.SqlDbType.VarChar, 50, "标题"));
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@内容", System.Data.SqlDbType.VarChar, 1000, "内容"));
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@作者", System.Data.SqlDbType.VarChar, 50, "作者"));
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@时间", System.Data.SqlDbType.DateTime, 8, "时间"));
     //
     // sqlSelectCommand1
     //
     this.sqlSelectCommand1.CommandText = "SELECT 序号, 标题, 内容, 作者, 时间 FROM liuyan";
     this.sqlSelectCommand1.Connection  = this.sqlConnection1;
     //
     // sqlUpdateCommand1
     //
     this.sqlUpdateCommand1.CommandText = "UPDATE liuyan SET 标题 = @标题, 内容 = @内容, 作者 = @作者, 时间 = @时间 WHERE (序号 = @Original_序号" +
                                          ")";
     this.sqlUpdateCommand1.Connection = this.sqlConnection1;
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@标题", System.Data.SqlDbType.VarChar, 50, "标题"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@内容", System.Data.SqlDbType.VarChar, 1000, "内容"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@作者", System.Data.SqlDbType.VarChar, 50, "作者"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@时间", System.Data.SqlDbType.DateTime, 8, "时间"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_序号", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "序号", System.Data.DataRowVersion.Original, null));
     //
     // dataSet_ly
     //
     this.dataSet_ly.DataSetName = "DataSet_ly";
     this.dataSet_ly.Locale      = new System.Globalization.CultureInfo("zh-CN");
     this.Load += new System.EventHandler(this.Page_Load);
     ((System.ComponentModel.ISupportInitialize)(this.dataSet_ly)).EndInit();
 }
Ejemplo n.º 47
0
        private void pintarUsuarios()
        {
            try
            {
                Cursor.Current = Cursors.WaitCursor;

                System.Data.SqlClient.SqlConnection conn = FRWK.CORE.ServicesManager.getInstance().getSQLService().getService();

                string query = "SELECT uuid, nombre, usuario, contrasena, rol, status, cdate FROM Usuario ORDER BY nombre ASC";
                System.Data.SqlClient.SqlCommand    cmd = new System.Data.SqlClient.SqlCommand(query, conn);
                System.Data.SqlClient.SqlDataReader dr  = cmd.ExecuteReader();

                ArrayList         listaUsuarios = new ArrayList();
                ENTIDADES.Usuario u             = null;

                while (dr.Read())
                {
                    if (!dr.IsDBNull(0) && !dr.IsDBNull(1) && !dr.IsDBNull(2) &&
                        !dr.IsDBNull(3) && !dr.IsDBNull(4) && !dr.IsDBNull(5) &&
                        !dr.IsDBNull(6))
                    {
                        string   uuid       = dr.GetString(0) + "";
                        string   nombre     = dr.GetString(1) + "";
                        string   usuario    = dr.GetString(2) + "";
                        string   contrasena = dr.GetString(3) + "";
                        string   rol        = dr.GetString(4) + "";
                        string   status     = dr.GetString(5) + "";
                        DateTime cdate      = dr.GetDateTime(6);

                        u = new ENTIDADES.Usuario(uuid, nombre, usuario, contrasena, rol, status, cdate);

                        listaUsuarios.Add(u);
                    }
                }
                dr.Close();
                FRWK.CORE.ServicesManager.getInstance().getSQLService().closeService(conn);

                DataView dv = new DataView();

                DataTable dtUsuarios = new DataTable("dtUsuarios");
                dtUsuarios.Columns.Add("Uuid");
                dtUsuarios.Columns.Add("Nombre");
                dtUsuarios.Columns.Add("Usuario");
                dtUsuarios.Columns.Add("Rol");
                dtUsuarios.Columns.Add("Status");
                dtUsuarios.Columns.Add("FechaAlta");

                foreach (ENTIDADES.Usuario usuario in listaUsuarios)
                {
                    dtUsuarios.Rows.Add(usuario.Uuid, usuario.Nombre, usuario.User, usuario.Rol,
                                        usuario.Status, usuario.Cdate.ToShortDateString());
                }

                dv.Table = dtUsuarios;
                bindingSource1.DataSource = dv;
                gridUsuarios.DataSource   = bindingSource1;
                gridUsuarios.ReadOnly     = true;

                gridUsuarios.Columns["Uuid"].Width      = 100;
                gridUsuarios.Columns["Nombre"].Width    = 150;
                gridUsuarios.Columns["Usuario"].Width   = 100;
                gridUsuarios.Columns["Rol"].Width       = 100;
                gridUsuarios.Columns["Status"].Width    = 100;
                gridUsuarios.Columns["FechaAlta"].Width = 100;
            }
            catch (Exception e)
            {
                System.Console.WriteLine("ERROR: " + e.Message);
            }
        }
Ejemplo n.º 48
0
 private void InitializeComponent()
 {
     this.daLkpEpisodio     = new System.Data.SqlClient.SqlDataAdapter();
     this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();
     this.cnn               = new System.Data.SqlClient.SqlConnection();
     this.daLkpPerfil       = new System.Data.SqlClient.SqlDataAdapter();
     this.sqlSelectCommand2 = new System.Data.SqlClient.SqlCommand();
     this.dsPerfil          = new ASSMCA.perfiles.dsPerfil();
     ((System.ComponentModel.ISupportInitialize)(this.dsPerfil)).BeginInit();
     #region daLkpEpisodio
     this.daLkpEpisodio.SelectCommand = this.sqlSelectCommand1;
     this.daLkpEpisodio.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "SA_LKP_TEDS_SEGURO_SALUD", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_SeguroSalud", "PK_SeguroSalud"),
             new System.Data.Common.DataColumnMapping("DE_SeguroSalud", "DE_SeguroSalud")
         }),
         new System.Data.Common.DataTableMapping("Table1", "SA_LKP_TEDS_PAGO", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_Pago", "PK_Pago"),
             new System.Data.Common.DataColumnMapping("DE_Pago", "DE_Pago")
         }),
         new System.Data.Common.DataTableMapping("Table2", "SA_LKP_FEMINA", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_Femina", "PK_Femina"),
             new System.Data.Common.DataColumnMapping("DE_Femina", "DE_Femina")
         }),
         new System.Data.Common.DataTableMapping("Table3", "SA_LKP_TEDS_FUENTE_INGRESO", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_FuenteIngreso", "PK_FuenteIngreso"),
             new System.Data.Common.DataColumnMapping("DE_FuenteIngreso", "DE_FuenteIngreso")
         }),
         new System.Data.Common.DataTableMapping("Table4", "SA_LKP_INGRESO_ANUAL", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_IngresoAnual", "PK_IngresoAnual"),
             new System.Data.Common.DataColumnMapping("DE_IngresoAnual", "DE_IngresoAnual")
         }),
         new System.Data.Common.DataTableMapping("Table5", "SA_LKP_TIEMPO_RESIDENCIA", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_TiempoResidencia", "PK_TiempoResidencia"),
             new System.Data.Common.DataColumnMapping("DE_TiempoResidencia", "DE_TiempoResidencia")
         }),
         new System.Data.Common.DataTableMapping("Table6", "SA_LKP_MUNICIPIO_RESIDENCIA", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_Municipio", "PK_Municipio"),
             new System.Data.Common.DataColumnMapping("DE_Municipio", "DE_Municipio")
         }),
         new System.Data.Common.DataTableMapping("Table7", "SA_LKP_TEDS_ETAPA_SERVICIO", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_EtapaServicio", "PK_EtapaServicio"),
             new System.Data.Common.DataColumnMapping("DE_EtapaServicio", "DE_EtapaServicio")
         }),
         new System.Data.Common.DataTableMapping("Table8", "SA_LKP_TEDS_REFERIDO", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_Referido", "PK_Referido"),
             new System.Data.Common.DataColumnMapping("DE_Referido", "DE_Referido")
         }),
         new System.Data.Common.DataTableMapping("Table9", "SA_LKP_TEDS_ESTADO_LEGAL", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_EstadoLegal", "PK_EstadoLegal"),
             new System.Data.Common.DataColumnMapping("DE_EstadoLegal", "DE_EstadoLegal")
         }),
         new System.Data.Common.DataTableMapping("Table10", "SA_LKP_PROBLEMA_JUSTICIA", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_ProbJusticia", "PK_ProbJusticia"),
             new System.Data.Common.DataColumnMapping("DE_ProbJusticia", "DE_ProbJusticia")
         }),
         new System.Data.Common.DataTableMapping("Table11", "SA_LKP_TEDS_EPISODIO_PREVIO", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_EpisodiosPrevios", "PK_EpisodiosPrevios"),
             new System.Data.Common.DataColumnMapping("DE_EpisodiosPrevios", "DE_EpisodiosPrevios")
         }),
         new System.Data.Common.DataTableMapping("Table12", "SA_LKP_TIEMPO_ULT_TRAT", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_TiempoUltTrat", "PK_TiempoUltTrat"),
             new System.Data.Common.DataColumnMapping("DE_TiempoUltTrat", "DE_TiempoUltTrat")
         }),
         new System.Data.Common.DataTableMapping("Table13", "SA_LKP_ABUSO_SUSTANCIAS_ANTERIOR", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_AbusoSustancias", "PK_AbusoSustancias"),
             new System.Data.Common.DataColumnMapping("DE_AbusoSustancias", "DE_AbusoSustancias")
         }),
         new System.Data.Common.DataTableMapping("Table14", "SA_LKP_SALUD_MENTAL_ANTERIOR", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_SaludMental", "PK_SaludMental"),
             new System.Data.Common.DataColumnMapping("DE_SaludMental", "DE_SaludMental")
         })
     });
     #endregion
     #region sqlSelectCommand1
     this.sqlSelectCommand1.CommandText = "[SPR_LKP_EPISODIO]";
     this.sqlSelectCommand1.CommandType = System.Data.CommandType.StoredProcedure;
     this.sqlSelectCommand1.Connection  = this.cnn;
     this.sqlSelectCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
     #endregion
     #region cnn
     this.cnn.ConnectionString = NewSource.connectionString;
     #endregion
     #region daLkpPerfil
     this.daLkpPerfil.SelectCommand = this.sqlSelectCommand2;
     this.daLkpPerfil.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "SA_LKP_TEDS_ESTADO_MARITAL", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_EstadoMarital", "PK_EstadoMarital"),
             new System.Data.Common.DataColumnMapping("DE_EstadoMarital", "DE_EstadoMarital")
         }),
         new System.Data.Common.DataTableMapping("Table1", "SA_LKP_TEDS_COND_LABORAL", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_CondLaboral", "PK_CondLaboral"),
             new System.Data.Common.DataColumnMapping("DE_CondLaboral", "DE_CondLaboral")
         }),
         new System.Data.Common.DataTableMapping("Table2", "SA_LKP_TEDS_NO_FUERZA_LABORAL", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_NoFuerzaLaboral", "PK_NoFuerzaLaboral"),
             new System.Data.Common.DataColumnMapping("DE_NoFuerzaLaboral", "DE_NoFuerzaLaboral")
         }),
         new System.Data.Common.DataTableMapping("Table3", "SA_LKP_TEDS_GRADO", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_Grado", "PK_Grado"),
             new System.Data.Common.DataColumnMapping("DE_Grado", "DE_Grado")
         }),
         new System.Data.Common.DataTableMapping("Table4", "SA_LKP_COMPOSICION_FAMILIAR", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_Familiar", "PK_Familiar"),
             new System.Data.Common.DataColumnMapping("DE_Familiar", "DE_Familiar")
         }),
         new System.Data.Common.DataTableMapping("Table5", "SA_LKP_TEDS_RESIDENCIA", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_Residencia", "PK_Residencia"),
             new System.Data.Common.DataColumnMapping("DE_Residencia", "DE_Residencia")
         }),
         new System.Data.Common.DataTableMapping("Table6", "SA_LKP_DIAGNOSTICO", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_Diagnostico", "PK_Diagnostico"),
             new System.Data.Common.DataColumnMapping("DE_Diagnostico", "DE_Diagnostico")
         }),
         new System.Data.Common.DataTableMapping("Table7", "SA_LKP_DSMIV_CAT", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_DSMIVCat", "PK_DSMIVCat"),
             new System.Data.Common.DataColumnMapping("DE_DSMIVCat", "DE_DSMIVCat")
         }),
         new System.Data.Common.DataTableMapping("Table8", "SA_LKP_DSMIV", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_DSMIV", "PK_DSMIV"),
             new System.Data.Common.DataColumnMapping("DE_DSMIV", "DE_DSMIV"),
             new System.Data.Common.DataColumnMapping("PK_DSMIV1", "PK_DSMIV1"),
             new System.Data.Common.DataColumnMapping("FK_DSMIVCat", "FK_DSMIVCat")
         }),
         new System.Data.Common.DataTableMapping("Table9", "SA_LKP_DSMIV_IV", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_DSMIV_IV", "PK_DSMIV_IV"),
             new System.Data.Common.DataColumnMapping("DE_DSMIV_IV", "DE_DSMIV_IV")
         }),
         new System.Data.Common.DataTableMapping("Table10", "SA_LKP_REFERIDOS_TX", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_ReferidosTX", "PK_ReferidosTX"),
             new System.Data.Common.DataColumnMapping("DE_ReferidosTX", "DE_ReferidosTX")
         }),
         new System.Data.Common.DataTableMapping("Table11", "SA_LKP_TEDS_SUSTANCIA", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_Sustancia", "PK_Sustancia"),
             new System.Data.Common.DataColumnMapping("DE_Sustancia", "DE_Sustancia")
         }),
         new System.Data.Common.DataTableMapping("Table12", "SA_LKP_TEDS_VIA_UTILIZACION", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_ViaUtilizacion", "PK_ViaUtilizacion"),
             new System.Data.Common.DataColumnMapping("DE_ViaUtilizacion", "DE_ViaUtilizacion")
         }),
         new System.Data.Common.DataTableMapping("Table13", "SA_LKP_TEDS_FRECUENCIA", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_Frecuencia", "PK_Frecuencia"),
             new System.Data.Common.DataColumnMapping("DE_Frecuencia", "DE_Frecuencia")
         }),
         new System.Data.Common.DataTableMapping("Table14", "SA_LKP_MEDIDA", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_Medida", "PK_Medida"),
             new System.Data.Common.DataColumnMapping("DE_Medida", "DE_Medida")
         }),
         new System.Data.Common.DataTableMapping("Table15", "SA_LKP_TEDS_FRECUENCIA_AUTOAYUDA", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_FreqAutoAyuda", "PK_FreqAutoAyuda"),
             new System.Data.Common.DataColumnMapping("DE_FreqAutoAyuda", "DE_FreqAutoAyuda")
         }),
         new System.Data.Common.DataTableMapping("Table16", "SA_LKP_TEDS_SITUACION_ESCOLAR", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_SituacionEscolar", "PK_SituacionEscolar"),
             new System.Data.Common.DataColumnMapping("DE_SituacionEscolar", "DE_SituacionEscolar")
         }),
         new System.Data.Common.DataTableMapping("Table17", "SA_LKP_TEDS_TIPO_ADMISION", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_TipoAdmision", "PK_TipoAdmision"),
             new System.Data.Common.DataColumnMapping("DE_TipoAdmision", "DE_TipoAdmision")
         }),
         new System.Data.Common.DataTableMapping("Table19", "SA_LKP_DSMV_ProblemasPsicosocialesAmbientales", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_DSMV_ProblemasPsicosocialesAmbientales", "PK_DSMV_ProblemasPsicosocialesAmbientales"),
             new System.Data.Common.DataColumnMapping("DE_DSMV_ProblemasPsicosocialesAmbientales", "DE_DSMV_ProblemasPsicosocialesAmbientales")
         }),
         new System.Data.Common.DataTableMapping("Table20", "SA_LKP_DSMV", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("PK_DSMV", "PK_DSMV"),
             new System.Data.Common.DataColumnMapping("_PK_DSMV", "_PK_DSMV"),
             new System.Data.Common.DataColumnMapping("CONCAT_DSMV", "CONCAT_DSMV"),
             new System.Data.Common.DataColumnMapping("DE_DSMV", "DE_DSMV")
         })
     });
     #endregion
     #region sqlSelectCommand2
     this.sqlSelectCommand2.CommandText = "[SPR_LKP_PERFIL]";
     this.sqlSelectCommand2.CommandType = System.Data.CommandType.StoredProcedure;
     this.sqlSelectCommand2.Connection  = this.cnn;
     this.sqlSelectCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null));
     #endregion
     #region dsPerfil
     this.dsPerfil.DataSetName = "dsPerfil";
     this.dsPerfil.Locale      = new System.Globalization.CultureInfo("en-US");
     ((System.ComponentModel.ISupportInitialize)(this.dsPerfil)).EndInit();
     #endregion
 }
Ejemplo n.º 49
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.sqlConnection1    = new System.Data.SqlClient.SqlConnection();
     this.sqlCommandLastID  = new System.Data.SqlClient.SqlCommand();
     this.sqlConnection2    = new System.Data.SqlClient.SqlConnection();
     this.sqlSELECTbyID     = new System.Data.SqlClient.SqlCommand();
     this.sqlSELECTbyDT     = new System.Data.SqlClient.SqlCommand();
     this.sqlCommandMinDT   = new System.Data.SqlClient.SqlCommand();
     this.sqlCommandMaxDT   = new System.Data.SqlClient.SqlCommand();
     this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();
     this.sqlInsertCommand1 = new System.Data.SqlClient.SqlCommand();
     this.sqlUpdateCommand1 = new System.Data.SqlClient.SqlCommand();
     this.sqlDeleteCommand1 = new System.Data.SqlClient.SqlCommand();
     this.sqlDataAdapter1   = new System.Data.SqlClient.SqlDataAdapter();
     //
     // sqlConnection1
     //
     this.sqlConnection1.ConnectionString = "workstation id=DANSDELL;packet size=4096;integrated security=SSPI;data source=\"DA" +
                                            "NSDELL\\SEEVSE\";persist security info=True;initial catalog=VseDb";
     //
     // sqlCommandLastID
     //
     this.sqlCommandLastID.CommandText = "SELECT MAX(Record_ID) AS Expr1 FROM JobStep_Records";
     this.sqlCommandLastID.Connection  = this.sqlConnection1;
     //
     // sqlConnection2
     //
     this.sqlConnection2.ConnectionString = "workstation id=DANSDELL;packet size=4096;integrated security=SSPI;data source=\"DA" +
                                            "NSDELL\\SEEVSE\";persist security info=True;initial catalog=VseDb";
     //
     // sqlSELECTbyID
     //
     this.sqlSELECTbyID.CommandText = "SELECT JobStep_Records.* FROM JobStep_Records WHERE (Record_ID >= @FirstID) AND (" +
                                      "Record_ID <= @LastID)";
     this.sqlSELECTbyID.Connection = this.sqlConnection1;
     this.sqlSELECTbyID.Parameters.Add(new System.Data.SqlClient.SqlParameter("@FirstID", System.Data.SqlDbType.Int, 4, "Record_ID"));
     this.sqlSELECTbyID.Parameters.Add(new System.Data.SqlClient.SqlParameter("@LastID", System.Data.SqlDbType.Int, 4, "Record_ID"));
     //
     // sqlSELECTbyDT
     //
     this.sqlSELECTbyDT.CommandText = "SELECT JobStep_Records.* FROM JobStep_Records WHERE (Step_End_Time >= @StartTime)" +
                                      " AND (Step_End_Time <= @EndTime)";
     this.sqlSELECTbyDT.Connection = this.sqlConnection1;
     this.sqlSELECTbyDT.Parameters.Add(new System.Data.SqlClient.SqlParameter("@StartTime", System.Data.SqlDbType.DateTime, 8, "Step_End_Time"));
     this.sqlSELECTbyDT.Parameters.Add(new System.Data.SqlClient.SqlParameter("@EndTime", System.Data.SqlDbType.DateTime, 8, "Step_End_Time"));
     //
     // sqlCommandMinDT
     //
     this.sqlCommandMinDT.CommandText = "SELECT MIN(Step_End_Time) AS Expr1 FROM JobStep_Records";
     this.sqlCommandMinDT.Connection  = this.sqlConnection1;
     //
     // sqlCommandMaxDT
     //
     this.sqlCommandMaxDT.CommandText = "SELECT MAX(Step_End_Time) AS Expr1 FROM JobStep_Records";
     this.sqlCommandMaxDT.Connection  = this.sqlConnection1;
     //
     // sqlSelectCommand1
     //
     this.sqlSelectCommand1.CommandText = "SELECT Record_ID, PID, Job_Name, Step_Name, Step_Start_Time, Step_End_Time, Durat" +
                                          "ion_Sec, Cpu_Time_Sec, Total_IO FROM JobStep_Records";
     this.sqlSelectCommand1.Connection = this.sqlConnection1;
     //
     // sqlInsertCommand1
     //
     this.sqlInsertCommand1.CommandText = @"INSERT INTO JobStep_Records(PID, Job_Name, Step_Name, Step_Start_Time, Step_End_Time, Duration_Sec, Cpu_Time_Sec, Total_IO) VALUES (@PID, @Job_Name, @Step_Name, @Step_Start_Time, @Step_End_Time, @Duration_Sec, @Cpu_Time_Sec, @Total_IO); SELECT Record_ID, PID, Job_Name, Step_Name, Step_Start_Time, Step_End_Time, Duration_Sec, Cpu_Time_Sec, Total_IO FROM JobStep_Records WHERE (Job_Name = @Job_Name) AND (Record_ID = @@IDENTITY) AND (Step_Name = @Step_Name) AND (Step_Start_Time = @Step_Start_Time)";
     this.sqlInsertCommand1.Connection  = this.sqlConnection1;
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@PID", System.Data.SqlDbType.VarChar, 2, "PID"));
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Job_Name", System.Data.SqlDbType.VarChar, 8, "Job_Name"));
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Step_Name", System.Data.SqlDbType.VarChar, 8, "Step_Name"));
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Step_Start_Time", System.Data.SqlDbType.DateTime, 8, "Step_Start_Time"));
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Step_End_Time", System.Data.SqlDbType.DateTime, 8, "Step_End_Time"));
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Duration_Sec", System.Data.SqlDbType.Float, 8, "Duration_Sec"));
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Cpu_Time_Sec", System.Data.SqlDbType.Float, 8, "Cpu_Time_Sec"));
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Total_IO", System.Data.SqlDbType.Float, 8, "Total_IO"));
     //
     // sqlUpdateCommand1
     //
     this.sqlUpdateCommand1.CommandText = @"UPDATE JobStep_Records SET PID = @PID, Job_Name = @Job_Name, Step_Name = @Step_Name, Step_Start_Time = @Step_Start_Time, Step_End_Time = @Step_End_Time, Duration_Sec = @Duration_Sec, Cpu_Time_Sec = @Cpu_Time_Sec, Total_IO = @Total_IO WHERE (Job_Name = @Original_Job_Name) AND (Record_ID = @Original_Record_ID) AND (Step_Name = @Original_Step_Name) AND (Step_Start_Time = @Original_Step_Start_Time) AND (Cpu_Time_Sec = @Original_Cpu_Time_Sec OR @Original_Cpu_Time_Sec IS NULL AND Cpu_Time_Sec IS NULL) AND (Duration_Sec = @Original_Duration_Sec OR @Original_Duration_Sec IS NULL AND Duration_Sec IS NULL) AND (PID = @Original_PID OR @Original_PID IS NULL AND PID IS NULL) AND (Step_End_Time = @Original_Step_End_Time OR @Original_Step_End_Time IS NULL AND Step_End_Time IS NULL) AND (Total_IO = @Original_Total_IO OR @Original_Total_IO IS NULL AND Total_IO IS NULL); SELECT Record_ID, PID, Job_Name, Step_Name, Step_Start_Time, Step_End_Time, Duration_Sec, Cpu_Time_Sec, Total_IO FROM JobStep_Records WHERE (Job_Name = @Job_Name) AND (Record_ID = @Record_ID) AND (Step_Name = @Step_Name) AND (Step_Start_Time = @Step_Start_Time)";
     this.sqlUpdateCommand1.Connection  = this.sqlConnection2;
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@PID", System.Data.SqlDbType.VarChar, 2, "PID"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Job_Name", System.Data.SqlDbType.VarChar, 8, "Job_Name"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Step_Name", System.Data.SqlDbType.VarChar, 8, "Step_Name"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Step_Start_Time", System.Data.SqlDbType.DateTime, 8, "Step_Start_Time"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Step_End_Time", System.Data.SqlDbType.DateTime, 8, "Step_End_Time"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Duration_Sec", System.Data.SqlDbType.Float, 8, "Duration_Sec"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Cpu_Time_Sec", System.Data.SqlDbType.Float, 8, "Cpu_Time_Sec"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Total_IO", System.Data.SqlDbType.Float, 8, "Total_IO"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Job_Name", System.Data.SqlDbType.VarChar, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Job_Name", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Record_ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Record_ID", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Step_Name", System.Data.SqlDbType.VarChar, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Step_Name", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Step_Start_Time", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Step_Start_Time", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Cpu_Time_Sec", System.Data.SqlDbType.Float, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Cpu_Time_Sec", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Duration_Sec", System.Data.SqlDbType.Float, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Duration_Sec", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_PID", System.Data.SqlDbType.VarChar, 2, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "PID", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Step_End_Time", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Step_End_Time", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Total_IO", System.Data.SqlDbType.Float, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Total_IO", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Record_ID", System.Data.SqlDbType.Int, 4, "Record_ID"));
     //
     // sqlDeleteCommand1
     //
     this.sqlDeleteCommand1.CommandText = @"DELETE FROM JobStep_Records WHERE (Job_Name = @Original_Job_Name) AND (Record_ID = @Original_Record_ID) AND (Step_Name = @Original_Step_Name) AND (Step_Start_Time = @Original_Step_Start_Time) AND (Cpu_Time_Sec = @Original_Cpu_Time_Sec OR @Original_Cpu_Time_Sec IS NULL AND Cpu_Time_Sec IS NULL) AND (Duration_Sec = @Original_Duration_Sec OR @Original_Duration_Sec IS NULL AND Duration_Sec IS NULL) AND (PID = @Original_PID OR @Original_PID IS NULL AND PID IS NULL) AND (Step_End_Time = @Original_Step_End_Time OR @Original_Step_End_Time IS NULL AND Step_End_Time IS NULL) AND (Total_IO = @Original_Total_IO OR @Original_Total_IO IS NULL AND Total_IO IS NULL)";
     this.sqlDeleteCommand1.Connection  = this.sqlConnection1;
     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Job_Name", System.Data.SqlDbType.VarChar, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Job_Name", System.Data.DataRowVersion.Original, null));
     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Record_ID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Record_ID", System.Data.DataRowVersion.Original, null));
     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Step_Name", System.Data.SqlDbType.VarChar, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Step_Name", System.Data.DataRowVersion.Original, null));
     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Step_Start_Time", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Step_Start_Time", System.Data.DataRowVersion.Original, null));
     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Cpu_Time_Sec", System.Data.SqlDbType.Float, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Cpu_Time_Sec", System.Data.DataRowVersion.Original, null));
     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Duration_Sec", System.Data.SqlDbType.Float, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Duration_Sec", System.Data.DataRowVersion.Original, null));
     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_PID", System.Data.SqlDbType.VarChar, 2, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "PID", System.Data.DataRowVersion.Original, null));
     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Step_End_Time", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Step_End_Time", System.Data.DataRowVersion.Original, null));
     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Total_IO", System.Data.SqlDbType.Float, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Total_IO", System.Data.DataRowVersion.Original, null));
     //
     // sqlDataAdapter1
     //
     this.sqlDataAdapter1.DeleteCommand = this.sqlDeleteCommand1;
     this.sqlDataAdapter1.InsertCommand = this.sqlInsertCommand1;
     this.sqlDataAdapter1.SelectCommand = this.sqlSelectCommand1;
     this.sqlDataAdapter1.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "JobStep_Records", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("Record_ID", "Record_ID"),
             new System.Data.Common.DataColumnMapping("PID", "PID"),
             new System.Data.Common.DataColumnMapping("Job_Name", "Job_Name"),
             new System.Data.Common.DataColumnMapping("Step_Name", "Step_Name"),
             new System.Data.Common.DataColumnMapping("Step_Start_Time", "Step_Start_Time"),
             new System.Data.Common.DataColumnMapping("Step_End_Time", "Step_End_Time"),
             new System.Data.Common.DataColumnMapping("Duration_Sec", "Duration_Sec"),
             new System.Data.Common.DataColumnMapping("Cpu_Time_Sec", "Cpu_Time_Sec"),
             new System.Data.Common.DataColumnMapping("Total_IO", "Total_IO")
         })
     });
     this.sqlDataAdapter1.UpdateCommand = this.sqlUpdateCommand1;
 }
Ejemplo n.º 50
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.sqlConnection1    = new System.Data.SqlClient.SqlConnection();
     this.sqlDataAdapter1   = new System.Data.SqlClient.SqlDataAdapter();
     this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();
     this.textBox1          = new System.Windows.Forms.TextBox();
     this.listBox1          = new System.Windows.Forms.ListBox();
     this.dataSet11         = new ComplexBindingDemo.DataSet1();
     this.label1            = new System.Windows.Forms.Label();
     this.label2            = new System.Windows.Forms.Label();
     ((System.ComponentModel.ISupportInitialize)(this.dataSet11)).BeginInit();
     this.SuspendLayout();
     //
     // sqlConnection1
     //
     this.sqlConnection1.ConnectionString = "workstation id=\"KOPI-2K\";packet size=4096;integrated security=SSPI;data source=\"K" +
                                            "OPI-2K\";persist security info=False;initial catalog=Northwind";
     //
     // sqlDataAdapter1
     //
     this.sqlDataAdapter1.SelectCommand = this.sqlSelectCommand1;
     this.sqlDataAdapter1.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "Products", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("ProductID", "ProductID"),
             new System.Data.Common.DataColumnMapping("ProductName", "ProductName")
         })
     });
     //
     // sqlSelectCommand1
     //
     this.sqlSelectCommand1.CommandText = "SELECT ProductID, ProductName FROM Products";
     this.sqlSelectCommand1.Connection  = this.sqlConnection1;
     //
     // textBox1
     //
     this.textBox1.Location = new System.Drawing.Point(80, 16);
     this.textBox1.Name     = "textBox1";
     this.textBox1.TabIndex = 0;
     this.textBox1.Text     = "";
     //
     // listBox1
     //
     this.listBox1.DataSource            = this.dataSet11.Products;
     this.listBox1.DisplayMember         = "ProductName";
     this.listBox1.Location              = new System.Drawing.Point(16, 72);
     this.listBox1.Name                  = "listBox1";
     this.listBox1.Size                  = new System.Drawing.Size(256, 186);
     this.listBox1.TabIndex              = 1;
     this.listBox1.ValueMember           = "ProductID";
     this.listBox1.SelectedIndexChanged += new System.EventHandler(this.itemSelected);
     //
     // dataSet11
     //
     this.dataSet11.DataSetName = "DataSet1";
     this.dataSet11.Locale      = new System.Globalization.CultureInfo("en-US");
     //
     // label1
     //
     this.label1.Location = new System.Drawing.Point(16, 16);
     this.label1.Name     = "label1";
     this.label1.Size     = new System.Drawing.Size(60, 23);
     this.label1.TabIndex = 2;
     this.label1.Text     = "Product ID";
     //
     // label2
     //
     this.label2.Location = new System.Drawing.Point(96, 48);
     this.label2.Name     = "label2";
     this.label2.TabIndex = 3;
     this.label2.Text     = "Product Name";
     //
     // Form1
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize        = new System.Drawing.Size(292, 273);
     this.Controls.Add(this.label2);
     this.Controls.Add(this.label1);
     this.Controls.Add(this.listBox1);
     this.Controls.Add(this.textBox1);
     this.Name = "Form1";
     this.Text = "Form1";
     ((System.ComponentModel.ISupportInitialize)(this.dataSet11)).EndInit();
     this.ResumeLayout(false);
 }
Ejemplo n.º 51
0
        public void LoadData(String pirID, String GUID)
        {
            System.Data.SqlClient.SqlConnection cn = new System.Data.SqlClient.SqlConnection(db);
            System.Data.SqlClient.SqlCommand    cmd;
            System.Data.SqlClient.SqlDataReader dr;

            try
            {
                cn.Open();

                cmd = new System.Data.SqlClient.SqlCommand("GetRequest", cn);
                cmd.CommandTimeout = 0;
                cmd.CommandType    = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@pir_id", pirID);
                cmd.Parameters.AddWithValue("@GUID", GUID);

                dr = cmd.ExecuteReader(CommandBehavior.SingleRow);

                if (dr.HasRows)
                {
                    dr.Read();

                    this.PIRID                 = Convert.ToInt32(dr["pir_id"]);
                    this.Email                 = dr["request_email"].ToString();
                    this.IFRPartSetup          = dr["IRF_parts_only"].ToString();
                    this.SalesRep              = dr["[sales_rep"].ToString();
                    this.ProjectName           = dr["project_name"].ToString();
                    this.ProjectTotal          = dr["project_total"].ToString();
                    this.InventoryRequestTotal = dr["inv_request_total"].ToString();
                    this.SalesLocation         = dr["sales_location"].ToString();
                    this.CustomerName          = dr["customer_name"].ToString();
                    this.CustomerNumber        = dr["customer_number"].ToString();
                    this.FirstReleaseDate      = dr["first_release_date"].ToString();
                    this.DateRequested         = dr["date_requested"].ToString();
                    this.CompletionDate        = dr["completion_date"].ToString();
                    this.CustomerCreditLimit   = dr["customer_credit_limit"].ToString();
                    this.ScopeOfRequest        = dr["scope_of_request"].ToString();
                    this.SpecsAttached         = dr["specs_attached"].ToString();
                    this.CopperPlacement       = dr["firm_copper"].ToString();
                    this.SPAAttached           = dr["vendor_quote_spa_attached"].ToString();
                    this.SourceOfPricing       = dr["source_of_pricing"].ToString();
                    this.CarringDelay          = dr["delayed_inv_provision"].ToString();
                    this.ExplainCarringDelay   = dr["delayed_inv_explain"].ToString();
                    this.QuotedCUBase          = dr["quoted_CU_base"].ToString();
                    this.RequestedWHSE         = dr["request_whses"].ToString();
                    this.HowToReplenish        = dr["how_to_replenish"].ToString();
                    this.ExplainNoPO           = dr["customer_PO_attach"].ToString();
                    this.PONumber              = dr["PO_explain"].ToString();
                    this.SignedNCNR            = dr["signed_NCNR_attach"].ToString();
                    this.ExplainNoNCNR         = dr["NCNR_explain"].ToString();
                    this.TypeOfContract        = dr["type_of_contract"].ToString();
                    this.ContractSetupNeeded   = dr["contract_setup_needed"].ToString();
                    this.AdditionalFollowup    = dr["additional_followup"].ToString();
                    //this = dr["general_details"].ToString();
                    this.MarketingMemo       = dr["marketing_memo"].ToString();
                    this.Returnable          = dr["returnable_material"].ToString();
                    this.FollowUpNeeded      = dr["followup_needed"].ToString();
                    this.ReelsReversed       = dr["reels_reversed"].ToString();
                    this.LocationRestriction = dr["location_restricted"].ToString();
                    this.PONumber            = dr["PO_number"].ToString();
                    this.RiskDollars         = dr["risk_dollars"].ToString();
                    this.RollUp = dr["roll_up"].ToString();
                }

                this.Approvers = GetApprovers();
            }
            catch (System.Data.SqlClient.SqlException ex)
            {
                this.Error = ex.Message;
            }
            finally
            {
                if (cn.State == ConnectionState.Open)
                {
                    cn.Close();
                }
            }
        }
Ejemplo n.º 52
0
        public SessionImplObject GetLayout(SessionQuery query, ConnectionStringSettings connectionStringSetting)
        {
            try
            {
                /*
                 * ISdmxObjects structure = GetKeyFamily();
                 * IDataflowObject df = structure.Dataflows.First();
                 * IDataStructureObject kf = structure.DataStructures.First();
                 */
                ISdmxObjects         structure = query.Structure;
                IDataflowObject      df        = query.Dataflow;
                IDataStructureObject kf        = query.KeyFamily;


                if (kf == null || df == null)
                {
                    throw new InvalidOperationException("DataStructure is not set");
                }

                //if (this.SessionObj.DafaultLayout == null)
                this.SessionObj.DafaultLayout = new Dictionary <string, LayoutObj>();

                //if (connectionStringSetting.ConnectionString!=null && connectionStringSetting.ConnectionString.ToLower() != "file")
                if (connectionStringSetting.ConnectionString != null)
                {
                    // Get automatic timeserie layout
                    System.Data.SqlClient.SqlConnection Sqlconn = new System.Data.SqlClient.SqlConnection(connectionStringSetting.ConnectionString);
                    Sqlconn.Open();
                    string sqlquery = string.Format("Select * from Template where [tmplKey]='{0}'",
                                                    new System.Web.Script.Serialization.JavaScriptSerializer().Serialize(
                                                        LayObj.Dataflow.id + "+" + LayObj.Dataflow.agency + "+" + LayObj.Dataflow.version + "+" + LayObj.Configuration.EndPoint).Replace("'", "''"));
                    using (System.Data.SqlClient.SqlCommand comm = new System.Data.SqlClient.SqlCommand(sqlquery, Sqlconn))
                    {
                        var reader = comm.ExecuteReader();
                        if (reader.Read())
                        {
                            string layout = reader.GetString(reader.GetOrdinal("Layout"));
                            this.SessionObj.DafaultLayout[Utils.MakeKey(df)] =
                                (LayoutObj) new JavaScriptSerializer().Deserialize(layout, typeof(LayoutObj));

                            this.SessionObj.DafaultLayout[Utils.MakeKey(df)].block_axis_x = reader.GetBoolean(reader.GetOrdinal("BlockXAxe"));
                            this.SessionObj.DafaultLayout[Utils.MakeKey(df)].block_axis_y = reader.GetBoolean(reader.GetOrdinal("BlockYAxe"));
                            this.SessionObj.DafaultLayout[Utils.MakeKey(df)].block_axis_z = reader.GetBoolean(reader.GetOrdinal("BlockZAxe"));
                        }
                    }
                    Sqlconn.Close();
                }
                DefaultLayoutResponseObject defaultLayoutResponseObject = new DefaultLayoutResponseObject();
                defaultLayoutResponseObject.DefaultLayout = (this.SessionObj.DafaultLayout.ContainsKey(Utils.MakeKey(df))) ? this.SessionObj.DafaultLayout[Utils.MakeKey(df)] : null;

                //if (defaultLayoutResponseObject.DefaultLayout == null){ return GetLayout(); }

                this.SessionObj.SavedDefaultLayout = new JavaScriptSerializer().Serialize(defaultLayoutResponseObject);

                return(this.SessionObj);
            }
            catch (InvalidOperationException ex)
            {
                Logger.Warn(Resources.ErrorMaxJsonLength);
                Logger.Warn(ex.Message, ex);
                throw new Exception(ErrorOccured);
            }
            catch (ArgumentException ex)
            {
                Logger.Warn(Resources.ErrorRecursionLimit);
                Logger.Warn(ex.Message, ex);
                throw new Exception(ErrorOccured);
            }
            catch (Exception ex)
            {
                Logger.Warn(ex.Message, ex);
                throw new Exception(ErrorOccured);
            }
        }
Ejemplo n.º 53
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     //CommonFunctions.Connection = new System.Data.SqlClient.SqlConnection();
     this.PropertiesSet     = new Vacations.PropertiesDataset();
     this.PropertiesAdapter = new System.Data.SqlClient.SqlDataAdapter();
     this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();
     this.sqlSelectCommand2 = new System.Data.SqlClient.SqlCommand();
     ((System.ComponentModel.ISupportInitialize)(this.PropertiesSet)).BeginInit();
     //
     // CommonFunctions.Connection
     //
     //CommonFunctions.Connection.ConnectionString = "workstation id=MAIN;packet size=4096;integrated security=SSPI;data source=MAIN;pe" +
     //"rsist security info=False;initial catalog=Vacations";
     //
     // PropertiesSet
     //
     this.PropertiesSet.DataSetName = "PropertiesDataset";
     this.PropertiesSet.Locale      = new System.Globalization.CultureInfo("en-US");
     //
     // PropertiesAdapter
     //
     this.PropertiesAdapter.SelectCommand = this.sqlSelectCommand2;
     this.PropertiesAdapter.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "Properties", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("ID", "ID"),
             new System.Data.Common.DataColumnMapping("UserID", "UserID"),
             new System.Data.Common.DataColumnMapping("Name", "Name"),
             new System.Data.Common.DataColumnMapping("TypeID", "TypeID"),
             new System.Data.Common.DataColumnMapping("Address", "Address"),
             new System.Data.Common.DataColumnMapping("IfShowAddress", "IfShowAddress"),
             new System.Data.Common.DataColumnMapping("NumBedrooms", "NumBedrooms"),
             new System.Data.Common.DataColumnMapping("NumBaths", "NumBaths"),
             new System.Data.Common.DataColumnMapping("NumSleeps", "NumSleeps"),
             new System.Data.Common.DataColumnMapping("MinimumNightlyRentalID", "MinimumNightlyRentalID"),
             new System.Data.Common.DataColumnMapping("NumTVs", "NumTVs"),
             new System.Data.Common.DataColumnMapping("NumVCRs", "NumVCRs"),
             new System.Data.Common.DataColumnMapping("NumCDPlayers", "NumCDPlayers"),
             new System.Data.Common.DataColumnMapping("Description", "Description"),
             new System.Data.Common.DataColumnMapping("Amenities", "Amenities"),
             new System.Data.Common.DataColumnMapping("LocalAttractions", "LocalAttractions"),
             new System.Data.Common.DataColumnMapping("Rates", "Rates"),
             new System.Data.Common.DataColumnMapping("CancellationPolicy", "CancellationPolicy"),
             new System.Data.Common.DataColumnMapping("DepositRequired", "DepositRequired"),
             new System.Data.Common.DataColumnMapping("IfMoreThan7PhotosAllowed", "IfMoreThan7PhotosAllowed"),
             new System.Data.Common.DataColumnMapping("IfApproved", "IfApproved"),
             new System.Data.Common.DataColumnMapping("CityID", "CityID"),
             new System.Data.Common.DataColumnMapping("IfFinished", "IfFinished"),
             new System.Data.Common.DataColumnMapping("DateAdded", "DateAdded"),
             new System.Data.Common.DataColumnMapping("DateStartViewed", "DateStartViewed"),
             new System.Data.Common.DataColumnMapping("VirtualTour", "VirtualTour"),
             new System.Data.Common.DataColumnMapping("RatesTable", "RatesTable"),
             new System.Data.Common.DataColumnMapping("PricesCurrency", "PricesCurrency"),
             new System.Data.Common.DataColumnMapping("CheckIn", "CheckIn"),
             new System.Data.Common.DataColumnMapping("CheckOut", "CheckOut"),
             new System.Data.Common.DataColumnMapping("LodgingTax", "LodgingTax"),
             new System.Data.Common.DataColumnMapping("TaxIncluded", "TaxIncluded"),
             new System.Data.Common.DataColumnMapping("DateAvailable", "DateAvailable"),
             new System.Data.Common.DataColumnMapping("IfDiscounted", "IfDiscounted"),
             new System.Data.Common.DataColumnMapping("IfLastMinuteCancellations", "IfLastMinuteCancellations"),
             new System.Data.Common.DataColumnMapping("LastMinuteComments", "LastMinuteComments"),
             new System.Data.Common.DataColumnMapping("PublishedDate", "PublishedDate"),
             new System.Data.Common.DataColumnMapping("HomeExchangeCityID1", "HomeExchangeCityID1"),
             new System.Data.Common.DataColumnMapping("HomeExchangeCityID2", "HomeExchangeCityID2"),
             new System.Data.Common.DataColumnMapping("HomeExchangeCityID3", "HomeExchangeCityID3")
         })
     });
     //
     // sqlSelectCommand2
     //
     this.sqlSelectCommand2.CommandText = @"SELECT ID, UserID, Name, TypeID, Address, IfShowAddress, NumBedrooms, NumBaths, NumSleeps, MinimumNightlyRentalID, NumTVs, NumVCRs, NumCDPlayers, Description, Amenities, LocalAttractions, Rates, CancellationPolicy, DepositRequired, IfMoreThan7PhotosAllowed, IfApproved, CityID, IfFinished, DateAdded, DateStartViewed, VirtualTour, RatesTable, PricesCurrency, CheckIn, CheckOut, LodgingTax, TaxIncluded, DateAvailable, IfDiscounted, IfLastMinuteCancellations, LastMinuteComments, HomeExchangeCityID1, HomeExchangeCityID2, HomeExchangeCityID3,PublishedDate FROM Properties WHERE (IfFinished = 1) AND (ID = @PropertyID)";
     this.sqlSelectCommand2.Connection  = CommonFunctions.GetConnection();
     this.sqlSelectCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@PropertyID", System.Data.SqlDbType.Int, 4, "ID"));
     ((System.ComponentModel.ISupportInitialize)(this.PropertiesSet)).EndInit();
 }
Ejemplo n.º 54
0
        public void SaveMe()
        {
            System.Data.SqlClient.SqlConnection cn = new System.Data.SqlClient.SqlConnection(db);
            System.Data.SqlClient.SqlCommand    cmd;
            String hldGroup = String.Empty;


            String sGuid   = String.Empty;
            String sStatus = String.Empty;

            try
            {
                cn.Open();

                cmd = new System.Data.SqlClient.SqlCommand("cmr_SaveRequest", cn);
                cmd.CommandTimeout = 0;

                cmd.CommandType = CommandType.StoredProcedure;



                cmd.Parameters.AddWithValue("@pir_id", this.PIRID);
                cmd.Parameters.AddWithValue("@request_email", this.Email);
                cmd.Parameters.AddWithValue("@IRF_parts_only", this.IFRPartSetup);
                cmd.Parameters.AddWithValue("@sales_rep", this.SalesRep);
                cmd.Parameters.AddWithValue("@project_name", this.ProjectName);
                cmd.Parameters.AddWithValue("@project_total", this.ProjectTotal);
                cmd.Parameters.AddWithValue("@inv_request_total", this.InventoryRequestTotal);
                cmd.Parameters.AddWithValue("@sales_location", this.SalesLocation);
                cmd.Parameters.AddWithValue("@customer_name", this.CustomerName);
                cmd.Parameters.AddWithValue("@customer_number", this.CustomerNumber);
                cmd.Parameters.AddWithValue("@first_release_date", this.FirstReleaseDate);
                cmd.Parameters.AddWithValue("@date_requested", this.DateRequested);
                cmd.Parameters.AddWithValue("@completion_date", this.CompletionDate);
                cmd.Parameters.AddWithValue("@customer_credit_limit", this._customercreditlimit);
                cmd.Parameters.AddWithValue("@scope_of_request", this.ScopeOfRequest);
                cmd.Parameters.AddWithValue("@specs_attached", this.SpecsAttached);
                cmd.Parameters.AddWithValue("@firm_copper", this.CopperPlacement);
                cmd.Parameters.AddWithValue("@vendor_quote_spa_attached", this.SpecsAttached);
                cmd.Parameters.AddWithValue("@source_of_pricing", this.SourceOfPricing);
                cmd.Parameters.AddWithValue("@delayed_inv_provision", this.CarringDelay);
                cmd.Parameters.AddWithValue("@delayed_inv_explain", this.ExplainCarringDelay);
                cmd.Parameters.AddWithValue("@quoted_CU_base", this.QuotedCUBase);
                cmd.Parameters.AddWithValue("@request_whses", this.RequestedWHSE);
                cmd.Parameters.AddWithValue("@how_to_replenish", this.HowToReplenish);
                cmd.Parameters.AddWithValue("@customer_PO_attach", this.AttachedCustomerPO);
                cmd.Parameters.AddWithValue("@PO_explain", this.ExplainNoPO);
                cmd.Parameters.AddWithValue("@signed_NCNR_attach", this.SignedNCNR);
                cmd.Parameters.AddWithValue("@NCNR_explain", this.ExplainNoNCNR);
                cmd.Parameters.AddWithValue("@type_of_contract", this.TypeOfContract);
                cmd.Parameters.AddWithValue("@contract_setup_needed", this.ContractSetupNeeded);
                cmd.Parameters.AddWithValue("@additional_followup", this.AdditionalFollowup);
                // cmd.Parameters.AddWithValue("@general_details", this.ge
                cmd.Parameters.AddWithValue("@marketing_memo", this.MarketingMemo);
                cmd.Parameters.AddWithValue("@returnable_material", this.Returnable);
                cmd.Parameters.AddWithValue("@followup_needed", this.FollowUpNeeded);
                cmd.Parameters.AddWithValue("@reels_reversed", this.ReelsReversed);
                cmd.Parameters.AddWithValue("@location_restricted", this.LocationRestriction);
                cmd.Parameters.AddWithValue("@PO_number", this.PONumber);
                cmd.Parameters.AddWithValue("@risk_dollars", this.RiskDollars);


                if (this.PIRID == 0)
                {
                    this.PIRID = Convert.ToInt32(cmd.ExecuteScalar());
                    BuildApprovers();
                }
                else
                {
                    this.PIRID = Convert.ToInt32(cmd.ExecuteScalar());
                    //SaveApprovers?
                }

                //MoveFiles();
            }
            catch (System.Data.SqlClient.SqlException ex)
            {
                this.Error = ex.Message;
            }
            finally
            {
                if (cn.State == ConnectionState.Open)
                {
                    cn.Close();
                }
            }
        }
Ejemplo n.º 55
0
        public Boolean Get_Job(String MyJobNumber, Int32 MyproductionLine, System.Data.SqlClient.SqlTransaction trnEnvelope)
        {
            Boolean isSuccessful = true;

            ErrorMessage = string.Empty;

            try
            {
                String strSQL = "SELECT Jobs.*, ";
                strSQL = strSQL + "WorkOrders.WorkOrderNo, WorkOrders.CustomerRef, ";
                strSQL = strSQL + "PaintSystems.PaintSystemCode, ";
                strSQL = strSQL + "PaintSystemProcesses.process_coats, ";
                strSQL = strSQL + "SupplierPaintProducts.SupplierPaintProductCode, ";
                strSQL = strSQL + "SupplierProductGroups.SupplierProductGroupCode ";
                strSQL = strSQL + "FROM Jobs ";
                strSQL = strSQL + "INNER JOIN WorkOrders ON Jobs.WorkOrderId = WorkOrders.WorkOrderId ";
                strSQL = strSQL + "INNER JOIN PaintSystems ON Jobs.PaintSystemId = PaintSystems.PaintSystemId ";
                strSQL = strSQL + "INNER JOIN PaintSystemProcesses ON PaintSystems.process_code = PaintSystemProcesses.process_code ";
                strSQL = strSQL + "INNER JOIN SupplierPaintProducts ON Jobs.SupplierPaintProductId = SupplierPaintProducts.SupplierPaintProductId ";
                strSQL = strSQL + "INNER JOIN SupplierProductGroups ON SupplierPaintProducts.SupplierProductgroupId = SupplierProductGroups.SupplierProductGroupId ";
                strSQL = strSQL + "WHERE JobNumber = '" + MyJobNumber + "'";
                System.Data.SqlClient.SqlCommand    cmdGet = new System.Data.SqlClient.SqlCommand(strSQL, myVPSConnection, trnEnvelope);
                System.Data.SqlClient.SqlDataReader rdrGet = cmdGet.ExecuteReader();
                if (rdrGet.HasRows == true)
                {
                    System.Data.DataTable CurrentJob = new System.Data.DataTable();
                    CurrentJob.Load(rdrGet);

                    JobId                    = Convert.ToInt32(CurrentJob.Rows[0]["JobId"]);
                    JobNumber                = CurrentJob.Rows[0]["JobNumber"].ToString();
                    CustomerName             = CurrentJob.Rows[0]["CustomerName"].ToString();
                    ColourName               = CurrentJob.Rows[0]["ColorName"].ToString();
                    JobStatus                = CurrentJob.Rows[0]["JobStatus"].ToString();
                    WorkOrderNumber          = CurrentJob.Rows[0]["WorkOrderNo"].ToString();
                    CustomerOrder            = CurrentJob.Rows[0]["CustomerRef"].ToString();
                    SupplierPaintProductCode = CurrentJob.Rows[0]["SupplierPaintProductCode"].ToString();
                    SupplierProductGroupCode = CurrentJob.Rows[0]["SupplierProductGroupCode"].ToString();
                    ProductionLineId         = Convert.ToInt32(CurrentJob.Rows[0]["ProductionLineId"]);
                    PaintSystemCoats         = Convert.ToInt32(CurrentJob.Rows[0]["Process_Coats"]);

                    if (MyproductionLine > 0)
                    {
                        if (Convert.ToInt32(CurrentJob.Rows[0]["ProductionLineId"]) != MyproductionLine)
                        {
                            isSuccessful = false;
                            ErrorMessage = "Get Job - Job # " + MyJobNumber + " was not Scheduled for this Production Line !";
                        }
                    }
                }
                else
                {
                    isSuccessful = false;
                    ErrorMessage = "Get Job - Job # " + MyJobNumber + " not Found !";
                }
                rdrGet.Close();
                cmdGet.Dispose();
            }
            catch (Exception ex)
            {
                isSuccessful = false;
                ErrorMessage = "Get Job - " + ex.Message;
            }

            return(isSuccessful);
        }
Ejemplo n.º 56
0
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.crViewerPolaganja = new CrystalDecisions.Windows.Forms.CrystalReportViewer();
            this.connIzvPolaganja  = new System.Data.SqlClient.SqlConnection();
            this.daIzvPolaganja    = new System.Data.SqlClient.SqlDataAdapter();
            this.dsIzvPolaganja1   = new AutoSkola.DSetovi.dsIzvPolaganja();
            this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();
            ((System.ComponentModel.ISupportInitialize)(this.dsIzvPolaganja1)).BeginInit();
            this.SuspendLayout();
            //
            // crViewerPolaganja
            //
            this.crViewerPolaganja.ActiveViewIndex = -1;
            this.crViewerPolaganja.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.crViewerPolaganja.DisplayGroupTree    = false;
            this.crViewerPolaganja.Location            = new System.Drawing.Point(0, 0);
            this.crViewerPolaganja.Name                = "crViewerPolaganja";
            this.crViewerPolaganja.ReportSource        = null;
            this.crViewerPolaganja.ShowGroupTreeButton = false;
            this.crViewerPolaganja.Size                = new System.Drawing.Size(904, 536);
            this.crViewerPolaganja.TabIndex            = 0;
            //
            // connIzvPolaganja
            //
            this.connIzvPolaganja.ConnectionString = "Data Source=(local);Initial Catalog=baza;integrated security=SSPI";
            //
            // daIzvPolaganja
            //
            this.daIzvPolaganja.SelectCommand = this.sqlSelectCommand1;
            this.daIzvPolaganja.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
                new System.Data.Common.DataTableMapping("Table", "Polaganja", new System.Data.Common.DataColumnMapping[] {
                    new System.Data.Common.DataColumnMapping("PolaganjeID", "PolaganjeID"),
                    new System.Data.Common.DataColumnMapping("KandidatID", "KandidatID"),
                    new System.Data.Common.DataColumnMapping("Ime", "Ime"),
                    new System.Data.Common.DataColumnMapping("Prezime", "Prezime"),
                    new System.Data.Common.DataColumnMapping("DatumPolaganja", "DatumPolaganja"),
                    new System.Data.Common.DataColumnMapping("Pokusaj", "Pokusaj"),
                    new System.Data.Common.DataColumnMapping("Polozeno", "Polozeno"),
                    new System.Data.Common.DataColumnMapping("KategorijaID", "KategorijaID"),
                    new System.Data.Common.DataColumnMapping("Kategorija", "Kategorija"),
                    new System.Data.Common.DataColumnMapping("InstruktorID", "InstruktorID"),
                    new System.Data.Common.DataColumnMapping("ImeInst", "ImeInst"),
                    new System.Data.Common.DataColumnMapping("PrezimeInst", "PrezimeInst")
                })
            });
            //
            // dsIzvPolaganja1
            //
            this.dsIzvPolaganja1.DataSetName = "dsIzvPolaganja";
            this.dsIzvPolaganja1.Locale      = new System.Globalization.CultureInfo("hr-HR");
            //
            // sqlSelectCommand1
            //
            this.sqlSelectCommand1.CommandText = @"SELECT P.PolaganjeID, K.KandidatID, K.Ime, K.Prezime, P.DatumPolaganja, P.Pokusaj, P.Polozeno, Kategorije.KategorijaID, Kategorije.Kategorija, I.InstruktorID, I.Ime AS ImeInst, I.Prezime AS PrezimeInst FROM Polaganja P INNER JOIN Kandidati K ON P.KandidatID = K.KandidatID INNER JOIN Kategorije ON P.KategorijaID = Kategorije.KategorijaID INNER JOIN Instruktori I ON P.InstruktorID = I.InstruktorID ORDER BY P.PolaganjeID";

            //
            // frmIzvPolaganja
            //
            this.AutoScaleBaseSize = new System.Drawing.Size(6, 15);
            this.ClientSize        = new System.Drawing.Size(902, 534);
            this.Controls.Add(this.crViewerPolaganja);
            this.Name          = "frmIzvPolaganja";
            this.ShowInTaskbar = false;
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
            this.Text          = "Polaganja";
            this.Load         += new System.EventHandler(this.frmIzvPolaganja_Load);
            ((System.ComponentModel.ISupportInitialize)(this.dsIzvPolaganja1)).EndInit();
            this.ResumeLayout(false);
        }
Ejemplo n.º 57
0
        // Job Details
        public Int32 Job_Estimated_Time(Int32 jobId)
        {
            Double  totalM2             = Get_Job_Area(jobId, "PP");
            Double  outstandingMaterial = 0;
            Int32   outstandingTime     = 0;
            Double  coverage            = 0;
            Double  coverageFactor      = 0;
            Int32   minutesPB           = 45;
            Boolean isPowder            = false;

            String strSQL = "SELECT * FROM Jobs WHERE JobId = " + jobId.ToString();

            System.Data.SqlClient.SqlCommand    cmdGetJ = new System.Data.SqlClient.SqlCommand(strSQL, myVPSConnection);
            System.Data.SqlClient.SqlDataReader rdrGetJ = cmdGetJ.ExecuteReader();
            if (rdrGetJ.HasRows == true)
            {
                System.Data.DataTable myJob = new System.Data.DataTable();
                myJob.Load(rdrGetJ);

                Int32 myPaintProduct = Convert.ToInt32(myJob.Rows[0]["SupplierPaintProductId"]);
                Int32 myWorkOrder    = Convert.ToInt32(myJob.Rows[0]["WorkOrderId"]);

                strSQL = "SELECT * FROM SupplierPaintProducts WHERE SupplierPaintProductId = " + myPaintProduct.ToString();
                System.Data.SqlClient.SqlCommand    cmdGetP = new System.Data.SqlClient.SqlCommand(strSQL, myVPSConnection);
                System.Data.SqlClient.SqlDataReader rdrGetP = cmdGetP.ExecuteReader();
                if (rdrGetP.HasRows == true)
                {
                    System.Data.DataTable myProduct = new System.Data.DataTable();
                    myProduct.Load(rdrGetP);

                    Int32 myGroup = Convert.ToInt32(myProduct.Rows[0]["SupplierProductgroupId"]);

                    strSQL = "SELECT * FROM SupplierProductGroups WHERE SupplierProductgroupId = " + myGroup.ToString();
                    System.Data.SqlClient.SqlCommand    cmdGetG = new System.Data.SqlClient.SqlCommand(strSQL, myVPSConnection);
                    System.Data.SqlClient.SqlDataReader rdrGetG = cmdGetG.ExecuteReader();
                    if (rdrGetG.HasRows == true)
                    {
                        System.Data.DataTable myProductGroup = new System.Data.DataTable();
                        myProductGroup.Load(rdrGetG);

                        coverage       = Convert.ToDouble(myProductGroup.Rows[0]["Coverage"]);
                        coverageFactor = Convert.ToDouble(myProductGroup.Rows[0]["CoverageFactor"]);
                        Int32 myPaintType = Convert.ToInt32(myProductGroup.Rows[0]["PaintTypeId"]);

                        strSQL = "SELECT * FROM PaintTypes WHERE PaintTypeId = " + myPaintType.ToString();
                        System.Data.SqlClient.SqlCommand    cmdGetT = new System.Data.SqlClient.SqlCommand(strSQL, myVPSConnection);
                        System.Data.SqlClient.SqlDataReader rdrGetT = cmdGetT.ExecuteReader();
                        if (rdrGetT.HasRows == true)
                        {
                            System.Data.DataTable myType = new System.Data.DataTable();
                            myType.Load(rdrGetT);

                            if (myType.Rows[0]["Description"].ToString().ToUpper().Contains("POWDER") == true)
                            {
                                isPowder = true;
                            }

                            strSQL = "SELECT * FROM WorkOrders WHERE WorkOrderId = " + myWorkOrder.ToString();
                            System.Data.SqlClient.SqlCommand    cmdGetO = new System.Data.SqlClient.SqlCommand(strSQL, myVPSConnection);
                            System.Data.SqlClient.SqlDataReader rdrGetO = cmdGetO.ExecuteReader();
                            if (rdrGetO.HasRows == true)
                            {
                                System.Data.DataTable myOrder = new System.Data.DataTable();
                                myOrder.Load(rdrGetO);

                                Int32 myPPgroup = Convert.ToInt32(myOrder.Rows[0]["PaintProductGroupId"]);

                                strSQL = "SELECT * FROM PaintProductGroups WHERE PaintProductGroupId = " + myPPgroup.ToString();
                                System.Data.SqlClient.SqlCommand    cmdGetB = new System.Data.SqlClient.SqlCommand(strSQL, myVPSConnection);
                                System.Data.SqlClient.SqlDataReader rdrGetB = cmdGetB.ExecuteReader();
                                if (rdrGetB.HasRows == true)
                                {
                                    System.Data.DataTable myPPrecord = new System.Data.DataTable();
                                    myPPrecord.Load(rdrGetB);

                                    minutesPB = Convert.ToInt32(myPPrecord.Rows[0]["MinutesPerBag"]);
                                }
                                rdrGetB.Close();
                                cmdGetB.Dispose();
                            }
                            rdrGetO.Close();
                            cmdGetO.Dispose();
                        }
                        rdrGetT.Close();
                        cmdGetT.Dispose();
                    }
                    rdrGetG.Close();
                    cmdGetG.Dispose();
                }
                rdrGetP.Close();
                cmdGetP.Dispose();
            }
            rdrGetJ.Close();
            cmdGetJ.Dispose();


            if (coverage > 0)
            {
                outstandingMaterial = Math.Round((totalM2 / coverage) * coverageFactor, 3);
            }

            if (isPowder == true)
            {
                outstandingTime = Convert.ToInt32((outstandingMaterial / 20) * minutesPB);
            }
            else
            {
                outstandingTime = 0;
            }

            return(outstandingTime);
        }
Ejemplo n.º 58
0
        public Boolean Update_Progress_Record(Int32 recordId, DateTime timeStamp, Int32 taskId, System.Data.SqlClient.SqlTransaction trnEnvelope, DateTime lineStart, DateTime lineStop)
        {
            Boolean isSuccessful = true;

            ErrorMessage = string.Empty;

            try
            {
                String strSQL = "UPDATE JobProgress SET ";
                if (taskId == -1)
                {
                    strSQL = strSQL + "ProgressLoadStart = NULL, ProgressLineStarted = NULL, ProgressLineStopped = NULL ";
                }
                else if (taskId == 1)
                {
                    strSQL = strSQL + "ProgressLoadStart = CONVERT(datetime, '" + timeStamp.ToString() + "', 103), ProgressLineStarted = CONVERT(datetime, '" + lineStart.ToString() + "', 103), ProgressLineStopped = CONVERT(datetime, '" + lineStop.ToString() + "', 103) ";
                }
                else if (taskId == 2)
                {
                    strSQL = strSQL + "ProgressLoadEnd = CONVERT(datetime, '" + timeStamp.ToString() + "', 103) ";
                }
                else if (taskId == -3)
                {
                    strSQL = strSQL + "ProgressUnloadStart = NULL ";
                }
                else if (taskId == 3)
                {
                    strSQL = strSQL + "ProgressUnloadStart = CONVERT(datetime, '" + timeStamp.ToString() + "', 103) ";
                }
                else if (taskId == 4)
                {
                    strSQL = strSQL + "ProgressUnloadEnd = CONVERT(datetime, '" + timeStamp.ToString() + "', 103) ";
                }
                else if (taskId == 5)
                {
                    strSQL = strSQL + "ProgressPacked = 'True' ";
                }
                else if (taskId == 6)
                {
                    strSQL = strSQL + "ProgressUnloadEnd = CONVERT(datetime, '" + timeStamp.ToString() + "', 103),  ProgressPacked = 'True', ProgressCompleted = 'True' ";
                }
                else if (taskId == 7)
                {
                    strSQL = strSQL + "ProgressCompleted = 'True' ";
                }
                strSQL = strSQL + "WHERE ProgressId = " + recordId.ToString();
                System.Data.SqlClient.SqlCommand cmdUpdate = new System.Data.SqlClient.SqlCommand(strSQL, myVPSConnection, trnEnvelope);
                if (cmdUpdate.ExecuteNonQuery() != 1)
                {
                    isSuccessful = false;
                    ErrorMessage = "Update Progress Record - More than one record would be updated !";
                }
            }
            catch (Exception ex)
            {
                isSuccessful = false;
                ErrorMessage = "Update Progress Record - " + ex.Message;
            }

            return(isSuccessful);
        }
Ejemplo n.º 59
0
        public Boolean Update_Job_Status(String jobNumber, String jobStatus, DateTime timeStamp, System.Data.SqlClient.SqlTransaction trnEnvelope)
        {
            Boolean isSuccessful = true;

            ErrorMessage = string.Empty;

            try
            {
                if (Job_Already_Completed(jobNumber, trnEnvelope) == true)
                {
                    String strSQL = "INSERT INTO JobStatusLog (";
                    strSQL = strSQL + "JobNumber, ";
                    strSQL = strSQL + "JobStatus, ";
                    strSQL = strSQL + "Updated, ";
                    strSQL = strSQL + "Source) VALUES (";
                    strSQL = strSQL + "'" + jobNumber + "', ";
                    strSQL = strSQL + "'**********', ";
                    strSQL = strSQL + "CONVERT(datetime, '" + DateTime.Now.ToString() + "', 103), ";
                    strSQL = strSQL + "'Factory')";
                    System.Data.SqlClient.SqlCommand cmdInsert = new System.Data.SqlClient.SqlCommand(strSQL, myVPSConnection, trnEnvelope);
                    cmdInsert.ExecuteNonQuery();
                }
                else
                {
                    String strSQL = "UPDATE Jobs SET ";
                    if (jobStatus == "Processed")
                    {
                        strSQL = strSQL + "CompletionDate = CONVERT(datetime, '" + timeStamp.ToString() + "', 103), ";
                    }
                    strSQL = strSQL + "JobStatus = '" + jobStatus + "' ";
                    strSQL = strSQL + "WHERE JobNumber = '" + jobNumber + "'";
                    System.Data.SqlClient.SqlCommand cmdUpdate = new System.Data.SqlClient.SqlCommand(strSQL, myVPSConnection, trnEnvelope);
                    if (cmdUpdate.ExecuteNonQuery() != 1)
                    {
                        isSuccessful = false;
                        ErrorMessage = "Update Job Status - More than one record would be updated !";
                    }
                    else
                    {
                        strSQL = "INSERT INTO JobStatusLog (";
                        strSQL = strSQL + "JobNumber, ";
                        strSQL = strSQL + "JobStatus, ";
                        strSQL = strSQL + "Updated, ";
                        strSQL = strSQL + "Source) VALUES (";
                        strSQL = strSQL + "'" + jobNumber + "', ";
                        strSQL = strSQL + "'" + jobStatus + "', ";
                        strSQL = strSQL + "CONVERT(datetime, '" + DateTime.Now.ToString() + "', 103), ";
                        strSQL = strSQL + "'Factory')";
                        System.Data.SqlClient.SqlCommand cmdInsert = new System.Data.SqlClient.SqlCommand(strSQL, myVPSConnection, trnEnvelope);
                        cmdInsert.ExecuteNonQuery();
                    }
                }
            }
            catch (Exception ex)
            {
                isSuccessful = false;
                ErrorMessage = "Update Job Status - " + ex.Message;
            }

            return(isSuccessful);
        }
Ejemplo n.º 60
0
        // Приемник события OnExchangeData
        private void DDEInitializeHandler_ExchangeData(object sender, DataEventArgs e)
        {
            string ss = String.Empty;

            // Формируем определение таблицы биржевых данных
            ExchangeDataTable dataTable = e.exchangeDataTable;

            //ExchangeDataCell[,] dataCell = e.exchangeDataTable.ExchangeDataCells;
            portion++;

            //  string LastCandleBase  = (from c in db.Table where c.Tiker == dataTable.TopicName.ToString() orderby c.DateTime descending select c.Id).Max().ToString();

            int CandlesCount = 0;
            //label10.Text = LastCandleBase;

            // label8.Text = counter.ToString();

            Candles LastCandleFromQuik = new Candles();

            LastCandleFromQuik.ID = dataTable.ExchangeDataCells[1, 0].DataCell.ToString() + dataTable.ExchangeDataCells[1, 1].DataCell.ToString() + dataTable.TopicName.ToString();

            label6.Text = LastCandleFromQuik.ID;

            if (checkBox3.Checked == false)
            {
                CandlesCount = 1;
            }

            System.Data.SqlClient.SqlConnection sqlConnection1 =
                new System.Data.SqlClient.SqlConnection(@"Data Source=ROMANNB-ПК;Initial Catalog=C:\CANDLEBASE\DATABASE1.MDF;Integrated Security=True");

            System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand();
            cmd.CommandType = System.Data.CommandType.Text;

            cmd.Connection = sqlConnection1;

            sqlConnection1.Open();



            // Ну и выводим полученную от терминала Quik информацию
            for (int r = 0; r < dataTable.RowsLength; r++)
            {
                if (dataTable.TopicName.ToString().Contains("candle") == true)
                {
                    string TempID    = dataTable.ExchangeDataCells[r, 0].DataCell.ToString() + dataTable.ExchangeDataCells[r, 1].DataCell.ToString() + dataTable.TopicName.ToString().Replace("candle", "");
                    string TempTiker = dataTable.TopicName.ToString().Replace("candle", "");
                    string TempTime  = dataTable.ExchangeDataCells[r, 1].DataCell.ToString();
                    Single TempOpen  = Convert.ToSingle(dataTable.ExchangeDataCells[r, 2].DataCell.ToString().Replace(".", ","));
                    Single TempClose = Convert.ToSingle(dataTable.ExchangeDataCells[r, 5].DataCell.ToString().Replace(".", ","));
                    Single TempHigh  = Convert.ToSingle(dataTable.ExchangeDataCells[r, 3].DataCell.ToString().Replace(".", ","));
                    Single TempLow   = Convert.ToSingle(dataTable.ExchangeDataCells[r, 4].DataCell.ToString().Replace(".", ","));



                    cmd.CommandText = "INSERT INTO Candles (ID, Ticker, CandleTime, CandleHigh, CandleLow, CandleOpen, CandleClose) SELECT '" + TempID + "','" + TempTiker + "','" + TempTime + "','" + TempHigh + "','" + TempLow + "','" + TempOpen + "','" + TempClose + "' WHERE NOT EXISTS (SELECT ID FROM Candles WHERE ID = '" + TempID + "');";
                    cmd.ExecuteNonQuery();
                }

                if (dataTable.TopicName.ToString().Contains("current") == true)
                {
                    String TempChange, TempLast, TempOborot;
                    string TempTicker = dataTable.ExchangeDataCells[r, 0].DataCell.ToString();
                    TempChange = dataTable.ExchangeDataCells[r, 2].DataCell.ToString().Replace(",", ".");
                    TempLast   = dataTable.ExchangeDataCells[r, 3].DataCell.ToString().Replace(",", ".");
                    TempOborot = dataTable.ExchangeDataCells[r, 4].DataCell.ToString().Replace(",", ".");
                    if (TempChange == "")
                    {
                        TempChange = "0.0";
                    }
                    if (TempLast == "")
                    {
                        TempLast = "0.0";
                    }

                    if (TempOborot == "")
                    {
                        TempOborot = "0.0";
                    }



                    cmd.CommandText = "INSERT INTO dbo.[Current] (Ticker, Change, Last_price, Oborot) SELECT '" + TempTicker + "'," + TempChange + "," + TempLast + "," + TempOborot + " WHERE NOT EXISTS (SELECT Ticker FROM dbo.[Current] WHERE Ticker = '" + TempTicker + "');";
                    cmd.CommandText = cmd.CommandText + "UPDATE dbo.[Current] SET Change = " + TempChange + ", Last_price = " + TempLast + ", Oborot = " + TempOborot + " where Ticker = '" + TempTicker + "' ;";

                    cmd.ExecuteNonQuery();
                }
            }

            sqlConnection1.Close();

            label5.Text = CandlesCount.ToString();

            label4.Text = portion.ToString();
        }