private void UpdateCabInfo(string code) { bool notFound = true; int id = 0; string lplate = null; if (!String.IsNullOrWhiteSpace(code)) { AssignmentsDataSet ds = new AssignmentsDataSet(); AssignmentsDataSetTableAdapters.CabInfoTableAdapter adapter = new AssignmentsDataSetTableAdapters.CabInfoTableAdapter(); AssignmentsDataSet.CabInfoDataTable dataTable = adapter.GetDataByCode(code); if (dataTable.Rows.Count > 0) { AssignmentsDataSet.CabInfoRow row = (AssignmentsDataSet.CabInfoRow)dataTable.Rows[0]; id = row.Id; lplate = row.LicensePlate; notFound = false; } } CabId = id; CabLicensePlate = lplate; CabNotFound = notFound; }
private void UpdateCabInfo(int id) { if (id > 0) { AssignmentsDataSet ds = new AssignmentsDataSet(); AssignmentsDataSetTableAdapters.CabInfoTableAdapter adapter = new AssignmentsDataSetTableAdapters.CabInfoTableAdapter(); AssignmentsDataSet.CabInfoDataTable dataTable = adapter.GetDataBy(id); if (dataTable.Rows.Count > 0) { AssignmentsDataSet.CabInfoRow row = (AssignmentsDataSet.CabInfoRow)dataTable.Rows[0]; CabCode = row.Code; CabLicensePlate = row.LicensePlate; } } }
public override EnumerableRowCollection Query() { AssignmentsDataSet ds = new AssignmentsDataSet(); AssignmentsDataSetTableAdapters.CabInfoTableAdapter adapt = new AssignmentsDataSetTableAdapters.CabInfoTableAdapter(); adapt.Fill(ds.CabInfo); return(from cab in ds.CabInfo.AsEnumerable() select new { Código = cab.Code, Matricula = cab.LicensePlate, Tipo = cab.TypeName, Tamaño = cab.SizeName, Observaciones = cab.Observations, Id = cab.Id }); }
//información de código de cabina private string ReturnCabCode(int Cabid) { string CodeCab = ""; if (Cabid > 0) { AssignmentsDataSet ds = new AssignmentsDataSet(); AssignmentsDataSetTableAdapters.CabInfoTableAdapter adapter = new AssignmentsDataSetTableAdapters.CabInfoTableAdapter(); AssignmentsDataSet.CabInfoDataTable dataTable = adapter.GetDataByIdCab(Cabid); if (dataTable.Rows.Count > 0) { AssignmentsDataSet.CabInfoRow row = (AssignmentsDataSet.CabInfoRow)dataTable.Rows[0]; CodeCab = row.Code; } } return(CodeCab); }
//información de cabina private string ReturnCabLicensePlate(int Cabid) { string LicensePlate = ""; if (Cabid > 0) { AssignmentsDataSet ds = new AssignmentsDataSet(); AssignmentsDataSetTableAdapters.CabInfoTableAdapter adapter = new AssignmentsDataSetTableAdapters.CabInfoTableAdapter(); AssignmentsDataSet.CabInfoDataTable dataTable = adapter.GetDataByIdCab(Cabid); if (dataTable.Rows.Count > 0) { AssignmentsDataSet.CabInfoRow row = (AssignmentsDataSet.CabInfoRow)dataTable.Rows[0]; LicensePlate = row.LicensePlate; } } return(LicensePlate); }