private void IdListBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { string table = ((Main)Jvedio.GetWindow.Get("Main")).GetCurrentList(); string movieid = IdListBox.SelectedItem.ToString(); if (string.IsNullOrEmpty(table)) { vieModel.Query(movieid); } else { vieModel.Query(movieid, table); } }
private void SaveInfo(string filepath) { if (vieModel.DetailMovie == null) { return; } if (!string.IsNullOrEmpty(vieModel.DetailMovie.id)) { //视频类型、文件大小、创建时间 vieModel.DetailMovie.filepath = filepath; FileInfo fileInfo = new FileInfo(filepath); string id = Identify.GetFanhao(fileInfo.Name); int vt = (int)Identify.GetVideoType(id); if (vt > 0) { vieModel.DetailMovie.vediotype = vt; } if (File.Exists(filepath)) { string createDate = ""; try { createDate = fileInfo.LastWriteTime.ToString("yyyy-MM-dd HH:mm:ss"); } catch { } if (createDate == "") { createDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); } vieModel.DetailMovie.otherinfo = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); vieModel.DetailMovie.scandate = createDate; } vieModel.SaveModel(); string table = ((Main)GetWindowByName("Main")).GetCurrentList(); if (string.IsNullOrEmpty(table)) { vieModel.Query(vieModel.id); } else { vieModel.Query(vieModel.id, table); } HandyControl.Controls.Growl.Success(Jvedio.Language.Resources.Message_EditUpdateSuccess, "EditGrowl"); } else { vieModel.Refresh(filepath); } }
public WindowEdit(string id, string tablename) { InitializeComponent(); ID = id; vieModel = new VieModel_Edit(); vieModel.Query(ID, tablename); this.DataContext = vieModel; }
public void ChoseMovie(object sender, RoutedEventArgs e) { System.Windows.Forms.OpenFileDialog OpenFileDialog1 = new System.Windows.Forms.OpenFileDialog(); OpenFileDialog1.Title = "选择一个视频"; OpenFileDialog1.FileName = ""; OpenFileDialog1.Filter = "常见视频文件(*.avi, *.mp4, *.mkv, *.mpg, *.rmvb)| *.avi; *.mp4; *.mkv; *.mpg; *.rmvb|其它视频文件((*.rm, *.mov, *.mpeg, *.flv, *.wmv, *.m4v)| *.rm; *.mov; *.mpeg; *.flv; *.wmv; *.m4v|所有文件 (*.*)|*.*"; OpenFileDialog1.FilterIndex = 1; OpenFileDialog1.RestoreDirectory = true; if (OpenFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK) { if (!string.IsNullOrEmpty(vieModel.DetailMovie.id)) { vieModel.DetailMovie.filepath = OpenFileDialog1.FileName; vieModel.SaveModel(); new PopupWindow(this, "修改已保存").Show(); vieModel.Query(vieModel.id); } else { vieModel.Refresh(OpenFileDialog1.FileName); } } }
public WindowEdit(string id = "") { InitializeComponent(); ID = id; vieModel = new VieModel_Edit(); if (ID == "") { vieModel.Reset(); } else { vieModel.Query(ID); } this.DataContext = vieModel; }
public WindowEdit(string id = "") { InitializeComponent(); ID = id; vieModel = new VieModel_Edit(); if (ID == "") { vieModel.Reset(); } else { vieModel.Query(ID); } this.DataContext = vieModel; this.Height = SystemParameters.PrimaryScreenHeight * 0.6; this.Width = SystemParameters.PrimaryScreenHeight * 0.6 * 800 / 450; }
public WindowEdit(string id = "") { InitializeComponent(); if (GlobalVariable.GlobalFont != null) { this.FontFamily = GlobalVariable.GlobalFont; //设置字体 } ID = id; vieModel = new VieModel_Edit(); if (ID == "") { vieModel.Reset(); } else { vieModel.Query(ID); } this.DataContext = vieModel; this.Height = SystemParameters.PrimaryScreenHeight * 0.6; this.Width = SystemParameters.PrimaryScreenHeight * 0.6 * 800 / 450; }
private void IdListBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { string movieid = IdListBox.SelectedItem.ToString(); vieModel.Query(movieid); }