public PicView GetPic(int picId) { PicView pic = new PicView(); SqlCommand cmd = con.CreateCommand(); cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "sp_getPicture"; cmd.Parameters.Add("@picId", SqlDbType.VarChar).Value = picId; try { con.Open(); SqlDataReader reader = cmd.ExecuteReader(); if (reader.Read()) { pic.Title = (string)reader["title"]; pic.Name = (string)reader["file_name"]; pic.Price = (int)reader["price"]; return(pic); } return(null); } catch (System.Exception ex) { throw ex; } finally { cmd.Dispose(); cmd = null; con.Close(); } }
public ActionResult Index([FromQuery] int picId) { PicView model = new PicView(); model = _picData.GetPic(picId); return(View(model)); }
public FormMain(SCIPackage package, SCIPackage translate) { _package = package; _translate = translate; InitializeComponent(); Text = package.GameDirectory; SetStyle(ControlStyles.OptimizedDoubleBuffer, true); sc.Panel2.Controls.Add(hexViewer = new HexViewer()); sc.Panel2.Controls.Add(textViewer = new TextViewer()); sc.Panel2.Controls.Add(fontView = new FontView()); sc.Panel2.Controls.Add(scriptView = new ScriptView()); sc.Panel2.Controls.Add(vocabView = new VocabView()); sc.Panel2.Controls.Add(msgView = new MsgView()); sc.Panel2.Controls.Add(picView = new PicView()); foreach (ResType resType in Enum.GetValues(typeof(ResType))) { var resources = package.GetResources(resType); if (!resources.Any()) { continue; } TreeNode tnRes = tv.Nodes.Add(ResTypeName(resType)); tnRes.ImageKey = "folder"; tnRes.SelectedImageKey = tnRes.ImageKey; foreach (var res in resources) { TreeNode tnRec = tnRes.Nodes.Add(res.ToString()); tnRec.ImageKey = ResTypeKey(resType); tnRec.SelectedImageKey = tnRec.ImageKey; tnRec.Tag = res; } } if (_translate == null) { tsbTranslated.Checked = false; tsbTranslated.Visible = false; tsbSave.Visible = false; } }
private void Button_Click_15(object sender, RoutedEventArgs e) { PicView picView = new PicView(); picView.Show(); }