private void CarregaDados() { dataBase = gerDb.ReadDB(); txtXampp.Text = dataBase.XamppDirectory; PreencheComboBox(); void PreencheComboBox() { cmbProjetos.Items.Clear(); if (dataBase.Projects == null) { return; } foreach (ProjectDTO project in dataBase.Projects) { int item = cmbProjetos.Items.Add(project.ProjectName); if (project.ProjectName == dataBase.Project) { cmbProjetos.SelectedIndex = item; } } } }
public FrmGerenciarProjetos() { InitializeComponent(); db = new GerenciarDB(); dataBase = db.ReadDB(); CarregaDados(); }
public FrmProjectSelector() { InitializeComponent(); gerDb = new GerenciarDB(); dataBase = gerDb.ReadDB(); CarregaDados(); }
public DbDTO ToSerializableDTO() { var jsonObj = new DbDTO { Tables = this.TableDict.ToDictionary(x => x.Key, x => x.Value.ToSerializableDTO()) }; return(jsonObj); }
public IHttpActionResult UpdateData(DbDTO cmd) { using (SqlConnection con = new SqlConnection("Data Source=tcp:rezija2roj.database.windows.net,1433;Initial Catalog=test;User ID=demo;Password=zaq1@WSX;")) { con.Open(); using (SqlCommand com = new SqlCommand("Update " + cmd.Db + " set " + cmd.Set + " where " + cmd.Where, con)) { com.ExecuteNonQuery(); } con.Close(); } return(Ok()); }
public static XrmDb RestoreSerializableDTO(XrmDb current, DbDTO model) { var clonedTables = model.Tables.ToDictionary(x => x.Key, x => DbTable.RestoreSerializableDTO(new DbTable(current.EntityMetadata[x.Key]), x.Value)); var clonedDB = new XrmDb(current.EntityMetadata, current.OnlineProxy) { TableDict = clonedTables }; foreach (var table in clonedTables) { table.Value.RestoreFromDTOPostProcess(clonedDB); } return(clonedDB); }