private void Save_Click(object sender, RoutedEventArgs e) { DataDAO.getDataDAO().Smerovi.Add(vm.Smer); DataDAO.getDataDAO().writeSmerToFile <Smer>(DataDAO.getDataDAO().Smerovi); MessageBox.Show("Smer je uspesno kreiran."); this.Close(); }
private void Save_Click(object sender, RoutedEventArgs e) { if (!vm.ProzorJeDemoMod) { for (int i = 0; i < vm.SviSmerovi.Count; ++i) { if (vm.SviSmerovi[i].IsChecked == true) { vm.Predmet.Smerovi.Add(vm.Smerovi[i]); } } for (int i = 0; i < vm.SviSoftveri.Count; ++i) { if (vm.SviSoftveri[i].IsChecked == true) { vm.Predmet.NeophodanSoftver.Add(vm.Softveri[i]); } } DataDAO.getDataDAO().Predmeti.Add(vm.Predmet); DataDAO.getDataDAO().writePredmetToFile <Predmet>(DataDAO.getDataDAO().Predmeti); MessageBox.Show("Predmet je uspesno kreiran."); this.Close(); } else { MessageBoxResult messageBox = System.Windows.MessageBox.Show("Nalazite se u demo modu, uneseni podaci nece biti sacuvani. Da li ste sugurni da zelite izaci iz demo moda?", "Napusti demo mod", System.Windows.MessageBoxButton.YesNo); if (messageBox == MessageBoxResult.Yes) { this.Close(); } } }
/// <summary> /// Synchronise the project with the connector given the project GUID /// </summary> /// <param name="projectId"></param> public static void SynchroniseProjectData(string projectId) { MessagingCenter.Send <Application, string>(Application.Current, "SyncMessage", "Synchronisiert ..."); Project proj = Project.FetchProject(projectId); DataDAO.SynchroniseDataForProject(projectId); }
private void button14_Click_1(object sender, EventArgs e) { DataDAO dataDAO = new DataDAO(); dataGridView2.DataSource = dataDAO.GetHP(MaKhoa(comboBox4.Text)); dataGridView3.Rows.Clear(); }
private void Save_Click(object sender, RoutedEventArgs e) { DataDAO.getDataDAO().Softveri.Add(vm.Softver); DataDAO.getDataDAO().writeSoftverToFile <Softver>(DataDAO.getDataDAO().Softveri); System.Windows.MessageBox.Show("Softver je uspesno kreiran."); this.Close(); }
private void Save_Click(object sender, RoutedEventArgs e) { vm.Ucionica.InstaliranSoftver.Clear(); for (int i = 0; i < vm.SviSoftveri.Count; ++i) { if (vm.SviSoftveri[i].IsChecked == true) { vm.Ucionica.InstaliranSoftver.Add(vm.Softveri[i]); } } List <Ucionica> ucionice = new List <Ucionica>(); foreach (Ucionica ucionica in DataDAO.getDataDAO().Ucionice) { if (ucionica.Id == vm.stariIdUcinice) { ucionice.Add(vm.Ucionica); } else { ucionice.Add(ucionica); } } DataDAO.getDataDAO().Ucionice = ucionice; DataDAO.getDataDAO().writeUcionicaToFile <Ucionica>(ucionice); this.Close(); }
/// <summary> /// Save a geometry to the database given a list of coordinates and a name /// </summary> /// <param name="pointList"></param> /// <param name="name"></param> public static void SaveGeometry(List <Mapsui.Geometries.Point> pointList, string name) { var geom = new ReferenceGeometry(); geom.geometryId = Guid.NewGuid().ToString(); geom.geometryName = name; geom.geometry = DataDAO.CoordinatesToGeoJSON(pointList); geom.userName = App.CurrentUser.userId; geom.fullUserName = App.CurrentUser.firstName + " " + App.CurrentUser.name; geom.timestamp = DateTime.Now; geom.creationTime = DateTime.Now; geom.status = -1; geom.readOnly = false; var proj = Project.FetchCurrentProject(); geom.project_fk = proj.Id; using (SQLiteConnection conn = new SQLiteConnection(Preferences.Get("databaseLocation", ""))) { conn.Insert(geom); var project = conn.GetWithChildren <Project>(proj.Id); project.geometries = conn.Table <ReferenceGeometry>().Where(g => g.project_fk == proj.Id).ToList(); conn.UpdateWithChildren(project); } }
private void TrangChu_Load(object sender, EventArgs e) { DataDAO dataDAO = new DataDAO(); foreach (var item in dataDAO.GetTenK()) { comboBox1.Items.Add(item.TenKhoa); } }
public void CreateProject() { string dbName = "biodivcollector_database.sqlite"; string folderPath = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "..", "Library"); string fullPath = Path.Combine(folderPath, dbName); string json = "{ \"projectId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\"startDateTime\": \"2021-05-21T12:15:39.961Z\",\"projectName\": \"TestProject\",\"description\": \"project description\",\"projectNumber\": \"123456\",\"id_Extern\": \"string\",\"projectStatusId\": 1,\"projectManager\": \"Christoph Suter\",\"projectConfigurator\": \"Nicholas Dawes\",\"geometries\": [{\"geometryId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\"geometryName\": \"string\",\"geometry\": \"string\",\"userName\": \"string\",\"fullUserName\": \"string\",\"timestamp\": \"2021-05-21T12:15:39.962Z\",\"creationTime\": \"2021-05-21T12:15:39.962Z\",\"status\": 0,\"readOnly\": true,\"records\": [{\"recordId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\"formId\": 0,\"userName\": \"string\",\"fullUserName\": \"string\",\"timestamp\": \"2021-05-21T12:15:39.962Z\",\"creationTime\": \"2021-05-21T12:15:39.962Z\",\"status\": 0,\"readOnly\": true,\"texts\": [{\"textId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\"title\": \"string\",\"value\": \"string\",\"formFieldId\": 0,\"fieldChoiceId\": 0}],\"numerics\": [{\"numericId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\"title\": \"string\",\"value\": 0,\"formFieldId\": 0}],\"booleans\": [{\"booleanId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\"title\": \"string\",\"value\": true,\"formFieldId\": 0}]}]}],\"records\": [{\"recordId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\"formId\": 0,\"userName\": \"string\",\"fullUserName\": \"string\",\"timestamp\": \"2021-05-21T12:15:39.962Z\",\"creationTime\": \"2021-05-21T12:15:39.962Z\",\"status\": 0,\"readOnly\": true,\"texts\": [{\"textId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\"title\": \"string\",\"value\": \"string\",\"formFieldId\": 0,\"fieldChoiceId\": 0}],\"numerics\": [{\"numericId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\"title\": \"string\",\"value\": 0,\"formFieldId\": 0}],\"booleans\": [{\"booleanId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\"title\": \"string\",\"value\": true,\"formFieldId\": 0}]}],\"forms\": [{\"formId\": 0,\"title\": \"string\",\"timestamp\": \"2021-05-21T12:15:39.962Z\",\"formFields\": [{\"fieldId\": 0,\"typeId\": 0,\"title\": \"string\",\"description\": \"string\",\"source\": \"string\",\"order\": 0,\"mandatory\": true,\"useInRecordTitle\": true}]}],\"layers\": [{\"layerId\": 0,\"title\": \"string\",\"url\": \"string\",\"wmsLayer\": \"string\",\"visible\": true,\"opacity\": 0,\"order\": 0}]}"; DataDAO.GetProjectDataFromJSON(json); }
private void comboBox4_Click(object sender, EventArgs e) { DataDAO dataDAO = new DataDAO(); comboBox4.Items.Clear(); foreach (var item in dataDAO.GetTenK()) { comboBox4.Items.Add(item.TenKhoa); } }
private void button9_Click(object sender, EventArgs e) { DataDAO dataDAO = new DataDAO(); HocPhan hocPhan = new HocPhan(); hocPhan.Ma_HP = textBox8.Text; hocPhan.Ten_HP = textBox9.Text; dataDAO.UpdateHP(textBox8.Text, hocPhan); Deletetextbox(); }
private void AddHocPhan_Load(object sender, EventArgs e) { DataDAO dataDAO = new DataDAO(); comboBox1.Items.Clear(); foreach (var item in dataDAO.GetTenK()) { comboBox1.Items.Add(item.TenKhoa); } }
public IzmeniUcionicuDialog(Ucionica ucionica) { InitializeComponent(); vm = new ViewModel(); vm.Ucionica = ucionica; vm.stariIdUcinice = ucionica.Id; vm.Softveri = DataDAO.getDataDAO().Softveri; vm.SviSoftveri = new List <CheckBox>(); this.DataContext = vm; int brojacSo = 0; foreach (Softver softver in vm.Softveri) { if (brojacSo % 6 == 0) { ListaInstaliranogSoftvera.RowDefinitions.Add(new RowDefinition()); } // Define StackPanel to CheckBox StackPanel sp = new StackPanel(); sp.MinHeight = 56; sp.MaxHeight = 56; sp.Margin = new System.Windows.Thickness(5, 2, 5, 2); // Define tag which is CheckVox CheckBox cb = new CheckBox(); cb.FontSize = 24; cb.Margin = new System.Windows.Thickness(5, 5, 5, 5); cb.Content = softver.Naziv; foreach (Softver softverOznacen in vm.Ucionica.InstaliranSoftver) { if (softverOznacen.Id == softver.Id) { cb.IsChecked = true; break; } } vm.SviSoftveri.Add(cb); sp.Children.Add(cb); Grid.SetColumn(sp, brojacSo % 6); Grid.SetRow(sp, brojacSo / 6); ListaInstaliranogSoftvera.Children.Add(sp); ++brojacSo; } }
public double GetLowestTemperature() { var dao = new DataDAO(); var datas = dao.GetMany(15); if (datas == null || datas.Count == 0) { return(0); } return(datas.OrderBy(d => d.Temperature) .FirstOrDefault() .Temperature); }
private void button1_Click(object sender, EventArgs e) { DataDAO dataDAO = new DataDAO(); HocPhan hocPhan = new HocPhan(); hocPhan.Ma_HP = textBox1.Text; hocPhan.Ten_HP = textBox2.Text; hocPhan.Ma_D = ""; hocPhan.Ma_SV = ""; hocPhan.ID_Khoa = MaKhoa(comboBox1.Text); dataDAO.Insert(hocPhan); Deletetextbox(); Close(); }
public FatcaDTO GetFatcaDTO(string SearchString, int pageIndex, int pageSelected, string sortKey, string asc) { DataDAO dao = new DataDAO(); FatcaDTO dto = new FatcaDTO { DataList = dao.GetData(SearchString.Replace("undefined", ""), pageIndex, pageSelected, sortKey, asc), RowsCount = dao.GetRowsCount(SearchString) }; //return JsonConvert.SerializeObject(dto, new JsonSerializerSettings() { DateFormatString = "dd.MM.yyyy" }); return(dto); }
private void button5_Click(object sender, EventArgs e) { DataDAO dataDAO = new DataDAO(); dataGridView1.Rows.Clear(); foreach (var item in dataDAO.Search(textBox6.Text)) { DataGridViewRow row1 = new DataGridViewRow(); DataGridViewCell _cell; _cell = new DataGridViewTextBoxCell(); _cell.Value = item.Ma_SV; row1.Cells.Add(_cell); _cell = new DataGridViewTextBoxCell(); _cell.Value = item.Ten_SV; row1.Cells.Add(_cell); _cell = new DataGridViewTextBoxCell(); _cell.Value = item.NgaySinh; row1.Cells.Add(_cell); _cell = new DataGridViewTextBoxCell(); _cell.Value = item.QueQuan; row1.Cells.Add(_cell); _cell = new DataGridViewCheckBoxCell(); _cell.Value = item.GioiTinh; row1.Cells.Add(_cell); _cell = new DataGridViewTextBoxCell(); _cell.Value = item.HoKhauTT; row1.Cells.Add(_cell); _cell = new DataGridViewTextBoxCell(); _cell.Value = item.DiemTB; row1.Cells.Add(_cell); _cell = new DataGridViewTextBoxCell(); _cell.Value = item.MaKhoa; row1.Cells.Add(_cell); _cell = new DataGridViewTextBoxCell(); _cell.Value = item.TenKhoa; row1.Cells.Add(_cell); dataGridView1.Rows.Add(row1); } Deletetextbox(); }
public void PostAsync(string json) { var factory = new TaskFactory().StartNew( () => { var factory = new Factory(); var data = factory.BuildData(json); if (data != null) { var dao = new DataDAO(); dao.Post(data); } }); }
/// <summary> /// Download a project from the connector given the project GUID /// </summary> /// <param name="projectId"></param> public static async Task DownloadProjectData(string projectId) { await Task.Run(() => { MessagingCenter.Send <Application, string>(Application.Current, "SyncMessage", "Synchronisiert ..."); Project proj = Project.FetchProject(projectId); #if __IOS__ // iOS-specific code DataDAO.GetJsonStringForProject(projectId.ToUpper(), null); #else // Android-specific code DataDAO.GetJsonStringForProject(projectId, null); #endif }); }
private void button3_Click(object sender, EventArgs e) { SinhVien sinhVien = new SinhVien(); DataDAO dataDAO = new DataDAO(); sinhVien.Ma_SV = textBox1.Text; sinhVien.Ten_SV = textBox2.Text; sinhVien.NgaySinh = Convert.ToDateTime(dateTimePicker1.Value); sinhVien.QueQuan = textBox3.Text; sinhVien.HoKhauTT = textBox4.Text; sinhVien.DiemTB = float.Parse(textBox5.Text); sinhVien.GioiTinh = radiobutton(); sinhVien.MaKhoa = MaKhoa(comboBox1.Text); dataDAO.Update(sinhVien); Deletetextbox(); }
public PrikaziSveUcioniceDialog() { InitializeComponent(); IzabranaUcionica = null; this.DataContext = this; Ucionice = new ObservableCollection <Ucionica>(); SveUcionice = new List <Ucionica>(); Softveri = DataDAO.getDataDAO().Softveri; SviSoftveri = new List <CheckBox>(); foreach (Ucionica u in DataDAO.getDataDAO().Ucionice) { Ucionice.Add(u); SveUcionice.Add(u); } int brojacSo = 0; foreach (Softver softver in Softveri) { if (brojacSo % 6 == 0) { ListaInstaliranogSoftvera.RowDefinitions.Add(new RowDefinition()); } // Define StackPanel to CheckBox StackPanel sp = new StackPanel(); sp.MinHeight = 56; sp.MaxHeight = 56; sp.Margin = new System.Windows.Thickness(5, 2, 5, 2); // Define tag which is CheckVox CheckBox cb = new CheckBox(); cb.FontSize = 24; cb.Margin = new System.Windows.Thickness(5, 5, 5, 5); cb.Content = softver.Naziv; SviSoftveri.Add(cb); sp.Children.Add(cb); Grid.SetColumn(sp, brojacSo % 6); Grid.SetRow(sp, brojacSo / 6); ListaInstaliranogSoftvera.Children.Add(sp); ++brojacSo; } }
private void dataGridView2_CellClick(object sender, DataGridViewCellEventArgs e) { dataGridView3.Rows.Clear(); DataGridViewRow row = this.dataGridView2.Rows[e.RowIndex]; DataDAO dataDAO = new DataDAO(); textBox8.Text = row.Cells[0].Value.ToString(); textBox9.Text = row.Cells[1].Value.ToString(); foreach (var item in dataDAO.GetSVHP(row.Cells[0].Value.ToString())) { DataGridViewRow row1 = new DataGridViewRow(); DataGridViewCell _cell; _cell = new DataGridViewTextBoxCell(); _cell.Value = item.Ma_SV; row1.Cells.Add(_cell); _cell = new DataGridViewTextBoxCell(); _cell.Value = item.Ten_SV; row1.Cells.Add(_cell); _cell = new DataGridViewTextBoxCell(); _cell.Value = item.NgaySinh; row1.Cells.Add(_cell); _cell = new DataGridViewCheckBoxCell(); _cell.Value = item.GioiTinh; row1.Cells.Add(_cell); _cell = new DataGridViewTextBoxCell(); _cell.Value = item.HoKhauTT; row1.Cells.Add(_cell); _cell = new DataGridViewTextBoxCell(); _cell.Value = item.QueQuan; row1.Cells.Add(_cell); _cell = new DataGridViewTextBoxCell(); _cell.Value = item.DiemTB; row1.Cells.Add(_cell); dataGridView3.Rows.Add(row1); } }
public PrikaziSveSmeroveDialog() { InitializeComponent(); IzabranSmer = null; this.DataContext = this; Smerovi = new ObservableCollection <Smer>(); SviSmerovi = new List <Smer>(); foreach (Smer s in DataDAO.getDataDAO().Smerovi) { Smerovi.Add(s); SviSmerovi.Add(s); } SmerBeg = DateTime.Now; SmerEnd = DateTime.Now; }
private void Save_Click(object sender, RoutedEventArgs e) { List <Softver> softveri = new List <Softver>(); foreach (Softver softver in DataDAO.getDataDAO().Softveri) { if (softver.Id == vm.StariIdSoftvera) { softveri.Add(vm.Softver); } else { softveri.Add(softver); } } DataDAO.getDataDAO().Softveri = softveri; DataDAO.getDataDAO().writeSoftverToFile <Softver>(softveri); this.Close(); }
private void ObrisiSmer_Click(object sender, RoutedEventArgs e) { MessageBoxResult messageBox = System.Windows.MessageBox.Show( "Da li ste sigurni da zelite obrisati smer (" + IzabranSmer.Id + " " + IzabranSmer.Naziv + ")?", "Potvrda brisanja", System.Windows.MessageBoxButton.YesNo); if (messageBox == MessageBoxResult.Yes) { Smerovi.Remove(IzabranSmer); List <Smer> smerovi = new List <Smer>(); foreach (Smer s in Smerovi) { smerovi.Add(s); } DataDAO.getDataDAO().Smerovi = smerovi; DataDAO.getDataDAO().writeSmerToFile <Smer>(smerovi); } }
public PrikaziSveSoftvereDialog() { InitializeComponent(); IzabranSoftver = null; this.DataContext = this; Softveri = new ObservableCollection <Softver>(); SviSoftveri = new List <Softver>(); foreach (Softver s in DataDAO.getDataDAO().Softveri) { Softveri.Add(s); SviSoftveri.Add(s); } GodinaIzdavanjaMin = 2000; GodinaIzdavanjaMax = 2000; }
private void ObrisiUcionicu_Click(object sender, RoutedEventArgs e) { MessageBoxResult messageBox = System.Windows.MessageBox.Show( "Da li ste sigurni da zelite obrisati smer (" + IzabranaUcionica.Id + " " + ")?", "Potvrda brisanja", System.Windows.MessageBoxButton.YesNo); if (messageBox == MessageBoxResult.Yes) { Ucionice.Remove(IzabranaUcionica); List <Ucionica> ucionice = new List <Ucionica>(); foreach (Ucionica p in Ucionice) { ucionice.Add(p); } DataDAO.getDataDAO().Ucionice = ucionice; DataDAO.getDataDAO().writeUcionicaToFile <Ucionica>(ucionice); } }
private void button1_Click(object sender, EventArgs e) { SinhVien sinh = new SinhVien(); Khoa khoa = new Khoa(); DataDAO data = new DataDAO(); sinh.Ma_SV = textBox2.Text; sinh.Ten_SV = textBox3.Text; sinh.NgaySinh = Convert.ToDateTime(dateTimePicker1.Text); sinh.QueQuan = textBox4.Text; sinh.HoKhauTT = textBox5.Text; sinh.GioiTinh = checkGT(); sinh.DiemTB = float.Parse(textBox6.Text); sinh.MaKhoa = MaKhoa(); khoa.ID_Khoa = MaKhoa(); khoa.TenKhoa = comboBox1.Text; Deletetextbox(); data.AddSV(sinh); Close(); }
private void ObrisiPredmet_Click(object sender, RoutedEventArgs e) { MessageBoxResult messageBox = System.Windows.MessageBox.Show( "Da li ste sigurni da zelite obrisati smer (" + IzabranPredmet.Id + " " + IzabranPredmet.Naziv + ")?", "Potvrda brisanja", System.Windows.MessageBoxButton.YesNo); if (messageBox == MessageBoxResult.Yes) { Predmeti.Remove(IzabranPredmet); List <Predmet> predmeti = new List <Predmet>(); foreach (Predmet p in Predmeti) { predmeti.Add(p); } DataDAO.getDataDAO().Predmeti = predmeti; DataDAO.getDataDAO().writePredmetToFile <Predmet>(predmeti); } }
private void Save_Click(object sender, RoutedEventArgs e) { for (int i = 0; i < vm.SviSoftveri.Count; ++i) { if (vm.SviSoftveri[i].IsChecked == true) { vm.Ucionica.InstaliranSoftver.Add(vm.Softveri[i]); } } DataDAO.getDataDAO().Ucionice.Add(vm.Ucionica); DataDAO.getDataDAO().writeUcionicaToFile <Ucionica>(DataDAO.getDataDAO().Ucionice); if (Check != null) { Check(vm.Ucionica); } MessageBox.Show("Ucionica je uspesno kreirana."); this.Close(); }