Deutsch

Болтавня о трудности работы 09.02.2025

Вчера, 09:32
Re: Болтавня о трудности работы 09.02.2025
 
uscheswoi_82 патриот
в ответ uscheswoi_82 Вчера, 09:10

Диаграмма ClassDiagram1.cd:

<?xml version="1.0" encoding="utf-8"?>
<ClassDiagram MajorVersion="1" MinorVersion="1">
  <Class Name="HospitalSW.frmNeuPatient">
    <Position X="4.5" Y="0.5" Width="3.25" />
    <TypeIdentifier>
      <HashCode>ESGAAgBCgCADgAAQBgCiAAAGAIIgEBBBEAIAAAAIQAA=</HashCode>
      <FileName>frmNeuPatient.cs</FileName>
    </TypeIdentifier>
  </Class>
  <Class Name="HospitalSW.Form1">
    <Position X="0.5" Y="0.5" Width="3.75" />
    <TypeIdentifier>
      <HashCode>AQEAAAAAACAAAAAAAICAAAACAAAAAAAAAAAAAIAAAAA=</HashCode>
      <FileName>Form1.cs</FileName>
    </TypeIdentifier>
  </Class>
  <Class Name="HospitalSW.frmCalendar">
    <Position X="8" Y="0.5" Width="2.5" />
    <TypeIdentifier>
      <HashCode>AAAQAAAAACAAABQAAACAAKACAAAgAEAAAAIAAAAAAAA=</HashCode>
      <FileName>frmCalendar.cs</FileName>
    </TypeIdentifier>
  </Class>
  <Font Name="Tahoma" Size="10" />
</ClassDiagram>



Код Program.cs:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

namespace HospitalSW
{
  static class Program
  {
    /// <summary>
    /// Der Haupteinstiegspunkt für die Anwendung.
    /// </summary>
    [STAThread]
    static void Main()
    {
      Application.EnableVisualStyles();
      Application.SetCompatibleTextRenderingDefault(false);
      Application.Run(new Form1());
    }
  }
}


Код Form1.Designer.cs:

namespace HospitalSW
{
  partial class Form1
  {
  /// <summary>
  /// Erforderliche Designervariable.
  /// </summary>
  private System.ComponentModel.IContainer components = null;
    /// <summary>
    /// Verwendete Ressourcen bereinigen.
    /// </summary>
    /// <param name="disposing">True, wenn verwaltete 
    /// Ressourcen gelöscht werden sollen; andernfalls False.
    /// </param>
    protected override void Dispose(bool disposing)
    {
      if (disposing && (components != null))
      {
         components.Dispose();
      }
      base.Dispose(disposing);
    }

    #region Vom Windows Form-Designer generierter Code
    /// <summary>
    /// Erforderliche Methode für die Designerunterstützung.
    /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
    /// </summary>
    private void InitializeComponent()
    {
      this.menuStrip1 = new System.Windows.Forms.MenuStrip();
      this.patientenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
      this.neuPatientHinzufuegenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
      this.menuStrip1.SuspendLayout();
      this.SuspendLayout();
      // 
      // menuStrip1
      // 
      this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
      this.patientenToolStripMenuItem});
      this.menuStrip1.Location = new System.Drawing.Point(0, 0);
      this.menuStrip1.Name = "menuStrip1";
      this.menuStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
      this.menuStrip1.Size = new System.Drawing.Size(707, 27);
      this.menuStrip1.TabIndex = 1;
      this.menuStrip1.Text = "menuStrip1";
      // 
      // patientenToolStripMenuItem
      // 
      this.patientenToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
      this.neuPatientHinzufuegenToolStripMenuItem});
      this.patientenToolStripMenuItem.Name = "patientenToolStripMenuItem";
      this.patientenToolStripMenuItem.Size = new System.Drawing.Size(94, 23);
      this.patientenToolStripMenuItem.Text = "Пациенты";
      // 
      // neuPatientHinzufuegenToolStripMenuItem
      // 
      this.neuPatientHinzufuegenToolStripMenuItem.Name = "neuPatientHinzufuegenToolStripMenuItem";
      this.neuPatientHinzufuegenToolStripMenuItem.Size = new System.Drawing.Size(293, 24);
      this.neuPatientHinzufuegenToolStripMenuItem.Text = "Добавить нового пациента";
      this.neuPatientHinzufuegenToolStripMenuItem.Click += new System.EventHandler(this.neuPatientHinzufuegenToolStripMenuItem_Click);
      // 
      // Form1
      // 
      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
      this.ClientSize = new System.Drawing.Size(707, 464);
      this.Controls.Add(this.menuStrip1);
      this.IsMdiContainer = true;
      this.MainMenuStrip = this.menuStrip1;
      this.Name = "Form1";
      this.Text = "Больничка 2024";
      this.menuStrip1.ResumeLayout(false);
      this.menuStrip1.PerformLayout();
      this.ResumeLayout(false);
      this.PerformLayout();
    }
    #endregion

    private System.Windows.Forms.MenuStrip menuStrip1;
    private System.Windows.Forms.ToolStripMenuItem patientenToolStripMenuItem;
    private System.Windows.Forms.ToolStripMenuItem neuPatientHinzufuegenToolStripMenuItem;
    }
}



Код Form1.cs:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace HospitalSW
{
  public partial class Form1 : Form
  {
    public Form1()
    {
      InitializeComponent();
    }

    private void neuPatientHinzufuegenToolStripMenuItem_Click(object sender, EventArgs e)
    {
      frmNeuPatient frmNP = new frmNeuPatient();
      frmNP.MdiParent = this;
      frmNP.Show();
    }
  }
}



Код frmStadtSuchen.Designer.cs:

namespace HospitalSW
{
  partial class frmStadtSuchen
  {
    /// <summary>
    /// Required designer variable.
    /// </summary>
    private System.ComponentModel.IContainer components = null;
    /// <summary>
    /// Clean up any resources being used.
    /// </summary>
    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
    protected override void Dispose(bool disposing)
    {
       if (disposing && (components != null))
       {
          components.Dispose();
       }

       base.Dispose(disposing);
    }

    #region Windows Form Designer generated code
    /// <summary>
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// </summary>
    private void InitializeComponent()
    {
      this.label1 = new System.Windows.Forms.Label();
      this.textBox1 = new System.Windows.Forms.TextBox();
      this.label2 = new System.Windows.Forms.Label();
      this.textBox2 = new System.Windows.Forms.TextBox();
      this.button1 = new System.Windows.Forms.Button();
      this.dataGridView1 = new System.Windows.Forms.DataGridView();
      this.label3 = new System.Windows.Forms.Label();
      this.label4 = new System.Windows.Forms.Label();
      ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
      this.SuspendLayout();
      // 
      // label1
      // 
      this.label1.AutoSize = true;
      this.label1.Location = new System.Drawing.Point(13, 42);
      this.label1.Name = "label1";
      this.label1.Size = new System.Drawing.Size(37, 13);
      this.label1.TabIndex = 1;
      this.label1.Text = "Город";
      // 
      // textBox1
      // 
      this.textBox1.Location = new System.Drawing.Point(56, 39);
      this.textBox1.Name = "textBox1";
      this.textBox1.Size = new System.Drawing.Size(180, 20);
      this.textBox1.TabIndex = 2;
      // 
      // label2
      // 
      this.label2.AutoSize = true;
      this.label2.Location = new System.Drawing.Point(254, 42);
      this.label2.Name = "label2";
      this.label2.Size = new System.Drawing.Size(81, 13);
      this.label2.TabIndex = 3;
      this.label2.Text = "Почтовый код:";
      // 
      // textBox2
      // 
      this.textBox2.Location = new System.Drawing.Point(341, 39);
      this.textBox2.Name = "textBox2";
      this.textBox2.Size = new System.Drawing.Size(100, 20);
      this.textBox2.TabIndex = 4;
      // 
      // button1
      // 
      this.button1.Location = new System.Drawing.Point(447, 39);
      this.button1.Name = "button1";
      this.button1.Size = new System.Drawing.Size(76, 20);
      this.button1.TabIndex = 5;
      this.button1.Text = "Искать";
      this.button1.UseVisualStyleBackColor = true;
      // 
      // dataGridView1
      // 
      this.dataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | 
      System.Windows.Forms.AnchorStyles.Bottom)
      | System.Windows.Forms.AnchorStyles.Left)
      | System.Windows.Forms.AnchorStyles.Right)));
      this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
      this.dataGridView1.Location = new System.Drawing.Point(16, 105);
      this.dataGridView1.Name = "dataGridView1";
      this.dataGridView1.Size = new System.Drawing.Size(507, 309);
      this.dataGridView1.TabIndex = 7;
      // 
      // label3
      // 
      this.label3.AutoSize = true;
      this.label3.Location = new System.Drawing.Point(16, 13);
      this.label3.Name = "label3";
      this.label3.Size = new System.Drawing.Size(246, 13);
      this.label3.TabIndex = 0;
      this.label3.Text = "1. Введите названия города или почтовый код:";
      // 
      // label4
      // 
      this.label4.AutoSize = true;
      this.label4.Location = new System.Drawing.Point(19, 86);
      this.label4.Name = "label4";
      this.label4.Size = new System.Drawing.Size(418, 13);
      this.label4.TabIndex = 6;
      this.label4.Text = "2. Выберете двойном щелчком нужный город, форма автоматически закроется:";
      // 
      // frmStadtSuchen
      // 
      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
      this.ClientSize = new System.Drawing.Size(539, 426);
      this.Controls.Add(this.label4);
      this.Controls.Add(this.label3);
      this.Controls.Add(this.dataGridView1);
      this.Controls.Add(this.button1);
      this.Controls.Add(this.textBox2);
      this.Controls.Add(this.label2);
      this.Controls.Add(this.textBox1);
      this.Controls.Add(this.label1);
      this.Name = "frmStadtSuchen";
      this.Text = "Поиск города и почтового кода";
      this.Load += new System.EventHandler(this.frmStadtSuchen_Load);
      ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
      this.ResumeLayout(false);
      this.PerformLayout();
    }

    #endregion
    private System.Windows.Forms.Label label1;
    private System.Windows.Forms.TextBox textBox1;
    private System.Windows.Forms.Label label2;
    private System.Windows.Forms.TextBox textBox2;
    private System.Windows.Forms.Button button1;
    private System.Windows.Forms.DataGridView dataGridView1;
    private System.Windows.Forms.Label label3;
    private System.Windows.Forms.Label label4;
  }
}


Код frmStadtSuchen.cs:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace HospitalSW
{
  public partial class frmStadtSuchen : Form
  {
    private TextBox txtStadt;
    private TextBox txtPLZ;

    public frmStadtSuchen()
    {
      InitializeComponent();
    }

    public frmStadtSuchen(TextBox txtStadt, TextBox txtPLZ)
    {
      InitializeComponent();
      this.txtStadt = txtStadt;
      this.txtPLZ = txtPLZ;
    }

    private void frmStadtSuchen_Load(object sender, EventArgs e)
    { }
  }
}



Код frmCalendar.Designer.cs:

namespace HospitalSW
{
  partial class frmCalendar
  {
    /// <summary>
    /// Required designer variable.
    /// </summary>

    private System.ComponentModel.IContainer components = null;
    /// <summary>
    /// Clean up any resources being used.
    /// </summary>
    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
    protected override void Dispose(bool disposing)
    {
      if (disposing && (components != null))
      {
        components.Dispose();
      }
      base.Dispose(disposing);
    }

    #region Windows Form Designer generated code
    /// <summary>
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// </summary>
    private void InitializeComponent()
    {
      this.label1 = new System.Windows.Forms.Label();
      this.calendBirthday = new System.Windows.Forms.MonthCalendar();
      this.label2 = new System.Windows.Forms.Label();
      this.btnOK = new System.Windows.Forms.Button();
      this.btnAbbrechen = new System.Windows.Forms.Button();
      this.SuspendLayout();
      // 
      // label1
      // 
      this.label1.AutoSize = true;
      this.label1.Location = new System.Drawing.Point(12, 9);
      this.label1.Name = "label1";
      this.label1.Size = new System.Drawing.Size(224, 13);
      this.label1.TabIndex = 0;
      this.label1.Text = "1. Выберете день рождения из календаря:";
      // 
      // calendBirthday
      // 
      this.calendBirthday.Location = new System.Drawing.Point(18, 31);
      this.calendBirthday.Name = "calendBirthday";
      this.calendBirthday.TabIndex = 1;
      // 
      // label2
      // 
     this.label2.Location = new System.Drawing.Point(12, 204);
     this.label2.Name = "label2";
     this.label2.Size = new System.Drawing.Size(224, 44);
     this.label2.TabIndex = 2;
     this.label2.Text = "2. Нажмите либо кнопку \"ОК\" (если вы хотите выбрать, или" +
     \"Отменить\", если вам не нужно выберать.";
     // 
     // btnOK
     // 
     this.btnOK.Location = new System.Drawing.Point(18, 261);
     this.btnOK.Name = "btnOK";
     this.btnOK.Size = new System.Drawing.Size(75, 23);
     this.btnOK.TabIndex = 3;
     this.btnOK.Text = "OK";
     this.btnOK.UseVisualStyleBackColor = true;
     this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
     // 
     // btnAbbrechen
     // 
     this.btnAbbrechen.Location = new System.Drawing.Point(113, 261);
     this.btnAbbrechen.Name = "btnAbbrechen";
     this.btnAbbrechen.Size = new System.Drawing.Size(75, 23);
     this.btnAbbrechen.TabIndex = 4;
     this.btnAbbrechen.Text = "Отменить";
     this.btnAbbrechen.UseVisualStyleBackColor = true;
     this.btnAbbrechen.Click += new System.EventHandler(this.btnAbbrechen_Click);
     // 
     // frmCalendar
     // 
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     this.ClientSize = new System.Drawing.Size(251, 294);
     this.Controls.Add(this.btnAbbrechen);
     this.Controls.Add(this.btnOK);
     this.Controls.Add(this.label2);
     this.Controls.Add(this.calendBirthday);
     this.Controls.Add(this.label1);
     this.Name = "frmCalendar";
     this.Text = "Календарь";
     this.Load += new System.EventHandler(this.frmCalendar_Load);
     this.ResumeLayout(false);
     this.PerformLayout();
    }
    #endregion

    private System.Windows.Forms.Label label1;
    private System.Windows.Forms.MonthCalendar calendBirthday;
    private System.Windows.Forms.Label label2;
    private System.Windows.Forms.Button btnOK;
    private System.Windows.Forms.Button btnAbbrechen;
  }
}



Код frmCalendar.cs:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace HospitalSW
{
  public partial class frmCalendar : Form
  {
    private MaskedTextBox mtxtbBirthdayField;
    public frmCalendar()
    {
      InitializeComponent();
    }

    public frmCalendar(MaskedTextBox mtxtbBirthdayField)
    {
      InitializeComponent();
      this.mtxtbBirthdayField = mtxtbBirthdayField;
    }

    private void frmCalendar_Load(object sender, EventArgs e)
    {}

    private void btnOK_Click(object sender, EventArgs e)
    {
       this.mtxtbBirthdayField.Text = this.calendBirthday.SelectionRange.Start.ToShortDateString();
       this.Close();
    }

    private void btnAbbrechen_Click(object sender, EventArgs e)
    {
       this.Close();
    }
  }
}
Если я кому-то отвечаю, это не значит что я ему симпатизирую, каждый остаётся при своём мнение
 

Перейти на