APP.cs
2.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
using HHWCS.Model;
using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace HHWCS.Common
{
public class APP
{
public static String ConnectionString = ConfigurationManager.ConnectionStrings["MySql"].ConnectionString;
public static MySqlConnection MysqlConnection = new MySqlConnection(ConnectionString);
public static String Origin = ConfigurationManager.AppSettings["origin"];
public static User User { get; set; }
/// <summary>
/// DataGridView格式化
/// </summary>
/// <param name="dv">DataGridView控制</param>
public static void FormatDgv2(DataGridView dv)
{
#region
dv.AlternatingRowsDefaultCellStyle.BackColor = Color.FromArgb(231, 235, 247);
dv.GridColor = Color.FromArgb(148, 190, 231);
dv.DefaultCellStyle.BackColor = Color.FromArgb(239, 243, 255);
dv.DefaultCellStyle.SelectionBackColor = Color.Blue;
dv.RowHeadersWidth = 4;
//dv.BackgroundColor = Color.Honeydew;
dv.BackgroundColor = Color.FromArgb(200, 212, 200);//FromArgb(200, 198, 200)
dv.ColumnHeadersDefaultCellStyle.BackColor = Color.FromArgb(200, 230, 200);
//可以改变表格线条风格
//dv.GridColor = Color.BlueViolet;
dv.BorderStyle = BorderStyle.Fixed3D;
dv.EditMode = DataGridViewEditMode.EditProgrammatically;
dv.RowHeadersBorderStyle = DataGridViewHeaderBorderStyle.Single;
dv.ColumnHeadersBorderStyle = DataGridViewHeaderBorderStyle.Single;
dv.AutoGenerateColumns = false;
//dv.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;//AllCells //DisplayedCells
//dv.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
#endregion
}
internal static String GetTaskType(String v)
{
switch (v)
{
case "100": return "整盘入库";
case "200": return "补充入库";
case "300": return "整盘出库";
case "400": return "分拣出库";
case "500": return "空容器入库";
case "600": return "空容器出库";
case "700": return "盘点";
case "800": return "移库";
case "900": return "出库查看";
}
return "未识别的任务类型";
}
}
}