public Employees Employees_GetByPrimaryKey(System.Int32 employeeID) { Employees obj = new Employees(); if (obj.LoadByPrimaryKey(employeeID)) { return obj; } return null; }
private void btnAdd_Click(object sender, RoutedEventArgs e) { // Create a new Employee Employees emp = new Employees(); emp.FirstName = "David"; emp.LastName = "Parsons"; // Add it to the context so RIA knows about it employeesDomainDataSource.DataView.Add(emp); }
public Employees Employees_QueryForEntity(string serializedQuery) { EmployeesQuery query = EmployeesQuery.SerializeHelper.FromXml( serializedQuery, typeof(EmployeesQuery), AllKnownTypes) as EmployeesQuery; Employees obj = new Employees(); if (obj.Load(query)) { return obj; } return null; }
private void Form1_Load(object sender, EventArgs e) { Employees emp = new Employees(); emp.EmployeeID = 44; string ln = emp.LastName; emp.LastName = "Griffin"; emp.FirstName = "Mike"; emp.Save(); LoadGrid(); }
private void Form1_Load(object sender, EventArgs e) { try { Employees emp = new Employees(); if (emp.LoadByPrimaryKey(3)) { this.textBox1.Text = emp.LastName + ", " + emp.FirstName; } } catch (Exception ex) { string error = ex.Message; } }
private void buttonUpdate_Click(object sender, EventArgs e) { try { DataGridViewSelectedRowCollection selectedRows = dataGrid.SelectedRows; foreach (DataGridViewRow row in selectedRows) { BusinessObjects.Employees emp = row.DataBoundItem as BusinessObjects.Employees; emp.FirstName = "Changed"; emp.LastName = "Changed"; } } catch (Exception ex) { lblError.Text = ex.Message; } }
private void buttonDelete_Click(object sender, EventArgs e) { try { DataGridViewSelectedRowCollection selectedRows = dataGrid.SelectedRows; foreach (DataGridViewRow row in selectedRows) { BusinessObjects.Employees emp = row.DataBoundItem as BusinessObjects.Employees; if (emp == null) { continue; // they tried to delete the "New Record Row" } emp.MarkAsDeleted(); } } catch (Exception ex) { lblError.Text = ex.Message; } }
public jsResponse<EmployeesCollection, Employees> Employees_Save(Employees entity) { jsResponse<EmployeesCollection, Employees> response = new jsResponse<EmployeesCollection, Employees>(); try { entity.Save(); response.entity = entity; } catch (Exception ex) { response.exception = ex.Message; } return response; }
public void UpdateEmployees(BusinessObjects.Employees obj) { obj.AcceptChanges(); obj.MarkAllColumnsAsDirty(EntitySpaces.Interfaces.esDataRowState.Modified); obj.Save(); }
public Employees Employees_SaveEntity(Employees entity) { if (entity != null) { entity.Save(); if (entity.RowState != tgDataRowState.Deleted && entity.RowState != tgDataRowState.Invalid) { return entity; } } return null; }
public jsResponse<EmployeesCollection, Employees> Employees_LoadByPrimaryKeyHierarchical(int primaryKey) { jsResponse<EmployeesCollection, Employees> response = new jsResponse<EmployeesCollection, Employees>(); EmployeesQuery q = new EmployeesQuery(); q.Select(q.EmployeeID, q.FirstName, q.LastName, q.LastName.As("ExtraColumn"), q.EmployeeID.As("IDasExtraColumn")); q.Where(q.EmployeeID == primaryKey); Employees emp = new Employees(); emp.Load(q); int count1 = emp.OrdersCollectionByEmployeeID.Count; int count2 = emp.OrdersCollectionByEmployeeID[0].OrderDetailsCollectionByOrderID.Count; response.entity = emp; return response; }
public void DeleteEmployees(BusinessObjects.Employees obj) { BusinessObjects.Employees.Delete(obj.EmployeeID.Value); }
public jsResponse<OrdersCollection, Orders> Employees_OrdersCollectionByEmployeeID(System.Int32 employeeID) { jsResponse<OrdersCollection, Orders> response = new jsResponse<OrdersCollection, Orders>(); try { Employees entity = new Employees(); entity.EmployeeID = employeeID; response.collection = entity.OrdersCollectionByEmployeeID; } catch (Exception ex) { response.exception = ex.Message; } return response; }
public jsResponse<TerritoriesCollection, Territories> Employees_UpToTerritoriesCollection(System.Int32 employeeID) { jsResponse<TerritoriesCollection, Territories> response = new jsResponse<TerritoriesCollection, Territories>(); try { Employees entity = new Employees(); entity.EmployeeID = employeeID; response.collection = entity.UpToTerritoriesCollection; } catch (Exception ex) { response.exception = ex.Message; } return response; }
public void InsertEmployees(BusinessObjects.Employees obj) { obj.RowState = EntitySpaces.Interfaces.esDataRowState.Added; obj.Save(); }
private void EnsureData() { EmployeesQuery q = new EmployeesQuery(); q.tg.CountAll = true; int i = q.ExecuteScalar<int>(); if (i == 0) { Employees emp = new Employees(); emp.FirstName = "Mike"; emp.LastName = "Griffin"; emp.Save(); } }
private void buttonAdd_Click(object sender, EventArgs e) { BusinessObjects.Employees emp = coll.AddNew(); emp.FirstName = "Mr."; emp.LastName = "EntitySpaces"; }
public jsResponse<EmployeesCollection, Employees> Employees_LoadByPrimaryKey(System.Int32 employeeID) { jsResponse<EmployeesCollection, Employees> response = new jsResponse<EmployeesCollection, Employees>(); try { Employees entity = new Employees(); if (entity.LoadByPrimaryKey(employeeID)) { response.entity = entity; } } catch (Exception ex) { response.exception = ex.Message; } return response; }
public jsResponse<EmployeesCollection, Employees> Employees_UpToEmployeesByReportsTo(System.Int32 employeeID) { jsResponse<EmployeesCollection, Employees> response = new jsResponse<EmployeesCollection, Employees>(); try { Employees entity = new Employees(); entity.EmployeeID = employeeID; response.entity = entity.UpToEmployeesByReportsTo; } catch (Exception ex) { response.exception = ex.Message; } return response; }