private static string AddEngineerQuery(EngineerAgroclimate engineer) { return("INSERT INTO engineeragroclimate " + $"VALUES ({engineer.Tab_Number}, '{engineer.Telephone_Number}', " + $" '{engineer.Last_Name}', '{engineer.First_Name}', '{engineer.Patronym}', " + $"{ (engineer.Email != null ? $"'{engineer.Email}'" : "NULL") }); "); }
private static string UpdateEngineerQuery(EngineerAgroclimate engineer) => "UPDATE engineerAgroclimate " + $"SET telephone_number = '{engineer.Telephone_Number}', " + $"last_name = '{engineer.Last_Name}', " + $"first_name = '{engineer.First_Name}', " + $"patronym = '{engineer.Patronym}', " + $"email = {(engineer.Email != null ? $"'{engineer.Email}'" : "NULL")} " + $"WHERE tab_number = {engineer.Tab_Number};";
internal void AddRequest(string name, int duration, Company selectedCompany, EngineerAgroclimate selectedEngineer, Brigadier selectedBrigadier) { PostgresService.Instance.AddRequest(name, duration, selectedCompany, selectedEngineer, selectedBrigadier); GoToMain(); }
public void UpdateEngineer(EngineerAgroclimate engineer) { PostgresService.Instance.UpdateEngineer(engineer); }
public void UpdateEngineer(EngineerAgroclimate engineer) { ExecuteInternal(UpdateEngineerQuery(engineer)); }
private static string AddRequestQuery(string name, int duration, Company selectedCompany, EngineerAgroclimate selectedEngineer, Brigadier selectedBrigadier) => "INSERT INTO request (request_name, tab_number, approximate_duration, code_edrpou, telephone_number_of_brigadier) " + $"VALUES ('{name}', {selectedEngineer.Tab_Number}, {duration}, {selectedCompany.Code_edrpou}, {selectedBrigadier.Telephone_Number_Of_Brigadier});";
public void AddEngineer(EngineerAgroclimate engineer) { ExecuteInternal(AddEngineerQuery(engineer)); }
public void AddRequest(string name, int duration, Company selectedCompany, EngineerAgroclimate selectedEngineer, Brigadier selectedBrigadier) { ExecuteInternal(AddRequestQuery(name, duration, selectedCompany, selectedEngineer, selectedBrigadier)); }
public bool CreateNewEngineer(EngineerAgroclimate engineer) { PostgresService.Instance.AddEngineer(engineer); return(true); }
public void ChangeSelectedEngineer(EngineerAgroclimate engineer) { SelectedEngineer = engineer; }
public AddEngineerViewModel() { Model = new AddEngineerModel(); Engineer = new EngineerAgroclimate(); }