public AppDetailWindow(APKSoftModel app) { InitializeComponent(); this.showProperty("名称", app.Name.ToString()); this.showProperty("价格", app.Price.ToString()); this.showProperty("版本", app.Version.ToString()); this.showProperty("上传时间", app.AddDate.ToString()); this.showProperty("应用分类", app.ClassID.ToString()); this.showProperty("应用子分类", app.SubClassID.ToString()); this.showProperty("短描述", app.Sketch.ToString()); this.showProperty("描述", app.Detail.ToString()); if (app.Status == 0) { this.offlineButton.IsEnabled = false; this.onlineButton.IsEnabled = false; } else if (app.Status == 1) { this.approveButton.IsEnabled = false; this.rejectButton.IsEnabled = false; this.onlineButton.IsEnabled = false; } else if (app.Status == -2) { this.approveButton.IsEnabled = false; this.rejectButton.IsEnabled = false; this.offlineButton.IsEnabled = false; } this.thumbnailImage.Source = new BitmapImage(new Uri(app.ICON, UriKind.Absolute)); this.app = app; }
private void viewDetailButton_Click(object sender, RoutedEventArgs e) { APKSoftModel app = this.notApprovedAppListBox.SelectedItem as APKSoftModel; if (app == null) { return; } AppDetailWindow wnd = new AppDetailWindow(app); wnd.ShowDialog(); }
private IEnumerable <APKSoftModel> getAppFromTable(DataTable dt) { foreach (DataRow dr in dt.Rows) { APKSoftModel app = new APKSoftModel(); app.Id = Convert.ToInt32(dr["ID"]); app.ICON = dr["ICON"] as string; app.FileUrl = dr["FileUrl"] as string; app.Name = dr["Name"] as string; app.ClassID = Convert.ToInt32(dr["ClassID"]); app.SubClassID = Convert.ToInt32(dr["SubClassID"]); app.Sketch = dr["Sketch"] as string; app.Detail = dr["Detail"] as string; app.AddDate = Convert.ToDateTime(dr["AddDate"]); app.UserID = Convert.ToInt32(dr["UserID"]); app.Version = dr["Version"] as string; app.UniqueId = dr["UniqueId"] as string; app.Status = Convert.ToInt32(dr["Status"]); yield return(app); } }