Example #1
0
        private void UpdateDriverCode(string code)
        {
            bool   notFound = true;
            int    id       = 0;
            string name     = null;

            if (!String.IsNullOrWhiteSpace(code))
            {
                AssignmentsDataSet ds = new AssignmentsDataSet();
                AssignmentsDataSetTableAdapters.DriversInfoTableAdapter adapter = new AssignmentsDataSetTableAdapters.DriversInfoTableAdapter();
                AssignmentsDataSet.DriversInfoDataTable dataTable = adapter.GetDataByCode(code);

                if (dataTable.Rows.Count > 0)
                {
                    AssignmentsDataSet.DriversInfoRow row = (AssignmentsDataSet.DriversInfoRow)dataTable.Rows[0];

                    id       = row.Id;
                    name     = row.Name;
                    notFound = false;
                }
            }

            DriverId       = id;
            DriverName     = name;
            DriverNotFound = notFound;
        }
        public override EnumerableRowCollection Query()
        {
            AssignmentsDataSet ds = new AssignmentsDataSet();

            AssignmentsDataSetTableAdapters.DriversInfoTableAdapter adapt = new AssignmentsDataSetTableAdapters.DriversInfoTableAdapter();
            adapt.Fill(ds.DriversInfo);

            return(from driver in ds.DriversInfo.AsEnumerable()
                   select new
            {
                Código = driver.Code,
                Nombre = driver.Name,
                Id = driver.Id
            });
        }
Example #3
0
        private void UpdateDriverInfo(int id)
        {
            if (id > 0)
            {
                AssignmentsDataSet ds = new AssignmentsDataSet();
                AssignmentsDataSetTableAdapters.DriversInfoTableAdapter adapter = new AssignmentsDataSetTableAdapters.DriversInfoTableAdapter();
                AssignmentsDataSet.DriversInfoDataTable dataTable = adapter.GetDataBy(id);

                if (dataTable.Rows.Count > 0)
                {
                    AssignmentsDataSet.DriversInfoRow row = (AssignmentsDataSet.DriversInfoRow)dataTable.Rows[0];

                    DriverCode = row.Code;
                    DriverName = row.Name;
                }
            }
        }
Example #4
0
        //información del conducto
        public string ReturnDriverInfo(int idDriver)
        {
            string infodriver = "";

            if (idDriver > 0)
            {
                AssignmentsDataSet ds = new AssignmentsDataSet();
                AssignmentsDataSetTableAdapters.DriversInfoTableAdapter adapter = new AssignmentsDataSetTableAdapters.DriversInfoTableAdapter();
                AssignmentsDataSet.DriversInfoDataTable dataTable = adapter.GetDataBy(idDriver);

                if (dataTable.Rows.Count > 0)
                {
                    AssignmentsDataSet.DriversInfoRow row = (AssignmentsDataSet.DriversInfoRow)dataTable.Rows[0];
                    infodriver = row.Name;
                }
            }
            return(infodriver);
        }
Example #5
0
        //codigo conductor
        private string ReturnDriverCode(int idDriver)
        {
            string Code = "";

            if (idDriver > 0)
            {
                AssignmentsDataSet ds = new AssignmentsDataSet();
                AssignmentsDataSetTableAdapters.DriversInfoTableAdapter adapter = new AssignmentsDataSetTableAdapters.DriversInfoTableAdapter();
                AssignmentsDataSet.DriversInfoDataTable dataTable = adapter.GetDataBy(idDriver);

                if (dataTable.Rows.Count > 0)
                {
                    AssignmentsDataSet.DriversInfoRow row = (AssignmentsDataSet.DriversInfoRow)dataTable.Rows[0];
                    Code = row.Code;
                }
            }
            return(Code);
        }