Browse Source

界面优化

Lishi
pry 2 years ago
parent
commit
e563fc1aeb
14 changed files with 461 additions and 275 deletions
  1. +57
    -179
      HKCardManager/Form1.Designer.cs
  2. +83
    -68
      HKCardManager/Form1.cs
  3. +0
    -3
      HKCardManager/Form1.resx
  4. +1
    -0
      HKCardManager/HKCardManager.csproj
  5. +21
    -0
      HKCardManager/Models/Global.cs
  6. +4
    -4
      HKCardManager/Servers/MessageLogNotify.cs
  7. +64
    -0
      HKCardManager/UserPages/AdvertisingSetPage.Designer.cs
  8. +20
    -0
      HKCardManager/UserPages/AdvertisingSetPage.cs
  9. +60
    -0
      HKCardManager/UserPages/AdvertisingSetPage.resx
  10. +13
    -0
      HKCardManager/UserPages/CarMangerPage.Designer.cs
  11. +112
    -5
      HKCardManager/UserPages/CarMangerPage.cs
  12. +3
    -0
      HKCardManager/UserPages/InstitutionalEntryPage.cs
  13. +17
    -15
      HKCardManager/UserPages/PersonnelEntryPage.cs
  14. +6
    -1
      HKLib/Interfaces/HKLibHelper.cs

+ 57
- 179
HKCardManager/Form1.Designer.cs View File

@@ -28,22 +28,10 @@
/// </summary>
private void InitializeComponent()
{
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.人事信息ZToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.人员录入ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.机构录入ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.卡片维护ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.发卡ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.销户ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.挂失ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.解挂ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.报表打印ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.月餐段汇总表ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.计次就餐天消费表ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.计次就餐消费明细表ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.记次就餐ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.餐段设置ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.groupBox5 = new System.Windows.Forms.GroupBox();
this.pictureBox11 = new System.Windows.Forms.PictureBox();
this.button8 = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.pictureBox2 = new System.Windows.Forms.PictureBox();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
@@ -72,12 +60,12 @@
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.panel1 = new System.Windows.Forms.Panel();
this.listBox1 = new System.Windows.Forms.ListBox();
this.label1 = new System.Windows.Forms.Label();
this.menuStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.groupBox5.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox11)).BeginInit();
this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
@@ -98,135 +86,15 @@
this.splitContainer2.SuspendLayout();
this.SuspendLayout();
//
// menuStrip1
//
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.人事信息ZToolStripMenuItem,
this.卡片维护ToolStripMenuItem,
this.报表打印ToolStripMenuItem,
this.记次就餐ToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(1207, 25);
this.menuStrip1.TabIndex = 0;
this.menuStrip1.Text = "menuStrip1";
//
// 人事信息ZToolStripMenuItem
//
this.人事信息ZToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.人员录入ToolStripMenuItem,
this.机构录入ToolStripMenuItem});
this.人事信息ZToolStripMenuItem.Name = "人事信息ZToolStripMenuItem";
this.人事信息ZToolStripMenuItem.Size = new System.Drawing.Size(83, 21);
this.人事信息ZToolStripMenuItem.Text = "人事信息(Z)";
//
// 人员录入ToolStripMenuItem
//
this.人员录入ToolStripMenuItem.Name = "人员录入ToolStripMenuItem";
this.人员录入ToolStripMenuItem.Size = new System.Drawing.Size(124, 22);
this.人员录入ToolStripMenuItem.Text = "人员录入";
this.人员录入ToolStripMenuItem.Click += new System.EventHandler(this.人员录入ToolStripMenuItem_Click);
//
// 机构录入ToolStripMenuItem
//
this.机构录入ToolStripMenuItem.Name = "机构录入ToolStripMenuItem";
this.机构录入ToolStripMenuItem.Size = new System.Drawing.Size(124, 22);
this.机构录入ToolStripMenuItem.Text = "机构录入";
this.机构录入ToolStripMenuItem.Click += new System.EventHandler(this.机构录入ToolStripMenuItem_Click);
//
// 卡片维护ToolStripMenuItem
//
this.卡片维护ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.发卡ToolStripMenuItem,
this.销户ToolStripMenuItem,
this.挂失ToolStripMenuItem,
this.解挂ToolStripMenuItem});
this.卡片维护ToolStripMenuItem.Name = "卡片维护ToolStripMenuItem";
this.卡片维护ToolStripMenuItem.Size = new System.Drawing.Size(84, 21);
this.卡片维护ToolStripMenuItem.Text = "卡片维护(X)";
//
// 发卡ToolStripMenuItem
//
this.发卡ToolStripMenuItem.Name = "发卡ToolStripMenuItem";
this.发卡ToolStripMenuItem.Size = new System.Drawing.Size(100, 22);
this.发卡ToolStripMenuItem.Text = "发卡";
this.发卡ToolStripMenuItem.Click += new System.EventHandler(this.发卡ToolStripMenuItem_Click);
//
// 销户ToolStripMenuItem
//
this.销户ToolStripMenuItem.Name = "销户ToolStripMenuItem";
this.销户ToolStripMenuItem.Size = new System.Drawing.Size(100, 22);
this.销户ToolStripMenuItem.Text = "销户";
this.销户ToolStripMenuItem.Click += new System.EventHandler(this.销户ToolStripMenuItem_Click);
//
// 挂失ToolStripMenuItem
//
this.挂失ToolStripMenuItem.Name = "挂失ToolStripMenuItem";
this.挂失ToolStripMenuItem.Size = new System.Drawing.Size(100, 22);
this.挂失ToolStripMenuItem.Text = "挂失";
this.挂失ToolStripMenuItem.Click += new System.EventHandler(this.挂失ToolStripMenuItem_Click);
//
// 解挂ToolStripMenuItem
//
this.解挂ToolStripMenuItem.Name = "解挂ToolStripMenuItem";
this.解挂ToolStripMenuItem.Size = new System.Drawing.Size(100, 22);
this.解挂ToolStripMenuItem.Text = "解挂";
this.解挂ToolStripMenuItem.Click += new System.EventHandler(this.解挂ToolStripMenuItem_Click);
//
// 报表打印ToolStripMenuItem
//
this.报表打印ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.月餐段汇总表ToolStripMenuItem,
this.计次就餐天消费表ToolStripMenuItem,
this.计次就餐消费明细表ToolStripMenuItem});
this.报表打印ToolStripMenuItem.Name = "报表打印ToolStripMenuItem";
this.报表打印ToolStripMenuItem.Size = new System.Drawing.Size(68, 21);
this.报表打印ToolStripMenuItem.Text = "报表打印";
//
// 月餐段汇总表ToolStripMenuItem
//
this.月餐段汇总表ToolStripMenuItem.Name = "月餐段汇总表ToolStripMenuItem";
this.月餐段汇总表ToolStripMenuItem.Size = new System.Drawing.Size(184, 22);
this.月餐段汇总表ToolStripMenuItem.Text = "月餐段汇总表";
this.月餐段汇总表ToolStripMenuItem.Click += new System.EventHandler(this.月餐段汇总表ToolStripMenuItem_Click);
//
// 计次就餐天消费表ToolStripMenuItem
//
this.计次就餐天消费表ToolStripMenuItem.Name = "计次就餐天消费表ToolStripMenuItem";
this.计次就餐天消费表ToolStripMenuItem.Size = new System.Drawing.Size(184, 22);
this.计次就餐天消费表ToolStripMenuItem.Text = "记次就餐天消费表";
this.计次就餐天消费表ToolStripMenuItem.Click += new System.EventHandler(this.计次就餐天消费表ToolStripMenuItem_Click);
//
// 计次就餐消费明细表ToolStripMenuItem
//
this.计次就餐消费明细表ToolStripMenuItem.Name = "计次就餐消费明细表ToolStripMenuItem";
this.计次就餐消费明细表ToolStripMenuItem.Size = new System.Drawing.Size(184, 22);
this.计次就餐消费明细表ToolStripMenuItem.Text = "记次就餐消费明细表";
this.计次就餐消费明细表ToolStripMenuItem.Click += new System.EventHandler(this.计次就餐消费明细表ToolStripMenuItem_Click);
//
// 记次就餐ToolStripMenuItem
//
this.记次就餐ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.餐段设置ToolStripMenuItem});
this.记次就餐ToolStripMenuItem.Name = "记次就餐ToolStripMenuItem";
this.记次就餐ToolStripMenuItem.Size = new System.Drawing.Size(68, 21);
this.记次就餐ToolStripMenuItem.Text = "记次就餐";
//
// 餐段设置ToolStripMenuItem
//
this.餐段设置ToolStripMenuItem.Name = "餐段设置ToolStripMenuItem";
this.餐段设置ToolStripMenuItem.Size = new System.Drawing.Size(124, 22);
this.餐段设置ToolStripMenuItem.Text = "餐段设置";
this.餐段设置ToolStripMenuItem.Click += new System.EventHandler(this.餐段设置ToolStripMenuItem_Click);
//
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.Location = new System.Drawing.Point(0, 25);
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
this.splitContainer1.Name = "splitContainer1";
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.groupBox5);
this.splitContainer1.Panel1.Controls.Add(this.groupBox1);
this.splitContainer1.Panel1.Controls.Add(this.groupBox4);
this.splitContainer1.Panel1.Controls.Add(this.groupBox3);
@@ -237,10 +105,48 @@
//
this.splitContainer1.Panel2.BackColor = System.Drawing.SystemColors.Highlight;
this.splitContainer1.Panel2.Controls.Add(this.splitContainer2);
this.splitContainer1.Size = new System.Drawing.Size(1207, 664);
this.splitContainer1.Size = new System.Drawing.Size(1207, 717);
this.splitContainer1.SplitterDistance = 249;
this.splitContainer1.TabIndex = 1;
//
// groupBox5
//
this.groupBox5.BackColor = System.Drawing.SystemColors.Control;
this.groupBox5.Controls.Add(this.pictureBox11);
this.groupBox5.Controls.Add(this.button8);
this.groupBox5.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.groupBox5.ForeColor = System.Drawing.Color.Black;
this.groupBox5.Location = new System.Drawing.Point(3, 584);
this.groupBox5.Name = "groupBox5";
this.groupBox5.Size = new System.Drawing.Size(243, 77);
this.groupBox5.TabIndex = 12;
this.groupBox5.TabStop = false;
this.groupBox5.Text = "广告设置";
//
// pictureBox11
//
this.pictureBox11.BackColor = System.Drawing.Color.Transparent;
this.pictureBox11.Image = global::HKCardManager.Properties.Resources.shijianshezhi;
this.pictureBox11.Location = new System.Drawing.Point(16, 37);
this.pictureBox11.Name = "pictureBox11";
this.pictureBox11.Size = new System.Drawing.Size(20, 20);
this.pictureBox11.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBox11.TabIndex = 11;
this.pictureBox11.TabStop = false;
//
// button8
//
this.button8.BackColor = System.Drawing.SystemColors.Control;
this.button8.Location = new System.Drawing.Point(9, 29);
this.button8.Name = "button8";
this.button8.Padding = new System.Windows.Forms.Padding(30, 0, 0, 0);
this.button8.Size = new System.Drawing.Size(220, 36);
this.button8.TabIndex = 1;
this.button8.Text = "广告设置";
this.button8.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.button8.UseVisualStyleBackColor = false;
this.button8.Click += new System.EventHandler(this.button8_Click);
//
// groupBox1
//
this.groupBox1.BackColor = System.Drawing.SystemColors.Control;
@@ -584,21 +490,21 @@
//
// splitContainer2.Panel2
//
this.splitContainer2.Panel2.Controls.Add(this.label1);
this.splitContainer2.Panel2.Controls.Add(this.listBox1);
this.splitContainer2.Size = new System.Drawing.Size(954, 664);
this.splitContainer2.SplitterDistance = 500;
this.splitContainer2.Size = new System.Drawing.Size(954, 717);
this.splitContainer2.SplitterDistance = 539;
this.splitContainer2.TabIndex = 0;
//
// panel1
//
this.panel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.panel1.BackColor = System.Drawing.SystemColors.Control;
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Margin = new System.Windows.Forms.Padding(3, 3, 3, 10);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(954, 500);
this.panel1.Size = new System.Drawing.Size(954, 539);
this.panel1.TabIndex = 1;
//
// listBox1
@@ -610,36 +516,24 @@
this.listBox1.Location = new System.Drawing.Point(0, 0);
this.listBox1.Margin = new System.Windows.Forms.Padding(3, 10, 3, 3);
this.listBox1.Name = "listBox1";
this.listBox1.Size = new System.Drawing.Size(954, 160);
this.listBox1.Size = new System.Drawing.Size(954, 174);
this.listBox1.TabIndex = 0;
//
// label1
//
this.label1.AutoSize = true;
this.label1.BackColor = System.Drawing.SystemColors.Control;
this.label1.Location = new System.Drawing.Point(247, 61);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(43, 17);
this.label1.TabIndex = 1;
this.label1.Text = "label1";
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1207, 689);
this.ClientSize = new System.Drawing.Size(1207, 717);
this.Controls.Add(this.splitContainer1);
this.Controls.Add(this.menuStrip1);
this.MainMenuStrip = this.menuStrip1;
this.Name = "Form1";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Form1";
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.groupBox5.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pictureBox11)).EndInit();
this.groupBox1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
@@ -656,31 +550,13 @@
((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit();
this.splitContainer2.Panel1.ResumeLayout(false);
this.splitContainer2.Panel2.ResumeLayout(false);
this.splitContainer2.Panel2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
this.splitContainer2.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();

}

#endregion

private MenuStrip menuStrip1;
private ToolStripMenuItem 人事信息ZToolStripMenuItem;
private ToolStripMenuItem 人员录入ToolStripMenuItem;
private ToolStripMenuItem 卡片维护ToolStripMenuItem;
private ToolStripMenuItem 发卡ToolStripMenuItem;
private ToolStripMenuItem 销户ToolStripMenuItem;
private ToolStripMenuItem 挂失ToolStripMenuItem;
private ToolStripMenuItem 解挂ToolStripMenuItem;
private ToolStripMenuItem 报表打印ToolStripMenuItem;
private ToolStripMenuItem 月餐段汇总表ToolStripMenuItem;
private ToolStripMenuItem 计次就餐天消费表ToolStripMenuItem;
private ToolStripMenuItem 计次就餐消费明细表ToolStripMenuItem;
private ToolStripMenuItem 记次就餐ToolStripMenuItem;
private ToolStripMenuItem 餐段设置ToolStripMenuItem;
private ToolStripMenuItem 机构录入ToolStripMenuItem;
private SplitContainer splitContainer1;
private Button button1;
private GroupBox groupBox4;
@@ -710,6 +586,8 @@
private PictureBox pictureBox4;
private PictureBox pictureBox3;
private PictureBox pictureBox2;
private Label label1;
private GroupBox groupBox5;
private PictureBox pictureBox11;
private Button button8;
}
}

+ 83
- 68
HKCardManager/Form1.cs View File

@@ -18,14 +18,7 @@ namespace HKCardManager
this.button1.SizeChanged += Button1_SizeChanged;
MessageLogNotify.GetInstance.Info = new Action<string, Brush>((s, br) =>
{
this.Invoke(() =>
{
AddListToListBox(listBox1, s, br, true);
//if (listBox1.Items.Count > 0)
// listBox1.Items.Insert(0, $"{DateTime.Now.ToString("HH:mm:ss")}:{s}");
//else
// listBox1.Items.Add($"{DateTime.Now.ToString("HH:mm:ss")}:{s}");
});
this.Invoke(() => { AddListToListBox(listBox1, s, br, true); });
});
}

@@ -181,69 +174,86 @@ namespace HKCardManager
tempUserControl.Height = this.panel1.Height;
}
splitContainer1.SplitterDistance = 240;
}

private void 人员录入ToolStripMenuItem_Click(object sender, EventArgs e)
{
new PersonnelEntry().ShowDialog();
}

private void 机构录入ToolStripMenuItem_Click(object sender, EventArgs e)
{
new InstitutionalEntry().ShowDialog();
}

private void 发卡ToolStripMenuItem_Click(object sender, EventArgs e)
{
new Hairpin().ShowDialog();
}

private void 销户ToolStripMenuItem_Click(object sender, EventArgs e)
{
Cancellation cancellation = new Cancellation();
cancellation.Text = "销户";
cancellation.ShowDialog();
}

private void 挂失ToolStripMenuItem_Click(object sender, EventArgs e)
{
Cancellation cancellation = new Cancellation();
cancellation.Text = "挂失";
cancellation.ShowDialog();
}

private void 解挂ToolStripMenuItem_Click(object sender, EventArgs e)
{
Cancellation cancellation = new Cancellation();
cancellation.Text = "解挂";
cancellation.ShowDialog();
}

private void 月餐段汇总表ToolStripMenuItem_Click(object sender, EventArgs e)
{
DailyConsumptionTable dailyConsumptionTable = new DailyConsumptionTable();
dailyConsumptionTable.Text = "月餐段汇总表";
dailyConsumptionTable.ShowDialog();
}

private void 计次就餐天消费表ToolStripMenuItem_Click(object sender, EventArgs e)
{
DailyConsumptionTable dailyConsumptionTable = new DailyConsumptionTable();
dailyConsumptionTable.Text = "计次就餐天消费表";
dailyConsumptionTable.ShowDialog();
}

private void 计次就餐消费明细表ToolStripMenuItem_Click(object sender, EventArgs e)
{
DailyConsumptionTable dailyConsumptionTable = new DailyConsumptionTable();
dailyConsumptionTable.Text = "计次就餐消费明细表";
dailyConsumptionTable.ShowDialog();
if (this.WindowState == FormWindowState.Maximized || this.WindowState == FormWindowState.Normal)
{
Task.Factory.StartNew(() =>
{
Thread.Sleep(100);
this.Invoke(() =>
{
if (tempUserControl != null)
{
tempUserControl.Width = this.panel1.Width;
tempUserControl.Height = this.panel1.Height;
}
splitContainer1.SplitterDistance = 240;
});
});
}
}

private void 餐段设置ToolStripMenuItem_Click(object sender, EventArgs e)
{
new MealSegmentSet().ShowDialog();
}
//private void 人员录入ToolStripMenuItem_Click(object sender, EventArgs e)
//{
// new PersonnelEntry().ShowDialog();
//}

//private void 机构录入ToolStripMenuItem_Click(object sender, EventArgs e)
//{
// new InstitutionalEntry().ShowDialog();
//}

//private void 发卡ToolStripMenuItem_Click(object sender, EventArgs e)
//{
// new Hairpin().ShowDialog();
//}

//private void 销户ToolStripMenuItem_Click(object sender, EventArgs e)
//{
// Cancellation cancellation = new Cancellation();
// cancellation.Text = "销户";
// cancellation.ShowDialog();
//}

//private void 挂失ToolStripMenuItem_Click(object sender, EventArgs e)
//{
// Cancellation cancellation = new Cancellation();
// cancellation.Text = "挂失";
// cancellation.ShowDialog();
//}

//private void 解挂ToolStripMenuItem_Click(object sender, EventArgs e)
//{
// Cancellation cancellation = new Cancellation();
// cancellation.Text = "解挂";
// cancellation.ShowDialog();
//}

//private void 月餐段汇总表ToolStripMenuItem_Click(object sender, EventArgs e)
//{
// DailyConsumptionTable dailyConsumptionTable = new DailyConsumptionTable();
// dailyConsumptionTable.Text = "月餐段汇总表";
// dailyConsumptionTable.ShowDialog();
//}

//private void 计次就餐天消费表ToolStripMenuItem_Click(object sender, EventArgs e)
//{
// DailyConsumptionTable dailyConsumptionTable = new DailyConsumptionTable();
// dailyConsumptionTable.Text = "计次就餐天消费表";
// dailyConsumptionTable.ShowDialog();
//}

//private void 计次就餐消费明细表ToolStripMenuItem_Click(object sender, EventArgs e)
//{
// DailyConsumptionTable dailyConsumptionTable = new DailyConsumptionTable();
// dailyConsumptionTable.Text = "计次就餐消费明细表";
// dailyConsumptionTable.ShowDialog();
//}

//private void 餐段设置ToolStripMenuItem_Click(object sender, EventArgs e)
//{
// new MealSegmentSet().ShowDialog();
//}

//人员录入
private void button2_Click(object sender, EventArgs e)
@@ -291,5 +301,10 @@ namespace HKCardManager
userControl.Show();
panel1.Controls.Add(userControl);
}

private void button8_Click(object sender, EventArgs e)
{
ShowPage(new AdvertisingSetPage());
}
}
}

+ 0
- 3
HKCardManager/Form1.resx View File

@@ -57,7 +57,4 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

+ 1
- 0
HKCardManager/HKCardManager.csproj View File

@@ -26,6 +26,7 @@

<ItemGroup>
<PackageReference Include="BPA.Helper" Version="1.0.17" />
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.1370.28" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="6.0.0" />
</ItemGroup>



+ 21
- 0
HKCardManager/Models/Global.cs View File

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HKCardManager
{
public class Global
{
/// <summary>
/// 用户信息列表
/// </summary>
public static List<UserInfoModel> UserListDtos { get; set; } = new List<UserInfoModel>();

/// <summary>
/// 机构信息
/// </summary>
public static List<string> OrgList { get; set; } = new List<string>();
}
}

+ 4
- 4
HKCardManager/Servers/MessageLogNotify.cs View File

@@ -22,7 +22,7 @@ namespace HKCardManager
/// <param name="brush">日志显示颜色</param>
public void Show(string info, Brush brush = null)
{
Info?.Invoke(info, brush == null ? Brushes.Green : brush);
Info?.Invoke($"消息:{info}", brush == null ? Brushes.Green : brush);
}

/// <summary>
@@ -32,7 +32,7 @@ namespace HKCardManager
/// <param name="brush">日志显示颜色</param>
public void ShowEx(string info, Brush brush = null)
{
Info?.Invoke(info, brush == null ? Brushes.Red : brush);
Info?.Invoke($"异常:{info}", brush == null ? Brushes.Red : brush);
}

/// <summary>
@@ -42,7 +42,7 @@ namespace HKCardManager
/// <param name="brush">日志显示颜色</param>
public void ShowError(string info, Brush brush = null)
{
Info?.Invoke(info, brush == null ? Brushes.Red : brush);
Info?.Invoke($"错误:{info}", brush == null ? Brushes.Red : brush);
}

/// <summary>
@@ -52,7 +52,7 @@ namespace HKCardManager
/// <param name="brush">日志显示颜色</param>
public void ShowWarning(string info, Brush brush = null)
{
Info?.Invoke(info, brush == null ? Brushes.Yellow : brush);
Info?.Invoke($"警告:{info}", brush == null ? Brushes.Olive : brush);
}

}


+ 64
- 0
HKCardManager/UserPages/AdvertisingSetPage.Designer.cs View File

@@ -0,0 +1,64 @@
namespace HKCardManager.UserPages
{
partial class AdvertisingSetPage
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;

/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}

#region 组件设计器生成的代码

/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.webView21 = new Microsoft.Web.WebView2.WinForms.WebView2();
((System.ComponentModel.ISupportInitialize)(this.webView21)).BeginInit();
this.SuspendLayout();
//
// webView21
//
this.webView21.AllowExternalDrop = true;
this.webView21.CreationProperties = null;
this.webView21.DefaultBackgroundColor = System.Drawing.Color.White;
this.webView21.Dock = System.Windows.Forms.DockStyle.Fill;
this.webView21.Location = new System.Drawing.Point(0, 0);
this.webView21.Name = "webView21";
this.webView21.Size = new System.Drawing.Size(490, 322);
this.webView21.Source = new System.Uri("http:\\\\www.baidu.com", System.UriKind.Absolute);
this.webView21.TabIndex = 0;
this.webView21.ZoomFactor = 1D;
//
// AdvertisingSetPage
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.webView21);
this.Name = "AdvertisingSetPage";
this.Size = new System.Drawing.Size(490, 322);
((System.ComponentModel.ISupportInitialize)(this.webView21)).EndInit();
this.ResumeLayout(false);

}

#endregion

private Microsoft.Web.WebView2.WinForms.WebView2 webView21;
}
}

+ 20
- 0
HKCardManager/UserPages/AdvertisingSetPage.cs View File

@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace HKCardManager.UserPages
{
public partial class AdvertisingSetPage : UserControl
{
public AdvertisingSetPage()
{
InitializeComponent();
}
}
}

+ 60
- 0
HKCardManager/UserPages/AdvertisingSetPage.resx View File

@@ -0,0 +1,60 @@
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

+ 13
- 0
HKCardManager/UserPages/CarMangerPage.Designer.cs View File

@@ -39,6 +39,7 @@
this.radioButton2 = new System.Windows.Forms.RadioButton();
this.radioButton1 = new System.Windows.Forms.RadioButton();
this.panel1 = new System.Windows.Forms.Panel();
this.comboBox2 = new System.Windows.Forms.ComboBox();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
@@ -102,6 +103,7 @@
//
// comboBox1
//
this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBox1.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.comboBox1.FormattingEnabled = true;
this.comboBox1.Location = new System.Drawing.Point(98, 179);
@@ -145,6 +147,7 @@
//
// panel1
//
this.panel1.Controls.Add(this.comboBox2);
this.panel1.Controls.Add(this.textBox2);
this.panel1.Controls.Add(this.comboBox1);
this.panel1.Controls.Add(this.radioButton1);
@@ -160,6 +163,15 @@
this.panel1.Size = new System.Drawing.Size(301, 335);
this.panel1.TabIndex = 31;
//
// comboBox2
//
this.comboBox2.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.comboBox2.FormattingEnabled = true;
this.comboBox2.Location = new System.Drawing.Point(98, 91);
this.comboBox2.Name = "comboBox2";
this.comboBox2.Size = new System.Drawing.Size(190, 29);
this.comboBox2.TabIndex = 30;
//
// CarMangerPage
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
@@ -185,5 +197,6 @@
private RadioButton radioButton2;
private RadioButton radioButton1;
private Panel panel1;
private ComboBox comboBox2;
}
}

+ 112
- 5
HKCardManager/UserPages/CarMangerPage.cs View File

@@ -19,19 +19,126 @@ namespace HKCardManager.UserPages
{
public partial class CarMangerPage : UserControl
{
List<string> OrgList = new List<string>();
//List<string> OrgList = new List<string>();
List<OrgTable> orgTables = new List<OrgTable>();
List<string> Personnels = new List<string>();
public CarMangerPage()
{
InitializeComponent();
this.SizeChanged += CarMangerPage_SizeChanged;
radioButton1.CheckedChanged += RadioButton1_CheckedChanged;
radioButton2.CheckedChanged += RadioButton1_CheckedChanged;
comboBox2.MouseDown += ComboBox2_MouseDown;
comboBox2.TextUpdate += ComboBox2_TextUpdate;
comboBox2.SelectedValueChanged += ComboBox2_SelectedValueChanged;


radioButton1.Checked = true;
comboBox2.Visible = false;
orgTables = ServiceHandler.GetOrgList();
orgTables?.ForEach(item =>
Global.UserListDtos.ForEach(item => { if (!string.IsNullOrEmpty(item.UserName)) Personnels.Add(item.UserName); });
comboBox2.DataSource = Personnels;
comboBox1.DataSource = Global.OrgList;
}

private void ComboBox2_SelectedValueChanged(object? sender, EventArgs e)
{
if (radioButton2.Checked)
{
var user = Global.UserListDtos.FirstOrDefault(p => !string.IsNullOrEmpty(comboBox2.Text.Trim()) && !string.IsNullOrEmpty(p.UserName) && p.UserName == comboBox2.Text.Trim());
if (user != null && !string.IsNullOrEmpty(user.Phone))
{
textBox4.Text = user.Phone;
if (!string.IsNullOrEmpty(user.OrgName) && Global.OrgList.Contains(user.OrgName))
{
comboBox1.Text = user.OrgName;
}
else
{
comboBox1.SelectedIndex = -1;
}
}
}
}

private void ComboBox2_TextUpdate(object? sender, EventArgs e)
{
string name = comboBox2.Text.Trim();
if (string.IsNullOrEmpty(name))
{
Personnels.Clear();
Global.UserListDtos.ForEach(item => { if (!string.IsNullOrEmpty(item.UserName)) Personnels.Add(item.UserName); });
comboBox2.DataSource = null;
comboBox2.DataSource = Personnels;
comboBox2.DroppedDown = true;
comboBox2.SelectedIndex = -1;
return;
}
comboBox2.DroppedDown = true;
var res = Global.UserListDtos.Where(p => !string.IsNullOrEmpty(p.UserName) && !string.IsNullOrEmpty(comboBox2.Text.Trim()) && p.UserName.Contains(comboBox2.Text.Trim())).ToList();
if (res != null)
{
Personnels.Clear();
res.ForEach(p => Personnels.Add(p.UserName));
comboBox2.DataSource = null;
comboBox2.DataSource = Personnels;
comboBox2.SelectedIndex = -1;
comboBox2.Text = name;
comboBox2.SelectionStart = name.Length;
}
}

private void ComboBox2_MouseDown(object? sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
OrgList.Add(item.Name);
});
comboBox1.DataSource = OrgList;
comboBox2.DroppedDown = true;
}
}

private void RadioButton1_CheckedChanged(object? sender, EventArgs e)
{
var obj = (RadioButton)sender;
if (obj != null)
{
if (obj.Name == "radioButton1")
{
if (obj.Checked)
{
textBox2.Visible = true;
textBox2.Enabled = true;
comboBox2.Visible = false;
comboBox2.Enabled = false;
//textBox4.Enabled = true;
//comboBox1.Enabled = true;
}
}
else if (obj.Name == "radioButton2")//人员已录入进行发卡
{
if (obj.Checked)
{
textBox2.Visible = false;
textBox2.Enabled = false;
comboBox2.Visible = true;
comboBox2.Enabled = true;
//textBox4.Enabled = false;
//comboBox1.Enabled = false;
var user = Global.UserListDtos.FirstOrDefault(p => !string.IsNullOrEmpty(comboBox2.Text.Trim()) && !string.IsNullOrEmpty(p.UserName) && p.UserName == comboBox2.Text.Trim());
if (user != null && !string.IsNullOrEmpty(user.Phone))
{
textBox4.Text = user.Phone;
if (!string.IsNullOrEmpty(user.OrgName) && Global.OrgList.Contains(user.OrgName))
{
comboBox1.Text = user.OrgName;
}
else
{
comboBox1.SelectedIndex = -1;
}
}
}
}
}
}

private void CarMangerPage_SizeChanged(object? sender, EventArgs e)


+ 3
- 0
HKCardManager/UserPages/InstitutionalEntryPage.cs View File

@@ -35,7 +35,10 @@ namespace HKCardManager.UserPages
Task.Factory.StartNew(() =>
{
if (ServiceHandler.AddOrg(name))
{
Global.OrgList.Add(name);
MessageLogNotify.GetInstance.Show($"【{name}】 机构添加成功");
}
else
MessageLogNotify.GetInstance.ShowError($"【{name}】 机构添加失败,请重试");



+ 17
- 15
HKCardManager/UserPages/PersonnelEntryPage.cs View File

@@ -16,21 +16,21 @@ namespace HKCardManager.UserPages
{
public partial class PersonnelEntryPage : UserControl
{
List<string> OrgList = new List<string>();
//List<string> OrgList = new List<string>();
List<OrgTable> orgTables = new List<OrgTable>();
List<UserInfoModel> userListDtos = new List<UserInfoModel>();
public PersonnelEntryPage()
{
InitializeComponent();
//this.SizeChanged += PersonnelEntryPage_SizeChanged;
this.SizeChanged += PersonnelEntryPage_SizeChanged;
dataGridView1.AutoGenerateColumns = false;
comboBox1.SelectedIndex = 0;
orgTables = ServiceHandler.GetOrgList();
orgTables?.ForEach(item =>
{
OrgList.Add(item.Name);
Global.OrgList.Add(item.Name);
});
comboBox2.DataSource = OrgList;
comboBox2.DataSource = Global.OrgList;
Task.Factory.StartNew(() =>
{
var res = HKLibHelper.GetUserList("");
@@ -43,7 +43,7 @@ namespace HKCardManager.UserPages
cardNum = item.Cards.ElementAt(0).CardNum;
status = ((CarStatus)item.Cards.ElementAt(0).State).ToString();
}
userListDtos.Add(new UserInfoModel()
Global.UserListDtos.Add(new UserInfoModel()
{
UserName = item.Name,
Phone = item.Phone,
@@ -53,7 +53,7 @@ namespace HKCardManager.UserPages
});
});
//TestData();
this.Invoke(() => { dataGridView1.DataSource = userListDtos; });
this.Invoke(() => { dataGridView1.DataSource = Global.UserListDtos; });
});
}

@@ -61,7 +61,7 @@ namespace HKCardManager.UserPages
{
for (int i = 0; i < 10; i++)
{
userListDtos.Add(new UserInfoModel()
Global.UserListDtos.Add(new UserInfoModel()
{
CardNum = Guid.NewGuid().ToString(),
State = CarStatus.正常.ToString(),
@@ -72,11 +72,13 @@ namespace HKCardManager.UserPages
}
}

//private void PersonnelEntryPage_SizeChanged(object? sender, EventArgs e)
//{
// panel1.Left = (this.Width - panel1.Width) / 2;
// panel1.Top = (this.Height - panel1.Height) / 2;
//}
private void PersonnelEntryPage_SizeChanged(object? sender, EventArgs e)
{
//panel1.Left = (this.Width - panel1.Width) / 2;
//panel1.Top = (this.Height - panel1.Height) / 2;
var tt1 = dataGridView1.Size;
var tt = this.Size;
}

private void button2_Click(object sender, EventArgs e)
{
@@ -101,7 +103,7 @@ namespace HKCardManager.UserPages
{
if (HKLibHelper.AddUser(userDto))
{
userListDtos.Add(new UserInfoModel()
Global.UserListDtos.Add(new UserInfoModel()
{
OrgName = OrgName,
Phone = userDto.Phone,
@@ -110,7 +112,7 @@ namespace HKCardManager.UserPages
this.Invoke(() =>
{
dataGridView1.DataSource = null;
dataGridView1.DataSource = userListDtos;
dataGridView1.DataSource = Global.UserListDtos;
//dataGridView1.Rows.Add();
//int len = dataGridView1.Rows.Count - 1;
//dataGridView1.Rows[len].Cells[0].Value = userDto.Name;


+ 6
- 1
HKLib/Interfaces/HKLibHelper.cs View File

@@ -62,6 +62,11 @@ namespace HKLib.Interfaces
}).Build().RunStringFirst().ToModel<JObject>()["data"]["data"]["id"].ToString();
}

//public static string GetKou()
//{
///// api / GateInfo / gatelist ? StoreId = 0c32b2e2 - 0dc9 - 4941 - b73d - 3dc91f7268ab & Current = 1 & PageSize = 10
//}

/// <summary>
/// 修改机构
/// </summary>
@@ -182,7 +187,7 @@ namespace HKLib.Interfaces
{
t.NodePath = Route;
t.ReqType = MultiType.POST;
t.JsonParam = (new { StartTime =input.StartTime.ToShortDateString(), EndTime=input.EndTime.ToShortDateString() }).ToJson();
t.JsonParam = (new { StartTime = input.StartTime.ToShortDateString(), EndTime = input.EndTime.ToShortDateString() }).ToJson();
}).Build().RunStringFirst();
return data.ToModel<JObject>()["data"]["data"].ToJson().ToModel<List<ReportCountDto>>();
}


Loading…
Cancel
Save