private void UpdateOperatorCode(string code) { bool notFound = true; int id = 0; string name = null; if (!String.IsNullOrWhiteSpace(code)) { OrderDataSet ds = new OrderDataSet(); OrderDataSetTableAdapters.OperatorsTableAdapter adapter = new OrderDataSetTableAdapters.OperatorsTableAdapter(); OrderDataSet.OperatorsDataTable dataTable = adapter.GetDataByCode(code); if (dataTable.Rows.Count > 0) { OrderDataSet.OperatorsRow row = (OrderDataSet.OperatorsRow)dataTable.Rows[0]; id = row.Id; name = row.Name; notFound = false; } } OperatorId = id; OperatorName = name; OperatorNotFound = notFound; }
private void UpdateOperatorInfo(int id) { if (id > 0) { OrderDataSet ds = new OrderDataSet(); OrderDataSetTableAdapters.OperatorsTableAdapter adapter = new OrderDataSetTableAdapters.OperatorsTableAdapter(); OrderDataSet.OperatorsDataTable dataTable = adapter.GetDataById(id); if (dataTable.Rows.Count > 0) { OrderDataSet.OperatorsRow row = (OrderDataSet.OperatorsRow)dataTable.Rows[0]; OperatorCode = row.Code; OperatorName = row.Name; } } }