├── CRUDWinFormsMVP.sln ├── CRUDWinFormsMVP ├── App.config ├── CRUDWinFormsMVP.csproj ├── Models │ ├── IPetRepository.cs │ └── PetModel.cs ├── Presenters │ └── PetPresenter.cs ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── Views │ ├── IPetView.cs │ ├── PetView.Designer.cs │ ├── PetView.cs │ └── PetView.resx ├── bin │ └── Debug │ │ ├── CRUDWinFormsMVP.exe │ │ ├── CRUDWinFormsMVP.exe.config │ │ └── CRUDWinFormsMVP.pdb └── obj │ └── Debug │ ├── CRUDWinFormsMVP.Properties.Resources.resources │ ├── CRUDWinFormsMVP.Views.MainView.resources │ ├── CRUDWinFormsMVP.Views.PetView.resources │ ├── CRUDWinFormsMVP.csproj.AssemblyReference.cache │ ├── CRUDWinFormsMVP.csproj.CoreCompileInputs.cache │ ├── CRUDWinFormsMVP.csproj.FileListAbsolute.txt │ ├── CRUDWinFormsMVP.csproj.GenerateResource.cache │ ├── CRUDWinFormsMVP.exe │ ├── CRUDWinFormsMVP.pdb │ ├── DesignTimeResolveAssemblyReferences.cache │ └── DesignTimeResolveAssemblyReferencesInput.cache ├── LICENSE ├── README.md └── VeterinaryDb.sql /CRUDWinFormsMVP.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.32228.343 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CRUDWinFormsMVP", "CRUDWinFormsMVP\CRUDWinFormsMVP.csproj", "{7C2F0CD7-CF1B-41F9-A9B9-132EBA642217}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {7C2F0CD7-CF1B-41F9-A9B9-132EBA642217}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {7C2F0CD7-CF1B-41F9-A9B9-132EBA642217}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {7C2F0CD7-CF1B-41F9-A9B9-132EBA642217}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {7C2F0CD7-CF1B-41F9-A9B9-132EBA642217}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {002004AD-BC90-4896-BE4D-D4E254DE3BEC} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /CRUDWinFormsMVP/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /CRUDWinFormsMVP/CRUDWinFormsMVP.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {7C2F0CD7-CF1B-41F9-A9B9-132EBA642217} 8 | WinExe 9 | CRUDWinFormsMVP 10 | CRUDWinFormsMVP 11 | v4.5 12 | 512 13 | true 14 | 15 | 16 | AnyCPU 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | AnyCPU 27 | pdbonly 28 | true 29 | bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | Form 58 | 59 | 60 | PetView.cs 61 | 62 | 63 | ResXFileCodeGenerator 64 | Resources.Designer.cs 65 | Designer 66 | 67 | 68 | True 69 | Resources.resx 70 | 71 | 72 | PetView.cs 73 | 74 | 75 | SettingsSingleFileGenerator 76 | Settings.Designer.cs 77 | 78 | 79 | True 80 | Settings.settings 81 | True 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /CRUDWinFormsMVP/Models/IPetRepository.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace CRUDWinFormsMVP.Models 8 | { 9 | public interface IPetRepository 10 | { 11 | void Add(PetModel petModel); 12 | void Edit(PetModel petModel); 13 | void Delete(int id); 14 | IEnumerable GetAll(); 15 | IEnumerable GetByValue(string value);//Searchs 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /CRUDWinFormsMVP/Models/PetModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.ComponentModel.DataAnnotations; 7 | using System.ComponentModel; 8 | 9 | namespace CRUDWinFormsMVP.Models 10 | { 11 | public class PetModel 12 | { 13 | //Fields 14 | private int id; 15 | private string name; 16 | private string type; 17 | private string colour; 18 | 19 | //Properties - Validations 20 | [DisplayName("Pet ID")] 21 | public int Id 22 | { 23 | get { return id; } 24 | set { id = value; } 25 | } 26 | 27 | [DisplayName("Pet Name")] 28 | [Required(ErrorMessage ="Pet name is requerid")] 29 | [StringLength(50,MinimumLength =3, ErrorMessage ="Pet name must be between 3 and 50 characters")] 30 | public string Name 31 | { 32 | get { return name; } 33 | set { name = value; } 34 | } 35 | 36 | [DisplayName("Pet Type")] 37 | [Required(ErrorMessage = "Pet type is requerid")] 38 | [StringLength(50, MinimumLength = 3, ErrorMessage = "Pet type must be between 3 and 50 characters")] 39 | public string Type 40 | { 41 | get { return type; } 42 | set { type = value; } 43 | } 44 | 45 | [DisplayName("Pet Colour")] 46 | [Required(ErrorMessage = "Pet colour is requerid")] 47 | [StringLength(50, MinimumLength = 3, ErrorMessage = "Pet colour must be between 3 and 50 characters")] 48 | public string Colour 49 | { 50 | get { return colour; } 51 | set { colour = value; } 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /CRUDWinFormsMVP/Presenters/PetPresenter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows.Forms; 7 | using CRUDWinFormsMVP.Models; 8 | using CRUDWinFormsMVP.Views; 9 | 10 | namespace CRUDWinFormsMVP.Presenters 11 | { 12 | public class PetPresenter 13 | { 14 | //Fields 15 | private IPetView view; 16 | private IPetRepository repository; 17 | private BindingSource petsBindingSource; 18 | private IEnumerable petList; 19 | 20 | //Constructor 21 | public PetPresenter(IPetView view, IPetRepository repository) 22 | { 23 | this.petsBindingSource = new BindingSource(); 24 | this.view = view; 25 | this.repository = repository; 26 | //Subscribe event handler methods to view events 27 | this.view.SearchEvent += SearchPet; 28 | this.view.AddNewEvent += AddNewPet; 29 | this.view.EditEvent += LoadSelectedPetToEdit; 30 | this.view.DeleteEvent += DeleteSelectedPet; 31 | this.view.SaveEvent += SavePet; 32 | this.view.CancelEvent += CancelAction; 33 | //Set pets bindind source 34 | this.view.SetPetListBindingSource(petsBindingSource); 35 | //Load pet list view 36 | LoadAllPetList(); 37 | //Show view 38 | this.view.Show(); 39 | } 40 | 41 | //Methods 42 | private void LoadAllPetList() 43 | { 44 | petList = repository.GetAll(); 45 | petsBindingSource.DataSource = petList;//Set data source. 46 | } 47 | private void SearchPet(object sender, EventArgs e) 48 | { 49 | bool emptyValue = string.IsNullOrWhiteSpace(this.view.SearchValue); 50 | if (emptyValue == false) 51 | petList = repository.GetByValue(this.view.SearchValue); 52 | else petList = repository.GetAll(); 53 | petsBindingSource.DataSource = petList; 54 | } 55 | 56 | private void CancelAction(object sender, EventArgs e) 57 | { 58 | throw new NotImplementedException(); 59 | } 60 | private void SavePet(object sender, EventArgs e) 61 | { 62 | throw new NotImplementedException(); 63 | } 64 | private void DeleteSelectedPet(object sender, EventArgs e) 65 | { 66 | throw new NotImplementedException(); 67 | } 68 | private void LoadSelectedPetToEdit(object sender, EventArgs e) 69 | { 70 | throw new NotImplementedException(); 71 | } 72 | private void AddNewPet(object sender, EventArgs e) 73 | { 74 | throw new NotImplementedException(); 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /CRUDWinFormsMVP/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Windows.Forms; 6 | using CRUDWinFormsMVP.Views; 7 | 8 | 9 | namespace CRUDWinFormsMVP 10 | { 11 | static class Program 12 | { 13 | /// 14 | /// The main entry point for the application. 15 | /// 16 | [STAThread] 17 | static void Main() 18 | { 19 | Application.EnableVisualStyles(); 20 | Application.SetCompatibleTextRenderingDefault(false); 21 | Application.Run(new PetView()); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /CRUDWinFormsMVP/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("CRUDWinFormsMVP")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("CRUDWinFormsMVP")] 13 | [assembly: AssemblyCopyright("Copyright © 2022")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("7c2f0cd7-cf1b-41f9-a9b9-132eba642217")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /CRUDWinFormsMVP/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | 12 | namespace CRUDWinFormsMVP.Properties 13 | { 14 | /// 15 | /// A strongly-typed resource class, for looking up localized strings, etc. 16 | /// 17 | // This class was auto-generated by the StronglyTypedResourceBuilder 18 | // class via a tool like ResGen or Visual Studio. 19 | // To add or remove a member, edit your .ResX file then rerun ResGen 20 | // with the /str option, or rebuild your VS project. 21 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 22 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 23 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 24 | internal class Resources 25 | { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() 33 | { 34 | } 35 | 36 | /// 37 | /// Returns the cached ResourceManager instance used by this class. 38 | /// 39 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 40 | internal static global::System.Resources.ResourceManager ResourceManager 41 | { 42 | get 43 | { 44 | if ((resourceMan == null)) 45 | { 46 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CRUDWinFormsMVP.Properties.Resources", typeof(Resources).Assembly); 47 | resourceMan = temp; 48 | } 49 | return resourceMan; 50 | } 51 | } 52 | 53 | /// 54 | /// Overrides the current thread's CurrentUICulture property for all 55 | /// resource lookups using this strongly typed resource class. 56 | /// 57 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 58 | internal static global::System.Globalization.CultureInfo Culture 59 | { 60 | get 61 | { 62 | return resourceCulture; 63 | } 64 | set 65 | { 66 | resourceCulture = value; 67 | } 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /CRUDWinFormsMVP/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /CRUDWinFormsMVP/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace CRUDWinFormsMVP.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | 26 | [global::System.Configuration.ApplicationScopedSettingAttribute()] 27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 28 | [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)] 29 | [global::System.Configuration.DefaultSettingValueAttribute("Data Source=(local);Initial Catalog=VeterinaryDb;Integrated Security=True")] 30 | public string SqlConnection { 31 | get { 32 | return ((string)(this["SqlConnection"])); 33 | } 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /CRUDWinFormsMVP/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | <?xml version="1.0" encoding="utf-16"?> 7 | <SerializableConnectionString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 8 | <ConnectionString>Data Source=(local);Initial Catalog=VeterinaryDb;Integrated Security=True</ConnectionString> 9 | <ProviderName>System.Data.SqlClient</ProviderName> 10 | </SerializableConnectionString> 11 | Data Source=(local);Initial Catalog=VeterinaryDb;Integrated Security=True 12 | 13 | 14 | -------------------------------------------------------------------------------- /CRUDWinFormsMVP/Views/IPetView.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows.Forms; 7 | 8 | namespace CRUDWinFormsMVP.Views 9 | { 10 | public interface IPetView 11 | { 12 | //Properties - Fields 13 | string PetId { get; set; } 14 | string PetName { get; set; } 15 | string PetType { get; set; } 16 | string PetColour { get; set; } 17 | 18 | string SearchValue { get; set; } 19 | bool IsEdit { get; set; } 20 | bool IsSuccessful { get; set; } 21 | string Message { get; set; } 22 | 23 | //Events 24 | event EventHandler SearchEvent; 25 | event EventHandler AddNewEvent; 26 | event EventHandler EditEvent; 27 | event EventHandler DeleteEvent; 28 | event EventHandler SaveEvent; 29 | event EventHandler CancelEvent; 30 | 31 | //Methods 32 | void SetPetListBindingSource(BindingSource petList); 33 | void Show(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /CRUDWinFormsMVP/Views/PetView.Designer.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace CRUDWinFormsMVP.Views 3 | { 4 | partial class PetView 5 | { 6 | /// 7 | /// Required designer variable. 8 | /// 9 | private System.ComponentModel.IContainer components = null; 10 | 11 | /// 12 | /// Clean up any resources being used. 13 | /// 14 | /// true if managed resources should be disposed; otherwise, false. 15 | protected override void Dispose(bool disposing) 16 | { 17 | if (disposing && (components != null)) 18 | { 19 | components.Dispose(); 20 | } 21 | base.Dispose(disposing); 22 | } 23 | 24 | #region Windows Form Designer generated code 25 | 26 | /// 27 | /// Required method for Designer support - do not modify 28 | /// the contents of this method with the code editor. 29 | /// 30 | private void InitializeComponent() 31 | { 32 | this.label1 = new System.Windows.Forms.Label(); 33 | this.panel1 = new System.Windows.Forms.Panel(); 34 | this.tabControl1 = new System.Windows.Forms.TabControl(); 35 | this.tabPagePetList = new System.Windows.Forms.TabPage(); 36 | this.tabPagePetDetail = new System.Windows.Forms.TabPage(); 37 | this.txtSearch = new System.Windows.Forms.TextBox(); 38 | this.btnSearch = new System.Windows.Forms.Button(); 39 | this.btnAddNew = new System.Windows.Forms.Button(); 40 | this.btnEdit = new System.Windows.Forms.Button(); 41 | this.btnDelete = new System.Windows.Forms.Button(); 42 | this.label2 = new System.Windows.Forms.Label(); 43 | this.dataGridView = new System.Windows.Forms.DataGridView(); 44 | this.label3 = new System.Windows.Forms.Label(); 45 | this.txtPetId = new System.Windows.Forms.TextBox(); 46 | this.label4 = new System.Windows.Forms.Label(); 47 | this.txtPetName = new System.Windows.Forms.TextBox(); 48 | this.label5 = new System.Windows.Forms.Label(); 49 | this.txtPetType = new System.Windows.Forms.TextBox(); 50 | this.label6 = new System.Windows.Forms.Label(); 51 | this.txtPetColour = new System.Windows.Forms.TextBox(); 52 | this.btnCancel = new System.Windows.Forms.Button(); 53 | this.btnSave = new System.Windows.Forms.Button(); 54 | this.btnClose = new System.Windows.Forms.Button(); 55 | this.panel1.SuspendLayout(); 56 | this.tabControl1.SuspendLayout(); 57 | this.tabPagePetList.SuspendLayout(); 58 | this.tabPagePetDetail.SuspendLayout(); 59 | ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit(); 60 | this.SuspendLayout(); 61 | // 62 | // label1 63 | // 64 | this.label1.AutoSize = true; 65 | this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 66 | this.label1.Location = new System.Drawing.Point(53, 17); 67 | this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); 68 | this.label1.Name = "label1"; 69 | this.label1.Size = new System.Drawing.Size(65, 25); 70 | this.label1.TabIndex = 0; 71 | this.label1.Text = "PETS"; 72 | // 73 | // panel1 74 | // 75 | this.panel1.BackColor = System.Drawing.Color.White; 76 | this.panel1.Controls.Add(this.btnClose); 77 | this.panel1.Controls.Add(this.label1); 78 | this.panel1.Dock = System.Windows.Forms.DockStyle.Top; 79 | this.panel1.Location = new System.Drawing.Point(0, 0); 80 | this.panel1.Name = "panel1"; 81 | this.panel1.Size = new System.Drawing.Size(892, 56); 82 | this.panel1.TabIndex = 1; 83 | // 84 | // tabControl1 85 | // 86 | this.tabControl1.Controls.Add(this.tabPagePetList); 87 | this.tabControl1.Controls.Add(this.tabPagePetDetail); 88 | this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; 89 | this.tabControl1.Location = new System.Drawing.Point(0, 56); 90 | this.tabControl1.Name = "tabControl1"; 91 | this.tabControl1.SelectedIndex = 0; 92 | this.tabControl1.Size = new System.Drawing.Size(892, 411); 93 | this.tabControl1.TabIndex = 2; 94 | // 95 | // tabPagePetList 96 | // 97 | this.tabPagePetList.Controls.Add(this.dataGridView); 98 | this.tabPagePetList.Controls.Add(this.label2); 99 | this.tabPagePetList.Controls.Add(this.btnDelete); 100 | this.tabPagePetList.Controls.Add(this.btnEdit); 101 | this.tabPagePetList.Controls.Add(this.btnAddNew); 102 | this.tabPagePetList.Controls.Add(this.btnSearch); 103 | this.tabPagePetList.Controls.Add(this.txtSearch); 104 | this.tabPagePetList.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 105 | this.tabPagePetList.Location = new System.Drawing.Point(4, 29); 106 | this.tabPagePetList.Name = "tabPagePetList"; 107 | this.tabPagePetList.Padding = new System.Windows.Forms.Padding(3); 108 | this.tabPagePetList.Size = new System.Drawing.Size(884, 378); 109 | this.tabPagePetList.TabIndex = 0; 110 | this.tabPagePetList.Text = "Pet list"; 111 | this.tabPagePetList.UseVisualStyleBackColor = true; 112 | // 113 | // tabPagePetDetail 114 | // 115 | this.tabPagePetDetail.Controls.Add(this.btnCancel); 116 | this.tabPagePetDetail.Controls.Add(this.btnSave); 117 | this.tabPagePetDetail.Controls.Add(this.label6); 118 | this.tabPagePetDetail.Controls.Add(this.txtPetColour); 119 | this.tabPagePetDetail.Controls.Add(this.label5); 120 | this.tabPagePetDetail.Controls.Add(this.txtPetType); 121 | this.tabPagePetDetail.Controls.Add(this.label4); 122 | this.tabPagePetDetail.Controls.Add(this.txtPetName); 123 | this.tabPagePetDetail.Controls.Add(this.label3); 124 | this.tabPagePetDetail.Controls.Add(this.txtPetId); 125 | this.tabPagePetDetail.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 126 | this.tabPagePetDetail.Location = new System.Drawing.Point(4, 29); 127 | this.tabPagePetDetail.Name = "tabPagePetDetail"; 128 | this.tabPagePetDetail.Padding = new System.Windows.Forms.Padding(3); 129 | this.tabPagePetDetail.Size = new System.Drawing.Size(884, 378); 130 | this.tabPagePetDetail.TabIndex = 1; 131 | this.tabPagePetDetail.Text = "Pet detail"; 132 | this.tabPagePetDetail.UseVisualStyleBackColor = true; 133 | // 134 | // txtSearch 135 | // 136 | this.txtSearch.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 137 | | System.Windows.Forms.AnchorStyles.Right))); 138 | this.txtSearch.Location = new System.Drawing.Point(24, 31); 139 | this.txtSearch.Name = "txtSearch"; 140 | this.txtSearch.Size = new System.Drawing.Size(638, 26); 141 | this.txtSearch.TabIndex = 0; 142 | // 143 | // btnSearch 144 | // 145 | this.btnSearch.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 146 | this.btnSearch.Location = new System.Drawing.Point(668, 27); 147 | this.btnSearch.Name = "btnSearch"; 148 | this.btnSearch.Size = new System.Drawing.Size(99, 30); 149 | this.btnSearch.TabIndex = 1; 150 | this.btnSearch.Text = "Search"; 151 | this.btnSearch.UseVisualStyleBackColor = true; 152 | // 153 | // btnAddNew 154 | // 155 | this.btnAddNew.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 156 | this.btnAddNew.Location = new System.Drawing.Point(767, 62); 157 | this.btnAddNew.Name = "btnAddNew"; 158 | this.btnAddNew.Size = new System.Drawing.Size(99, 30); 159 | this.btnAddNew.TabIndex = 2; 160 | this.btnAddNew.Text = "Add new"; 161 | this.btnAddNew.UseVisualStyleBackColor = true; 162 | // 163 | // btnEdit 164 | // 165 | this.btnEdit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 166 | this.btnEdit.Location = new System.Drawing.Point(767, 98); 167 | this.btnEdit.Name = "btnEdit"; 168 | this.btnEdit.Size = new System.Drawing.Size(99, 30); 169 | this.btnEdit.TabIndex = 3; 170 | this.btnEdit.Text = "Edit"; 171 | this.btnEdit.UseVisualStyleBackColor = true; 172 | // 173 | // btnDelete 174 | // 175 | this.btnDelete.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 176 | this.btnDelete.Location = new System.Drawing.Point(767, 134); 177 | this.btnDelete.Name = "btnDelete"; 178 | this.btnDelete.Size = new System.Drawing.Size(99, 30); 179 | this.btnDelete.TabIndex = 4; 180 | this.btnDelete.Text = "Delete"; 181 | this.btnDelete.UseVisualStyleBackColor = true; 182 | // 183 | // label2 184 | // 185 | this.label2.AutoSize = true; 186 | this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 187 | this.label2.Location = new System.Drawing.Point(20, 8); 188 | this.label2.Name = "label2"; 189 | this.label2.Size = new System.Drawing.Size(91, 20); 190 | this.label2.TabIndex = 5; 191 | this.label2.Text = "Search pet:"; 192 | // 193 | // dataGridView 194 | // 195 | this.dataGridView.AllowUserToAddRows = false; 196 | this.dataGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 197 | | System.Windows.Forms.AnchorStyles.Left) 198 | | System.Windows.Forms.AnchorStyles.Right))); 199 | this.dataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; 200 | this.dataGridView.BackgroundColor = System.Drawing.Color.Gainsboro; 201 | this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; 202 | this.dataGridView.Location = new System.Drawing.Point(24, 63); 203 | this.dataGridView.Name = "dataGridView"; 204 | this.dataGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; 205 | this.dataGridView.Size = new System.Drawing.Size(737, 307); 206 | this.dataGridView.TabIndex = 7; 207 | // 208 | // label3 209 | // 210 | this.label3.AutoSize = true; 211 | this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 212 | this.label3.Location = new System.Drawing.Point(59, 31); 213 | this.label3.Name = "label3"; 214 | this.label3.Size = new System.Drawing.Size(58, 20); 215 | this.label3.TabIndex = 7; 216 | this.label3.Text = "Pet ID:"; 217 | // 218 | // txtPetId 219 | // 220 | this.txtPetId.Location = new System.Drawing.Point(63, 54); 221 | this.txtPetId.Name = "txtPetId"; 222 | this.txtPetId.Size = new System.Drawing.Size(154, 29); 223 | this.txtPetId.TabIndex = 6; 224 | // 225 | // label4 226 | // 227 | this.label4.AutoSize = true; 228 | this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 229 | this.label4.Location = new System.Drawing.Point(59, 102); 230 | this.label4.Name = "label4"; 231 | this.label4.Size = new System.Drawing.Size(81, 20); 232 | this.label4.TabIndex = 9; 233 | this.label4.Text = "Pet name:"; 234 | // 235 | // txtPetName 236 | // 237 | this.txtPetName.Location = new System.Drawing.Point(63, 125); 238 | this.txtPetName.Name = "txtPetName"; 239 | this.txtPetName.Size = new System.Drawing.Size(154, 29); 240 | this.txtPetName.TabIndex = 8; 241 | // 242 | // label5 243 | // 244 | this.label5.AutoSize = true; 245 | this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 246 | this.label5.Location = new System.Drawing.Point(256, 102); 247 | this.label5.Name = "label5"; 248 | this.label5.Size = new System.Drawing.Size(71, 20); 249 | this.label5.TabIndex = 11; 250 | this.label5.Text = "Pet type:"; 251 | // 252 | // txtPetType 253 | // 254 | this.txtPetType.Location = new System.Drawing.Point(260, 125); 255 | this.txtPetType.Name = "txtPetType"; 256 | this.txtPetType.Size = new System.Drawing.Size(183, 29); 257 | this.txtPetType.TabIndex = 10; 258 | // 259 | // label6 260 | // 261 | this.label6.AutoSize = true; 262 | this.label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 263 | this.label6.Location = new System.Drawing.Point(59, 175); 264 | this.label6.Name = "label6"; 265 | this.label6.Size = new System.Drawing.Size(84, 20); 266 | this.label6.TabIndex = 13; 267 | this.label6.Text = "Pet colour:"; 268 | // 269 | // txtPetColour 270 | // 271 | this.txtPetColour.Location = new System.Drawing.Point(63, 198); 272 | this.txtPetColour.Name = "txtPetColour"; 273 | this.txtPetColour.Size = new System.Drawing.Size(380, 29); 274 | this.txtPetColour.TabIndex = 12; 275 | // 276 | // btnCancel 277 | // 278 | this.btnCancel.Location = new System.Drawing.Point(260, 247); 279 | this.btnCancel.Name = "btnCancel"; 280 | this.btnCancel.Size = new System.Drawing.Size(183, 44); 281 | this.btnCancel.TabIndex = 15; 282 | this.btnCancel.Text = "Cancel"; 283 | this.btnCancel.UseVisualStyleBackColor = true; 284 | // 285 | // btnSave 286 | // 287 | this.btnSave.Location = new System.Drawing.Point(63, 247); 288 | this.btnSave.Name = "btnSave"; 289 | this.btnSave.Size = new System.Drawing.Size(183, 44); 290 | this.btnSave.TabIndex = 14; 291 | this.btnSave.Text = "Save"; 292 | this.btnSave.UseVisualStyleBackColor = true; 293 | // 294 | // btnClose 295 | // 296 | this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 297 | this.btnClose.Location = new System.Drawing.Point(851, 12); 298 | this.btnClose.Name = "btnClose"; 299 | this.btnClose.Size = new System.Drawing.Size(37, 30); 300 | this.btnClose.TabIndex = 8; 301 | this.btnClose.Text = "X"; 302 | this.btnClose.UseVisualStyleBackColor = true; 303 | // 304 | // PetView 305 | // 306 | this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); 307 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 308 | this.ClientSize = new System.Drawing.Size(892, 467); 309 | this.Controls.Add(this.tabControl1); 310 | this.Controls.Add(this.panel1); 311 | this.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 312 | this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); 313 | this.Name = "PetView"; 314 | this.Text = "PetView"; 315 | this.panel1.ResumeLayout(false); 316 | this.panel1.PerformLayout(); 317 | this.tabControl1.ResumeLayout(false); 318 | this.tabPagePetList.ResumeLayout(false); 319 | this.tabPagePetList.PerformLayout(); 320 | this.tabPagePetDetail.ResumeLayout(false); 321 | this.tabPagePetDetail.PerformLayout(); 322 | ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit(); 323 | this.ResumeLayout(false); 324 | 325 | } 326 | 327 | #endregion 328 | 329 | private System.Windows.Forms.Label label1; 330 | private System.Windows.Forms.Panel panel1; 331 | private System.Windows.Forms.TabControl tabControl1; 332 | private System.Windows.Forms.TabPage tabPagePetList; 333 | private System.Windows.Forms.Label label2; 334 | private System.Windows.Forms.Button btnDelete; 335 | private System.Windows.Forms.Button btnEdit; 336 | private System.Windows.Forms.Button btnAddNew; 337 | private System.Windows.Forms.Button btnSearch; 338 | private System.Windows.Forms.TextBox txtSearch; 339 | private System.Windows.Forms.TabPage tabPagePetDetail; 340 | private System.Windows.Forms.DataGridView dataGridView; 341 | private System.Windows.Forms.Button btnCancel; 342 | private System.Windows.Forms.Button btnSave; 343 | private System.Windows.Forms.Label label6; 344 | private System.Windows.Forms.TextBox txtPetColour; 345 | private System.Windows.Forms.Label label5; 346 | private System.Windows.Forms.TextBox txtPetType; 347 | private System.Windows.Forms.Label label4; 348 | private System.Windows.Forms.TextBox txtPetName; 349 | private System.Windows.Forms.Label label3; 350 | private System.Windows.Forms.TextBox txtPetId; 351 | private System.Windows.Forms.Button btnClose; 352 | } 353 | } -------------------------------------------------------------------------------- /CRUDWinFormsMVP/Views/PetView.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | 11 | namespace CRUDWinFormsMVP.Views 12 | { 13 | public partial class PetView : Form, IPetView 14 | { 15 | //Fields 16 | private string message; 17 | private bool isSuccessful; 18 | private bool isEdit; 19 | 20 | //Constructor 21 | public PetView() 22 | { 23 | InitializeComponent(); 24 | AssociateAndRaiseViewEvents(); 25 | tabControl1.TabPages.Remove(tabPagePetDetail); 26 | btnClose.Click += delegate { this.Close(); }; 27 | } 28 | 29 | private void AssociateAndRaiseViewEvents() 30 | { 31 | btnSearch.Click += delegate { SearchEvent?.Invoke(this, EventArgs.Empty); }; 32 | txtSearch.KeyDown += (s, e) => 33 | { 34 | if (e.KeyCode == Keys.Enter) 35 | SearchEvent?.Invoke(this, EventArgs.Empty); 36 | }; 37 | //Others 38 | } 39 | 40 | //Properties 41 | public string PetId 42 | { 43 | get { return txtPetId.Text; } 44 | set { txtPetId.Text = value; } 45 | } 46 | 47 | public string PetName 48 | { 49 | get { return txtPetName.Text; } 50 | set { txtPetName.Text = value; } 51 | } 52 | 53 | public string PetType 54 | { 55 | get { return txtPetType.Text; } 56 | set { txtPetType.Text = value; } 57 | } 58 | 59 | public string PetColour 60 | { 61 | get { return txtPetColour.Text; } 62 | set { txtPetColour.Text = value; } 63 | } 64 | 65 | public string SearchValue 66 | { 67 | get { return txtSearch.Text; } 68 | set { txtSearch.Text = value; } 69 | } 70 | 71 | public bool IsEdit 72 | { 73 | get { return isEdit; } 74 | set { isEdit = value; } 75 | } 76 | 77 | public bool IsSuccessful 78 | { 79 | get { return isSuccessful; } 80 | set { isSuccessful = value; } 81 | } 82 | 83 | public string Message 84 | { 85 | get { return message; } 86 | set { message = value; } 87 | } 88 | 89 | //Events 90 | public event EventHandler SearchEvent; 91 | public event EventHandler AddNewEvent; 92 | public event EventHandler EditEvent; 93 | public event EventHandler DeleteEvent; 94 | public event EventHandler SaveEvent; 95 | public event EventHandler CancelEvent; 96 | 97 | //Methods 98 | public void SetPetListBindingSource(BindingSource petList) 99 | { 100 | dataGridView.DataSource = petList; 101 | } 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /CRUDWinFormsMVP/Views/PetView.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /CRUDWinFormsMVP/bin/Debug/CRUDWinFormsMVP.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RJCodeAdvance/CRUD-MVP-C-SHARP-SQL-WINFORMS-PART-1/6fb547028a8710c773954b83f36facba529425be/CRUDWinFormsMVP/bin/Debug/CRUDWinFormsMVP.exe -------------------------------------------------------------------------------- /CRUDWinFormsMVP/bin/Debug/CRUDWinFormsMVP.exe.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /CRUDWinFormsMVP/bin/Debug/CRUDWinFormsMVP.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RJCodeAdvance/CRUD-MVP-C-SHARP-SQL-WINFORMS-PART-1/6fb547028a8710c773954b83f36facba529425be/CRUDWinFormsMVP/bin/Debug/CRUDWinFormsMVP.pdb -------------------------------------------------------------------------------- /CRUDWinFormsMVP/obj/Debug/CRUDWinFormsMVP.Properties.Resources.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RJCodeAdvance/CRUD-MVP-C-SHARP-SQL-WINFORMS-PART-1/6fb547028a8710c773954b83f36facba529425be/CRUDWinFormsMVP/obj/Debug/CRUDWinFormsMVP.Properties.Resources.resources -------------------------------------------------------------------------------- /CRUDWinFormsMVP/obj/Debug/CRUDWinFormsMVP.Views.MainView.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RJCodeAdvance/CRUD-MVP-C-SHARP-SQL-WINFORMS-PART-1/6fb547028a8710c773954b83f36facba529425be/CRUDWinFormsMVP/obj/Debug/CRUDWinFormsMVP.Views.MainView.resources -------------------------------------------------------------------------------- /CRUDWinFormsMVP/obj/Debug/CRUDWinFormsMVP.Views.PetView.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RJCodeAdvance/CRUD-MVP-C-SHARP-SQL-WINFORMS-PART-1/6fb547028a8710c773954b83f36facba529425be/CRUDWinFormsMVP/obj/Debug/CRUDWinFormsMVP.Views.PetView.resources -------------------------------------------------------------------------------- /CRUDWinFormsMVP/obj/Debug/CRUDWinFormsMVP.csproj.AssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RJCodeAdvance/CRUD-MVP-C-SHARP-SQL-WINFORMS-PART-1/6fb547028a8710c773954b83f36facba529425be/CRUDWinFormsMVP/obj/Debug/CRUDWinFormsMVP.csproj.AssemblyReference.cache -------------------------------------------------------------------------------- /CRUDWinFormsMVP/obj/Debug/CRUDWinFormsMVP.csproj.CoreCompileInputs.cache: -------------------------------------------------------------------------------- 1 | 8c8b3a443dae8c7d0daf8be0168a1648643050b5 2 | -------------------------------------------------------------------------------- /CRUDWinFormsMVP/obj/Debug/CRUDWinFormsMVP.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | D:\RJ Code Advance\Source Code C#\2022\CRUDWinFormsMVP\CRUDWinFormsMVP\obj\Debug\CRUDWinFormsMVP.csproj.AssemblyReference.cache 2 | D:\RJ Code Advance\Source Code C#\2022\CRUDWinFormsMVP\CRUDWinFormsMVP\obj\Debug\CRUDWinFormsMVP.Properties.Resources.resources 3 | D:\RJ Code Advance\Source Code C#\2022\CRUDWinFormsMVP\CRUDWinFormsMVP\obj\Debug\CRUDWinFormsMVP.csproj.GenerateResource.cache 4 | D:\RJ Code Advance\Source Code C#\2022\CRUDWinFormsMVP\CRUDWinFormsMVP\obj\Debug\CRUDWinFormsMVP.csproj.CoreCompileInputs.cache 5 | D:\RJ Code Advance\Source Code C#\2022\CRUDWinFormsMVP\CRUDWinFormsMVP\bin\Debug\CRUDWinFormsMVP.exe.config 6 | D:\RJ Code Advance\Source Code C#\2022\CRUDWinFormsMVP\CRUDWinFormsMVP\bin\Debug\CRUDWinFormsMVP.exe 7 | D:\RJ Code Advance\Source Code C#\2022\CRUDWinFormsMVP\CRUDWinFormsMVP\bin\Debug\CRUDWinFormsMVP.pdb 8 | D:\RJ Code Advance\Source Code C#\2022\CRUDWinFormsMVP\CRUDWinFormsMVP\obj\Debug\CRUDWinFormsMVP.Views.PetView.resources 9 | D:\RJ Code Advance\Source Code C#\2022\CRUDWinFormsMVP\CRUDWinFormsMVP\obj\Debug\CRUDWinFormsMVP.exe 10 | D:\RJ Code Advance\Source Code C#\2022\CRUDWinFormsMVP\CRUDWinFormsMVP\obj\Debug\CRUDWinFormsMVP.pdb 11 | D:\RJ Code Advance\Source Code C#\2022\CRUDWinFormsMVP\CRUDWinFormsMVP\obj\Debug\CRUDWinFormsMVP.Views.MainView.resources 12 | D:\RJ Code Advance\Source Code C#\2022\CRUDWinFormsMVP - Parte 1\CRUDWinFormsMVP\bin\Debug\CRUDWinFormsMVP.exe.config 13 | D:\RJ Code Advance\Source Code C#\2022\CRUDWinFormsMVP - Parte 1\CRUDWinFormsMVP\bin\Debug\CRUDWinFormsMVP.exe 14 | D:\RJ Code Advance\Source Code C#\2022\CRUDWinFormsMVP - Parte 1\CRUDWinFormsMVP\bin\Debug\CRUDWinFormsMVP.pdb 15 | D:\RJ Code Advance\Source Code C#\2022\CRUDWinFormsMVP - Parte 1\CRUDWinFormsMVP\obj\Debug\CRUDWinFormsMVP.csproj.AssemblyReference.cache 16 | D:\RJ Code Advance\Source Code C#\2022\CRUDWinFormsMVP - Parte 1\CRUDWinFormsMVP\obj\Debug\CRUDWinFormsMVP.Properties.Resources.resources 17 | D:\RJ Code Advance\Source Code C#\2022\CRUDWinFormsMVP - Parte 1\CRUDWinFormsMVP\obj\Debug\CRUDWinFormsMVP.Views.PetView.resources 18 | D:\RJ Code Advance\Source Code C#\2022\CRUDWinFormsMVP - Parte 1\CRUDWinFormsMVP\obj\Debug\CRUDWinFormsMVP.csproj.GenerateResource.cache 19 | D:\RJ Code Advance\Source Code C#\2022\CRUDWinFormsMVP - Parte 1\CRUDWinFormsMVP\obj\Debug\CRUDWinFormsMVP.csproj.CoreCompileInputs.cache 20 | D:\RJ Code Advance\Source Code C#\2022\CRUDWinFormsMVP - Parte 1\CRUDWinFormsMVP\obj\Debug\CRUDWinFormsMVP.exe 21 | D:\RJ Code Advance\Source Code C#\2022\CRUDWinFormsMVP - Parte 1\CRUDWinFormsMVP\obj\Debug\CRUDWinFormsMVP.pdb 22 | -------------------------------------------------------------------------------- /CRUDWinFormsMVP/obj/Debug/CRUDWinFormsMVP.csproj.GenerateResource.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RJCodeAdvance/CRUD-MVP-C-SHARP-SQL-WINFORMS-PART-1/6fb547028a8710c773954b83f36facba529425be/CRUDWinFormsMVP/obj/Debug/CRUDWinFormsMVP.csproj.GenerateResource.cache -------------------------------------------------------------------------------- /CRUDWinFormsMVP/obj/Debug/CRUDWinFormsMVP.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RJCodeAdvance/CRUD-MVP-C-SHARP-SQL-WINFORMS-PART-1/6fb547028a8710c773954b83f36facba529425be/CRUDWinFormsMVP/obj/Debug/CRUDWinFormsMVP.exe -------------------------------------------------------------------------------- /CRUDWinFormsMVP/obj/Debug/CRUDWinFormsMVP.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RJCodeAdvance/CRUD-MVP-C-SHARP-SQL-WINFORMS-PART-1/6fb547028a8710c773954b83f36facba529425be/CRUDWinFormsMVP/obj/Debug/CRUDWinFormsMVP.pdb -------------------------------------------------------------------------------- /CRUDWinFormsMVP/obj/Debug/DesignTimeResolveAssemblyReferences.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RJCodeAdvance/CRUD-MVP-C-SHARP-SQL-WINFORMS-PART-1/6fb547028a8710c773954b83f36facba529425be/CRUDWinFormsMVP/obj/Debug/DesignTimeResolveAssemblyReferences.cache -------------------------------------------------------------------------------- /CRUDWinFormsMVP/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RJCodeAdvance/CRUD-MVP-C-SHARP-SQL-WINFORMS-PART-1/6fb547028a8710c773954b83f36facba529425be/CRUDWinFormsMVP/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CRUD MVP C-SHARP, SQL AND WINFORMS (PART 1) 2 | CRUD using the MVP pattern, C-Sharp, Windows Forms and SQL Server 3 | -------------------------------------------------------------------------------- /VeterinaryDb.sql: -------------------------------------------------------------------------------- 1 | create database VeterinaryDb 2 | go 3 | use VeterinaryDb 4 | go 5 | create table Pet 6 | ( 7 | Pet_Id int identity (100000,1) primary key, 8 | Pet_Name nvarchar (50) not null, 9 | Pet_Type nvarchar (50) not null, 10 | Pet_Colour nvarchar (50) not null, 11 | ) 12 | go 13 | insert into Pet values('Buttons', 'Dog', 'White') 14 | insert into Pet values('Coda', 'Cat', 'Multicolor') 15 | insert into Pet values('Merlin', 'Parrot', 'Green-Yellow') 16 | insert into Pet values('Nina', 'Turtle', 'Dark Gray') 17 | insert into Pet values('Domino', 'Rabbit', 'White') 18 | insert into Pet values('Luna', 'Hamster', 'Orange') 19 | insert into Pet values('Lucy', 'Monkey', 'Brown') 20 | insert into Pet values('Daysi', 'Horse', 'White') 21 | insert into Pet values('Zoe', 'Snake', 'Yellow white') 22 | insert into Pet values('Max', 'Budgie', 'Yellow') 23 | insert into Pet values('Charlie', 'Mouse', 'White') 24 | insert into Pet values('Rocky', 'Squirrel', 'Brown-Orange') 25 | insert into Pet values('Leo', 'Dog', 'White-Black') 26 | insert into Pet values('Loki', 'Cat', 'Black') 27 | insert into Pet values('Jasper', 'Dog', 'Silver') 28 | go 29 | select *from Pet --------------------------------------------------------------------------------