├── .gitignore
├── CRM.sln
├── CRM
├── ActionLog.cs
├── ActionName.cs
├── App.config
├── CommStatic.cs
├── DBHelper.cs
├── DiamondGreen.ssk
├── HTCRM.csproj
├── INI.sqlite
├── IrisSkin2.dll
├── MP10.ssk
├── Product
│ ├── frmAddProductName.Designer.cs
│ ├── frmAddProductName.cs
│ ├── frmAddProductName.resx
│ ├── frmEmployeeMgr.Designer.cs
│ ├── frmEmployeeMgr.cs
│ ├── frmEmployeeMgr.resx
│ ├── ucCommProductPrice.Designer.cs
│ ├── ucCommProductPrice.cs
│ ├── ucCommProductPrice.resx
│ ├── ucProductHelperMsg.Designer.cs
│ ├── ucProductHelperMsg.cs
│ ├── ucProductHelperMsg.resx
│ ├── ucPromoteDiscount.Designer.cs
│ ├── ucPromoteDiscount.cs
│ └── ucPromoteDiscount.resx
├── Program.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
├── Resources
│ ├── Acount.png
│ ├── Add.png
│ ├── Add1.png
│ ├── Lock.png
│ ├── OutPut.png
│ ├── Pay.png
│ ├── Rcharge.png
│ ├── Save.png
│ ├── Waring.png
│ ├── Waring1.png
│ ├── WorkerMan.png
│ ├── card-1.png
│ ├── change-1.png
│ ├── clock.png
│ ├── consulm.png
│ ├── detail1.png
│ ├── empleey.png
│ ├── help.png
│ ├── ico128.ico
│ ├── login1.jpg
│ ├── monthCalendar.png
│ ├── png-0084.png
│ ├── png-0094.png
│ ├── png-0535.png
│ ├── png-0652.png
│ ├── png-1106.png
│ ├── print.png
│ ├── product.png
│ ├── setting0.png
│ ├── user.png
│ └── work.png
├── ShortCut.cs
├── SystemSetting
│ ├── UCBackAndReBack.Designer.cs
│ ├── UCBackAndReBack.cs
│ ├── UCBackAndReBack.resx
│ ├── UCCompanyInfo.Designer.cs
│ ├── UCCompanyInfo.cs
│ ├── UCCompanyInfo.resx
│ ├── UCOtherSetting.Designer.cs
│ ├── UCOtherSetting.cs
│ ├── UCOtherSetting.resx
│ ├── UCRoleSetting.Designer.cs
│ ├── UCRoleSetting.cs
│ ├── UCRoleSetting.resx
│ ├── UCUserTypeAndEmployeeMgr.Designer.cs
│ ├── UCUserTypeAndEmployeeMgr.cs
│ ├── UCUserTypeAndEmployeeMgr.resx
│ ├── UcWorkTime.Designer.cs
│ ├── UcWorkTime.cs
│ ├── UcWorkTime.resx
│ ├── UserTypeAdd.Designer.cs
│ ├── UserTypeAdd.cs
│ ├── UserTypeAdd.resx
│ ├── frmSystemSetting.Designer.cs
│ ├── frmSystemSetting.cs
│ └── frmSystemSetting.resx
├── UCUserInfo.Designer.cs
├── UCUserInfo.cs
├── UCUserInfo.resx
├── frmAddEmployee.Designer.cs
├── frmAddEmployee.cs
├── frmAddEmployee.resx
├── frmAddUser.Designer.cs
├── frmAddUser.cs
├── frmAddUser.resx
├── frmAdminMgr.Designer.cs
├── frmAdminMgr.cs
├── frmAdminMgr.resx
├── frmCardMgr.Designer.cs
├── frmCardMgr.cs
├── frmCardMgr.resx
├── frmCheckOnMgr.Designer.cs
├── frmCheckOnMgr.cs
├── frmCheckOnMgr.resx
├── frmCloseAccount.Designer.cs
├── frmCloseAccount.cs
├── frmCloseAccount.resx
├── frmConsumeDetail.Designer.cs
├── frmConsumeDetail.cs
├── frmConsumeDetail.resx
├── frmConsumeHistory.Designer.cs
├── frmConsumeHistory.cs
├── frmConsumeHistory.resx
├── frmContact.Designer.cs
├── frmContact.cs
├── frmContact.resx
├── frmEventWaring.Designer.cs
├── frmEventWaring.cs
├── frmEventWaring.resx
├── frmIsRun.Designer.cs
├── frmIsRun.cs
├── frmIsRun.resx
├── frmLogin.Designer.cs
├── frmLogin.cs
├── frmLogin.resx
├── frmMain.Designer.cs
├── frmMain.cs
├── frmMain.resx
├── frmProductsMgr.Designer.cs
├── frmProductsMgr.cs
├── frmProductsMgr.resx
├── frmRechargecs.Designer.cs
├── frmRechargecs.cs
├── frmRechargecs.resx
├── frmUserMgr.Designer.cs
├── frmUserMgr.cs
├── frmUserMgr.resx
├── help.chm
├── ico128.ico
├── skinBase.cs
└── skinBase.resx
├── DBAcess
├── DBAccess.cs
├── DBAcess.csproj
├── DBFactory.cs
├── DBType.cs
├── DLL
│ ├── MySql.Data.dll
│ └── System.Data.SQLite.dll
├── MySqlAccess.cs
├── Properties
│ └── AssemblyInfo.cs
├── SqLiteAccess.cs
├── SqlAccess.cs
└── SqlParam.cs
├── README.md
├── Reader
├── IReader.cs
├── Properties
│ └── AssemblyInfo.cs
├── Reader.csproj
├── ReaderManager.cs
└── STReader
│ ├── API_RF.cs
│ ├── EasyPOD.dll
│ ├── STReader.cs
│ └── iccrf.dll
├── Resource
├── DBAgent.cs
├── DBConfig.config
├── Properties
│ └── AssemblyInfo.cs
├── Resource.cs
├── Resource.csproj
└── app.config
├── Router
├── DBPool.cs
├── Properties
│ └── AssemblyInfo.cs
├── Router.cs
└── Router.csproj
├── Tools
├── Properties
│ └── AssemblyInfo.cs
├── SerializeHelper.cs
├── Tools.cs
├── Tools.csproj
└── TracingHelper.cs
├── help.png
└── qrcode.png
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.userosscache
8 | *.sln.docstates
9 |
10 | # User-specific files (MonoDevelop/Xamarin Studio)
11 | *.userprefs
12 |
13 | # Build results
14 | [Dd]ebug/
15 | [Dd]ebugPublic/
16 | [Rr]elease/
17 | [Rr]eleases/
18 | x64/
19 | x86/
20 | bld/
21 | [Bb]in/
22 | [Oo]bj/
23 | [Ll]og/
24 |
25 | # Visual Studio 2015 cache/options directory
26 | .vs/
27 | # Uncomment if you have tasks that create the
--------------------------------------------------------------------------------
/CRM.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.23107.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HTCRM", "CRM\HTCRM.csproj", "{7FB9BBFF-5FEA-4524-9F2D-F90975FB75FA}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Reader", "Reader\Reader.csproj", "{7BF82F49-91C8-445B-95D9-E2CA5DE6179F}"
9 | EndProject
10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tools", "Tools\Tools.csproj", "{980CEAD6-A620-4CBA-997D-1C255BF8EF0D}"
11 | EndProject
12 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DataBase", "DataBase", "{D0DFF119-27FC-42AB-A018-986A4FF585E1}"
13 | EndProject
14 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DBAcess", "DBAcess\DBAcess.csproj", "{25352743-08B4-48E6-92E1-0A58C0AD760E}"
15 | EndProject
16 | Global
17 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
18 | Debug|Any CPU = Debug|Any CPU
19 | Debug|Mixed Platforms = Debug|Mixed Platforms
20 | Debug|x86 = Debug|x86
21 | Release|Any CPU = Release|Any CPU
22 | Release|Mixed Platforms = Release|Mixed Platforms
23 | Release|x86 = Release|x86
24 | EndGlobalSection
25 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
26 | {7FB9BBFF-5FEA-4524-9F2D-F90975FB75FA}.Debug|Any CPU.ActiveCfg = Debug|x86
27 | {7FB9BBFF-5FEA-4524-9F2D-F90975FB75FA}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
28 | {7FB9BBFF-5FEA-4524-9F2D-F90975FB75FA}.Debug|Mixed Platforms.Build.0 = Debug|x86
29 | {7FB9BBFF-5FEA-4524-9F2D-F90975FB75FA}.Debug|x86.ActiveCfg = Debug|x86
30 | {7FB9BBFF-5FEA-4524-9F2D-F90975FB75FA}.Debug|x86.Build.0 = Debug|x86
31 | {7FB9BBFF-5FEA-4524-9F2D-F90975FB75FA}.Release|Any CPU.ActiveCfg = Release|x86
32 | {7FB9BBFF-5FEA-4524-9F2D-F90975FB75FA}.Release|Mixed Platforms.ActiveCfg = Release|x86
33 | {7FB9BBFF-5FEA-4524-9F2D-F90975FB75FA}.Release|Mixed Platforms.Build.0 = Release|x86
34 | {7FB9BBFF-5FEA-4524-9F2D-F90975FB75FA}.Release|x86.ActiveCfg = Release|x86
35 | {7FB9BBFF-5FEA-4524-9F2D-F90975FB75FA}.Release|x86.Build.0 = Release|x86
36 | {7BF82F49-91C8-445B-95D9-E2CA5DE6179F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
37 | {7BF82F49-91C8-445B-95D9-E2CA5DE6179F}.Debug|Any CPU.Build.0 = Debug|Any CPU
38 | {7BF82F49-91C8-445B-95D9-E2CA5DE6179F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
39 | {7BF82F49-91C8-445B-95D9-E2CA5DE6179F}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
40 | {7BF82F49-91C8-445B-95D9-E2CA5DE6179F}.Debug|x86.ActiveCfg = Debug|Any CPU
41 | {7BF82F49-91C8-445B-95D9-E2CA5DE6179F}.Release|Any CPU.ActiveCfg = Release|Any CPU
42 | {7BF82F49-91C8-445B-95D9-E2CA5DE6179F}.Release|Any CPU.Build.0 = Release|Any CPU
43 | {7BF82F49-91C8-445B-95D9-E2CA5DE6179F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
44 | {7BF82F49-91C8-445B-95D9-E2CA5DE6179F}.Release|Mixed Platforms.Build.0 = Release|Any CPU
45 | {7BF82F49-91C8-445B-95D9-E2CA5DE6179F}.Release|x86.ActiveCfg = Release|Any CPU
46 | {980CEAD6-A620-4CBA-997D-1C255BF8EF0D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
47 | {980CEAD6-A620-4CBA-997D-1C255BF8EF0D}.Debug|Any CPU.Build.0 = Debug|Any CPU
48 | {980CEAD6-A620-4CBA-997D-1C255BF8EF0D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
49 | {980CEAD6-A620-4CBA-997D-1C255BF8EF0D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
50 | {980CEAD6-A620-4CBA-997D-1C255BF8EF0D}.Debug|x86.ActiveCfg = Debug|Any CPU
51 | {980CEAD6-A620-4CBA-997D-1C255BF8EF0D}.Release|Any CPU.ActiveCfg = Release|Any CPU
52 | {980CEAD6-A620-4CBA-997D-1C255BF8EF0D}.Release|Any CPU.Build.0 = Release|Any CPU
53 | {980CEAD6-A620-4CBA-997D-1C255BF8EF0D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
54 | {980CEAD6-A620-4CBA-997D-1C255BF8EF0D}.Release|Mixed Platforms.Build.0 = Release|Any CPU
55 | {980CEAD6-A620-4CBA-997D-1C255BF8EF0D}.Release|x86.ActiveCfg = Release|Any CPU
56 | {25352743-08B4-48E6-92E1-0A58C0AD760E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
57 | {25352743-08B4-48E6-92E1-0A58C0AD760E}.Debug|Any CPU.Build.0 = Debug|Any CPU
58 | {25352743-08B4-48E6-92E1-0A58C0AD760E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
59 | {25352743-08B4-48E6-92E1-0A58C0AD760E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
60 | {25352743-08B4-48E6-92E1-0A58C0AD760E}.Debug|x86.ActiveCfg = Debug|Any CPU
61 | {25352743-08B4-48E6-92E1-0A58C0AD760E}.Release|Any CPU.ActiveCfg = Release|Any CPU
62 | {25352743-08B4-48E6-92E1-0A58C0AD760E}.Release|Any CPU.Build.0 = Release|Any CPU
63 | {25352743-08B4-48E6-92E1-0A58C0AD760E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
64 | {25352743-08B4-48E6-92E1-0A58C0AD760E}.Release|Mixed Platforms.Build.0 = Release|Any CPU
65 | {25352743-08B4-48E6-92E1-0A58C0AD760E}.Release|x86.ActiveCfg = Release|Any CPU
66 | EndGlobalSection
67 | GlobalSection(SolutionProperties) = preSolution
68 | HideSolutionNode = FALSE
69 | EndGlobalSection
70 | GlobalSection(NestedProjects) = preSolution
71 | {25352743-08B4-48E6-92E1-0A58C0AD760E} = {D0DFF119-27FC-42AB-A018-986A4FF585E1}
72 | EndGlobalSection
73 | EndGlobal
74 |
--------------------------------------------------------------------------------
/CRM/ActionLog.cs:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------
2 | Copyright (C) 2014 宏图会员管理系统(Grant 巩建春)
3 |
4 | 项目名称: 宏图会员管理系统
5 | 创建者: grant (巩建春 emaill : nnn987@126.com ; QQ:406333743;Tel:+86 15619212255)
6 | CLR版本: 4.0.30319.42000
7 | 时间: 2014/8/28 18:16:22
8 |
9 | 功能描述:本软件为本人业余时间所写,其所有源码都可以进行免费的学习交流,切勿用于商业用途
10 |
11 | ----------------------------------------------------------------*/
12 | using System;
13 | using System.Collections.Generic;
14 | using System.Linq;
15 | using System.Text;
16 | using Tools;
17 |
18 |
19 | namespace CRM
20 | {
21 | public class ActionLog
22 | {
23 | public static bool Add(ActionName actName, string actContent)
24 | {
25 | try
26 | {
27 | string sql = "Insert into ActionLog(ID,ActionName,ActionTime,AdminId,ActionContent)values(@ID,@ActionName,@ActionTime,@AdminId,@ActionContent)";
28 | if (DBHelper.ExecuteNonQuery(sql, new string[] { "@ID", "@ActionName", "@ActionTime", "@AdminId", "@ActionContent" },
29 | new object[] { Guid.NewGuid().ToString("N"), actName.ToString(), DateTime.Now, CommStatic.MyCache.Login.Id, actContent }) > 0)
30 | return true;
31 | return false;
32 | }
33 | catch (Exception ex)
34 | {
35 | TracingHelper.Error(ex, typeof(ActionLog));
36 | return false;
37 | }
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/CRM/ActionName.cs:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------
2 | Copyright (C) 2014 宏图会员管理系统(Grant 巩建春)
3 |
4 | 项目名称: 宏图会员管理系统
5 | 创建者: grant (巩建春 emaill : nnn987@126.com ; QQ:406333743;Tel:+86 15619212255)
6 | CLR版本: 4.0.30319.42000
7 | 时间: 2014/8/28 18:16:22
8 |
9 | 功能描述:本软件为本人业余时间所写,其所有源码都可以进行免费的学习交流,切勿用于商业用途
10 |
11 | ----------------------------------------------------------------*/
12 | using System;
13 | using System.Collections.Generic;
14 | using System.Linq;
15 | using System.Text;
16 |
17 | namespace CRM
18 | {
19 | public enum ActionName
20 | {
21 | Login,
22 | DeleteAdmin,
23 | EditAdmin,
24 | AddAdmin,
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/CRM/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/CRM/DBHelper.cs:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------
2 | Copyright (C) 2014 宏图会员管理系统(Grant 巩建春)
3 |
4 | 项目名称: 宏图会员管理系统
5 | 创建者: grant (巩建春 emaill : nnn987@126.com ; QQ:406333743;Tel:+86 15619212255)
6 | CLR版本: 4.0.30319.42000
7 | 时间: 2014/8/28 18:16:22
8 |
9 | 功能描述:本软件为本人业余时间所写,其所有源码都可以进行免费的学习交流,切勿用于商业用途
10 |
11 | ----------------------------------------------------------------*/
12 | using System;
13 | using System.Collections.Generic;
14 | using System.Linq;
15 | using System.Text;
16 | using System.Data;
17 | using DBAccess;
18 |
19 | namespace CRM
20 | {
21 | public class DBHelper
22 | {
23 | public static string DBFilePath =AppDomain.CurrentDomain.BaseDirectory+"INI.sqlite";
24 | private static SqLiteAccess db = new SqLiteAccess(DBFilePath, "gongjianchun!@#$%^&*()brysjhhrhl");
25 | public static int ExecuteNonQuery(string cmdText,string[] paramsList, object[] values)
26 | {
27 | return db.ExecuteNonQuery(cmdText, CommandType.Text, paramsList, values);
28 | }
29 |
30 | public static int ExecuteNonQuery(string cmdText)
31 | {
32 | return ExecuteNonQuery(cmdText, null, null);
33 | }
34 |
35 | public static DataSet ExecuteDataSet(string cmdText, string[] paramsList, object[] values)
36 | {
37 | return db.ExecuteDataSet(cmdText, CommandType.Text, paramsList, values);
38 | }
39 |
40 | public static DataSet ExecuteDataSet(string cmdText)
41 | {
42 | return ExecuteDataSet(cmdText, null, null);
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/CRM/DiamondGreen.ssk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/grantgonggithub/CRM/2f026027b97bae878004d3e0dfac3ac0c147569a/CRM/DiamondGreen.ssk
--------------------------------------------------------------------------------
/CRM/INI.sqlite:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/grantgonggithub/CRM/2f026027b97bae878004d3e0dfac3ac0c147569a/CRM/INI.sqlite
--------------------------------------------------------------------------------
/CRM/IrisSkin2.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/grantgonggithub/CRM/2f026027b97bae878004d3e0dfac3ac0c147569a/CRM/IrisSkin2.dll
--------------------------------------------------------------------------------
/CRM/MP10.ssk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/grantgonggithub/CRM/2f026027b97bae878004d3e0dfac3ac0c147569a/CRM/MP10.ssk
--------------------------------------------------------------------------------
/CRM/Product/frmAddProductName.Designer.cs:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------
2 | Copyright (C) 2014 宏图会员管理系统(Grant 巩建春)
3 |
4 | 项目名称: 宏图会员管理系统
5 | 创建者: grant (巩建春 emaill : nnn987@126.com ; QQ:406333743;Tel:+86 15619212255)
6 | CLR版本: 4.0.30319.42000
7 | 时间: 2014/8/28 18:16:22
8 |
9 | 功能描述:本软件为本人业余时间所写,其所有源码都可以进行免费的学习交流,切勿用于商业用途
10 |
11 | ----------------------------------------------------------------*/
12 | namespace CRM
13 | {
14 | partial class frmAddProductName
15 | {
16 | ///
17 | /// Required designer variable.
18 | ///
19 | private System.ComponentModel.IContainer components = null;
20 |
21 | ///
22 | /// Clean up any resources being used.
23 | ///
24 | /// true if managed resources should be disposed; otherwise, false.
25 | protected override void Dispose(bool disposing)
26 | {
27 | if (disposing && (components != null))
28 | {
29 | components.Dispose();
30 | }
31 | base.Dispose(disposing);
32 | }
33 |
34 | #region Windows Form Designer generated code
35 |
36 | ///
37 | /// Required method for Designer support - do not modify
38 | /// the contents of this method with the code editor.
39 | ///
40 | private void InitializeComponent()
41 | {
42 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmAddProductName));
43 | this.label1 = new System.Windows.Forms.Label();
44 | this.txtProductName = new System.Windows.Forms.TextBox();
45 | this.label2 = new System.Windows.Forms.Label();
46 | this.txtRemark = new System.Windows.Forms.TextBox();
47 | this.btnSave = new System.Windows.Forms.Button();
48 | this.btnCancel = new System.Windows.Forms.Button();
49 | this.SuspendLayout();
50 | //
51 | // label1
52 | //
53 | this.label1.AutoSize = true;
54 | this.label1.Location = new System.Drawing.Point(24, 27);
55 | this.label1.Name = "label1";
56 | this.label1.Size = new System.Drawing.Size(47, 12);
57 | this.label1.TabIndex = 0;
58 | this.label1.Text = "名 称";
59 | //
60 | // txtProductName
61 | //
62 | this.txtProductName.Location = new System.Drawing.Point(72, 22);
63 | this.txtProductName.Name = "txtProductName";
64 | this.txtProductName.Size = new System.Drawing.Size(160, 21);
65 | this.txtProductName.TabIndex = 1;
66 | //
67 | // label2
68 | //
69 | this.label2.AutoSize = true;
70 | this.label2.Location = new System.Drawing.Point(24, 101);
71 | this.label2.Name = "label2";
72 | this.label2.Size = new System.Drawing.Size(47, 12);
73 | this.label2.TabIndex = 0;
74 | this.label2.Text = "备 注";
75 | //
76 | // txtRemark
77 | //
78 | this.txtRemark.Location = new System.Drawing.Point(72, 59);
79 | this.txtRemark.Multiline = true;
80 | this.txtRemark.Name = "txtRemark";
81 | this.txtRemark.Size = new System.Drawing.Size(160, 97);
82 | this.txtRemark.TabIndex = 1;
83 | //
84 | // btnSave
85 | //
86 | this.btnSave.Location = new System.Drawing.Point(26, 183);
87 | this.btnSave.Name = "btnSave";
88 | this.btnSave.Size = new System.Drawing.Size(75, 23);
89 | this.btnSave.TabIndex = 2;
90 | this.btnSave.Text = "保存";
91 | this.btnSave.UseVisualStyleBackColor = true;
92 | this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
93 | //
94 | // btnCancel
95 | //
96 | this.btnCancel.Location = new System.Drawing.Point(157, 183);
97 | this.btnCancel.Name = "btnCancel";
98 | this.btnCancel.Size = new System.Drawing.Size(75, 23);
99 | this.btnCancel.TabIndex = 2;
100 | this.btnCancel.Text = "取消";
101 | this.btnCancel.UseVisualStyleBackColor = true;
102 | this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
103 | //
104 | // frmAddProductName
105 | //
106 | this.AcceptButton = this.btnSave;
107 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
108 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
109 | this.ClientSize = new System.Drawing.Size(265, 234);
110 | this.Controls.Add(this.btnCancel);
111 | this.Controls.Add(this.btnSave);
112 | this.Controls.Add(this.txtRemark);
113 | this.Controls.Add(this.label2);
114 | this.Controls.Add(this.txtProductName);
115 | this.Controls.Add(this.label1);
116 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
117 | this.MaximizeBox = false;
118 | this.MinimizeBox = false;
119 | this.Name = "frmAddProductName";
120 | this.ResumeLayout(false);
121 | this.PerformLayout();
122 |
123 | }
124 |
125 | #endregion
126 |
127 | private System.Windows.Forms.Label label1;
128 | private System.Windows.Forms.TextBox txtProductName;
129 | private System.Windows.Forms.Label label2;
130 | private System.Windows.Forms.TextBox txtRemark;
131 | private System.Windows.Forms.Button btnSave;
132 | private System.Windows.Forms.Button btnCancel;
133 | }
134 | }
--------------------------------------------------------------------------------
/CRM/Product/frmAddProductName.cs:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------
2 | Copyright (C) 2014 宏图会员管理系统(Grant 巩建春)
3 |
4 | 项目名称: 宏图会员管理系统
5 | 创建者: grant (巩建春 emaill : nnn987@126.com ; QQ:406333743;Tel:+86 15619212255)
6 | CLR版本: 4.0.30319.42000
7 | 时间: 2014/8/28 18:16:22
8 |
9 | 功能描述:本软件为本人业余时间所写,其所有源码都可以进行免费的学习交流,切勿用于商业用途
10 |
11 | ----------------------------------------------------------------*/
12 | using System;
13 | using System.Collections.Generic;
14 | using System.ComponentModel;
15 | using System.Data;
16 | using System.Drawing;
17 | using System.Linq;
18 | using System.Text;
19 | using System.Windows.Forms;
20 | using Tools;
21 |
22 | namespace CRM
23 | {
24 | public partial class frmAddProductName : skinBase
25 | {
26 | private DataRow row;
27 | public frmAddProductName()
28 | {
29 | InitializeComponent();
30 | }
31 | public frmAddProductName(DataRow _row)
32 | {
33 | InitializeComponent();
34 | this.row = _row;
35 | this.txtProductName.Text = row["ProductName"].ToString();
36 | this.txtRemark.Text = row["Remark"] == null ? "" : row["Remark"].ToString();
37 | txtProductName.Focus();
38 | }
39 |
40 | private void btnSave_Click(object sender, EventArgs e)
41 | {
42 | try
43 | {
44 | if (string.IsNullOrEmpty(txtProductName.Text))
45 | {
46 | MessageBox.Show("产品或者服务名称不能为空");
47 | return;
48 | }
49 | string sql = "select * from Product where ProductName=@ProductName" + (this.row == null ? "" : " and Id<>'" + this.row["Id"].ToString() + "'");
50 | DataSet ds = DBHelper.ExecuteDataSet(sql, new string[] { "@ProductName" }, new object[] { txtProductName.Text.Trim() });
51 | if (ds != null && ds.Tables[0].Rows.Count > 0)
52 | {
53 | MessageBox.Show("名字为\"" + txtProductName.Text + "\"的产品或者服务已经存在,请直接对其进行设置");
54 | return;
55 | }
56 | string[] prm = null;
57 | object[] obj = null;
58 | if (row == null)
59 | {
60 | sql = "Insert into Product(ID,ProductName,Remark,CreateTime,UpdateTime)values(@ID,@ProductName,@Remark,@CreateTime,@UpdateTime)";
61 | prm = new string[] { "@ID", "@ProductName", "@Remark", "@CreateTime", "@UpdateTime" };
62 | obj = new object[] { Guid.NewGuid().ToString("N"), txtProductName.Text, txtRemark.Text.Trim() == "" ? "" : txtRemark.Text, DateTime.Now, DateTime.Now };
63 | }
64 | else
65 | {
66 | sql = "Update Product set ProductName=@ProductName,Remark=@Remark,UpdateTime=@UpdateTime where Id=@Id";
67 | prm = new string[] { "@ProductName", "@Remark", "@Id", "@UpdateTime" };
68 | obj = new object[] { txtProductName.Text.Trim(), txtRemark.Text.Trim() == "" ? "" : txtRemark.Text.Trim(), row["Id"].ToString(), DateTime.Now };
69 | }
70 | if (DBHelper.ExecuteNonQuery(sql, prm, obj) > 0)
71 | {
72 | this.DialogResult = DialogResult.OK;
73 | this.Close();
74 | }
75 | }
76 | catch (Exception ex)
77 | {
78 | TracingHelper.Error(ex, typeof(frmAddProductName));
79 | }
80 | }
81 |
82 | private void btnCancel_Click(object sender, EventArgs e)
83 | {
84 | this.Close();
85 | }
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/CRM/Product/ucProductHelperMsg.Designer.cs:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------
2 | Copyright (C) 2014 宏图会员管理系统(Grant 巩建春)
3 |
4 | 项目名称: 宏图会员管理系统
5 | 创建者: grant (巩建春 emaill : nnn987@126.com ; QQ:406333743;Tel:+86 15619212255)
6 | CLR版本: 4.0.30319.42000
7 | 时间: 2014/8/28 18:16:22
8 |
9 | 功能描述:本软件为本人业余时间所写,其所有源码都可以进行免费的学习交流,切勿用于商业用途
10 |
11 | ----------------------------------------------------------------*/
12 | namespace CRM
13 | {
14 | partial class ucProductHelperMsg
15 | {
16 | ///
17 | /// 必需的设计器变量。
18 | ///
19 | private System.ComponentModel.IContainer components = null;
20 |
21 | ///
22 | /// 清理所有正在使用的资源。
23 | ///
24 | /// 如果应释放托管资源,为 true;否则为 false。
25 | protected override void Dispose(bool disposing)
26 | {
27 | if (disposing && (components != null))
28 | {
29 | components.Dispose();
30 | }
31 | base.Dispose(disposing);
32 | }
33 |
34 | #region 组件设计器生成的代码
35 |
36 | ///
37 | /// 设计器支持所需的方法 - 不要
38 | /// 使用代码编辑器修改此方法的内容。
39 | ///
40 | private void InitializeComponent()
41 | {
42 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ucProductHelperMsg));
43 | this.label1 = new System.Windows.Forms.Label();
44 | this.SuspendLayout();
45 | //
46 | // label1
47 | //
48 | this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
49 | this.label1.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
50 | this.label1.Location = new System.Drawing.Point(0, 0);
51 | this.label1.Name = "label1";
52 | this.label1.Padding = new System.Windows.Forms.Padding(8);
53 | this.label1.Size = new System.Drawing.Size(596, 331);
54 | this.label1.TabIndex = 0;
55 | this.label1.Text = resources.GetString("label1.Text");
56 | //
57 | // ucProductHelperMsg
58 | //
59 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
60 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
61 | this.Controls.Add(this.label1);
62 | this.Name = "ucProductHelperMsg";
63 | this.Size = new System.Drawing.Size(596, 331);
64 | this.ResumeLayout(false);
65 |
66 | }
67 |
68 | #endregion
69 |
70 | private System.Windows.Forms.Label label1;
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/CRM/Product/ucProductHelperMsg.cs:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------
2 | Copyright (C) 2014 宏图会员管理系统(Grant 巩建春)
3 |
4 | 项目名称: 宏图会员管理系统
5 | 创建者: grant (巩建春 emaill : nnn987@126.com ; QQ:406333743;Tel:+86 15619212255)
6 | CLR版本: 4.0.30319.42000
7 | 时间: 2014/8/28 18:16:22
8 |
9 | 功能描述:本软件为本人业余时间所写,其所有源码都可以进行免费的学习交流,切勿用于商业用途
10 |
11 | ----------------------------------------------------------------*/
12 | using System;
13 | using System.Collections.Generic;
14 | using System.ComponentModel;
15 | using System.Drawing;
16 | using System.Data;
17 | using System.Linq;
18 | using System.Text;
19 | using System.Windows.Forms;
20 |
21 | namespace CRM
22 | {
23 | public partial class ucProductHelperMsg : UserControl
24 | {
25 | public ucProductHelperMsg()
26 | {
27 | InitializeComponent();
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/CRM/Program.cs:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------
2 | Copyright (C) 2014 宏图会员管理系统(Grant 巩建春)
3 |
4 | 项目名称: 宏图会员管理系统
5 | 创建者: grant (巩建春 emaill : nnn987@126.com ; QQ:406333743;Tel:+86 15619212255)
6 | CLR版本: 4.0.30319.42000
7 | 时间: 2014/8/28 18:16:22
8 |
9 | 功能描述:本软件为本人业余时间所写,其所有源码都可以进行免费的学习交流,切勿用于商业用途
10 |
11 | ----------------------------------------------------------------*/
12 | using System;
13 | using System.Collections.Generic;
14 | using System.Windows.Forms;
15 | using System.Threading;
16 | using System.Diagnostics;
17 | using System.Runtime.InteropServices;
18 | using Tools;
19 |
20 | namespace CRM
21 | {
22 | static class Program
23 | {
24 | ///
25 | /// 应用程序的主入口点。
26 | ///
27 | [STAThread]
28 | static void Main()
29 | {
30 | Application.EnableVisualStyles();
31 | Application.SetCompatibleTextRenderingDefault(false);
32 | try
33 | {
34 | bool canCreate;
35 | Mutex myMutex = new Mutex(true, "MutexCRMString", out canCreate);
36 | if (canCreate)
37 | {
38 | using (frmLogin login = new frmLogin())
39 | {
40 | if (login.ShowDialog() == DialogResult.OK)
41 | ;
42 | else
43 | Environment.Exit(0);
44 | }
45 | CommStatic.ConfigInitlize();
46 |
47 | Application.Run(new frmMain());
48 | }
49 | else
50 | {
51 | //ExistRunningInstance();
52 | frmIsRun r = new frmIsRun();
53 | r.ShowDialog();
54 | }
55 | }
56 | catch (Exception ex)
57 | {
58 | Tools.TracingHelper.Error(ex, typeof(Program));
59 | MessageBox.Show(ex.Message);
60 | }
61 | }
62 |
63 | // Uses to active the exist window
64 | [DllImport("User32.dll")]
65 | public static extern void SetForegroundWindow(IntPtr hwnd);
66 |
67 | [DllImport("User32.dll")]
68 | private static extern bool ShowWindowAsync(IntPtr hWnd, int cmdShow);
69 |
70 | // 0-Hidden, 1-Centered, 2-Minimized, 3-Maximized
71 | private const int WS_SHOWNORMAL =3;
72 |
73 | private static bool ExistRunningInstance()
74 | {
75 | Process currentProcess = Process.GetCurrentProcess();
76 | Process[] procList = Process.GetProcessesByName(currentProcess.ProcessName);
77 |
78 | foreach (Process proc in procList)
79 | {
80 | if (proc.Id != currentProcess.Id)
81 | {
82 | ShowWindowAsync(proc.MainWindowHandle, WS_SHOWNORMAL);
83 | SetForegroundWindow(proc.MainWindowHandle);
84 |
85 | return true;
86 | }
87 | }
88 | return false;
89 | }
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/CRM/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过以下
6 | // 特性集控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("CRM")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Sky123.Org")]
12 | [assembly: AssemblyProduct("CRM")]
13 | [assembly: AssemblyCopyright("Copyright © Sky123.Org 2014")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("c0a15498-6e76-401d-83c8-f4f04183ab74")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 内部版本号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/CRM/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // 此代码由工具生成。
4 | // 运行时版本:4.0.30319.1022
5 | //
6 | // 对此文件的更改可能会导致不正确的行为,并且如果
7 | // 重新生成代码,这些更改将会丢失。
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace CRM.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.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 | }
27 |
--------------------------------------------------------------------------------
/CRM/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/CRM/Resources/Acount.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/grantgonggithub/CRM/2f026027b97bae878004d3e0dfac3ac0c147569a/CRM/Resources/Acount.png
--------------------------------------------------------------------------------
/CRM/Resources/Add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/grantgonggithub/CRM/2f026027b97bae878004d3e0dfac3ac0c147569a/CRM/Resources/Add.png
--------------------------------------------------------------------------------
/CRM/Resources/Add1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/grantgonggithub/CRM/2f026027b97bae878004d3e0dfac3ac0c147569a/CRM/Resources/Add1.png
--------------------------------------------------------------------------------
/CRM/Resources/Lock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/grantgonggithub/CRM/2f026027b97bae878004d3e0dfac3ac0c147569a/CRM/Resources/Lock.png
--------------------------------------------------------------------------------
/CRM/Resources/OutPut.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/grantgonggithub/CRM/2f026027b97bae878004d3e0dfac3ac0c147569a/CRM/Resources/OutPut.png
--------------------------------------------------------------------------------
/CRM/Resources/Pay.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/grantgonggithub/CRM/2f026027b97bae878004d3e0dfac3ac0c147569a/CRM/Resources/Pay.png
--------------------------------------------------------------------------------
/CRM/Resources/Rcharge.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/grantgonggithub/CRM/2f026027b97bae878004d3e0dfac3ac0c147569a/CRM/Resources/Rcharge.png
--------------------------------------------------------------------------------
/CRM/Resources/Save.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/grantgonggithub/CRM/2f026027b97bae878004d3e0dfac3ac0c147569a/CRM/Resources/Save.png
--------------------------------------------------------------------------------
/CRM/Resources/Waring.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/grantgonggithub/CRM/2f026027b97bae878004d3e0dfac3ac0c147569a/CRM/Resources/Waring.png
--------------------------------------------------------------------------------
/CRM/Resources/Waring1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/grantgonggithub/CRM/2f026027b97bae878004d3e0dfac3ac0c147569a/CRM/Resources/Waring1.png
--------------------------------------------------------------------------------
/CRM/Resources/WorkerMan.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/grantgonggithub/CRM/2f026027b97bae878004d3e0dfac3ac0c147569a/CRM/Resources/WorkerMan.png
--------------------------------------------------------------------------------
/CRM/Resources/card-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/grantgonggithub/CRM/2f026027b97bae878004d3e0dfac3ac0c147569a/CRM/Resources/card-1.png
--------------------------------------------------------------------------------
/CRM/Resources/change-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/grantgonggithub/CRM/2f026027b97bae878004d3e0dfac3ac0c147569a/CRM/Resources/change-1.png
--------------------------------------------------------------------------------
/CRM/Resources/clock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/grantgonggithub/CRM/2f026027b97bae878004d3e0dfac3ac0c147569a/CRM/Resources/clock.png
--------------------------------------------------------------------------------
/CRM/Resources/consulm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/grantgonggithub/CRM/2f026027b97bae878004d3e0dfac3ac0c147569a/CRM/Resources/consulm.png
--------------------------------------------------------------------------------
/CRM/Resources/detail1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/grantgonggithub/CRM/2f026027b97bae878004d3e0dfac3ac0c147569a/CRM/Resources/detail1.png
--------------------------------------------------------------------------------
/CRM/Resources/empleey.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/grantgonggithub/CRM/2f026027b97bae878004d3e0dfac3ac0c147569a/CRM/Resources/empleey.png
--------------------------------------------------------------------------------
/CRM/Resources/help.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/grantgonggithub/CRM/2f026027b97bae878004d3e0dfac3ac0c147569a/CRM/Resources/help.png
--------------------------------------------------------------------------------
/CRM/Resources/ico128.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/grantgonggithub/CRM/2f026027b97bae878004d3e0dfac3ac0c147569a/CRM/Resources/ico128.ico
--------------------------------------------------------------------------------
/CRM/Resources/login1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/grantgonggithub/CRM/2f026027b97bae878004d3e0dfac3ac0c147569a/CRM/Resources/login1.jpg
--------------------------------------------------------------------------------
/CRM/Resources/monthCalendar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/grantgonggithub/CRM/2f026027b97bae878004d3e0dfac3ac0c147569a/CRM/Resources/monthCalendar.png
--------------------------------------------------------------------------------
/CRM/Resources/png-0084.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/grantgonggithub/CRM/2f026027b97bae878004d3e0dfac3ac0c147569a/CRM/Resources/png-0084.png
--------------------------------------------------------------------------------
/CRM/Resources/png-0094.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/grantgonggithub/CRM/2f026027b97bae878004d3e0dfac3ac0c147569a/CRM/Resources/png-0094.png
--------------------------------------------------------------------------------
/CRM/Resources/png-0535.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/grantgonggithub/CRM/2f026027b97bae878004d3e0dfac3ac0c147569a/CRM/Resources/png-0535.png
--------------------------------------------------------------------------------
/CRM/Resources/png-0652.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/grantgonggithub/CRM/2f026027b97bae878004d3e0dfac3ac0c147569a/CRM/Resources/png-0652.png
--------------------------------------------------------------------------------
/CRM/Resources/png-1106.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/grantgonggithub/CRM/2f026027b97bae878004d3e0dfac3ac0c147569a/CRM/Resources/png-1106.png
--------------------------------------------------------------------------------
/CRM/Resources/print.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/grantgonggithub/CRM/2f026027b97bae878004d3e0dfac3ac0c147569a/CRM/Resources/print.png
--------------------------------------------------------------------------------
/CRM/Resources/product.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/grantgonggithub/CRM/2f026027b97bae878004d3e0dfac3ac0c147569a/CRM/Resources/product.png
--------------------------------------------------------------------------------
/CRM/Resources/setting0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/grantgonggithub/CRM/2f026027b97bae878004d3e0dfac3ac0c147569a/CRM/Resources/setting0.png
--------------------------------------------------------------------------------
/CRM/Resources/user.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/grantgonggithub/CRM/2f026027b97bae878004d3e0dfac3ac0c147569a/CRM/Resources/user.png
--------------------------------------------------------------------------------
/CRM/Resources/work.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/grantgonggithub/CRM/2f026027b97bae878004d3e0dfac3ac0c147569a/CRM/Resources/work.png
--------------------------------------------------------------------------------
/CRM/SystemSetting/UCCompanyInfo.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 |
--------------------------------------------------------------------------------
/CRM/SystemSetting/UCOtherSetting.Designer.cs:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------
2 | Copyright (C) 2014 宏图会员管理系统(Grant 巩建春)
3 |
4 | 项目名称: 宏图会员管理系统
5 | 创建者: grant (巩建春 emaill : nnn987@126.com ; QQ:406333743;Tel:+86 15619212255)
6 | CLR版本: 4.0.30319.42000
7 | 时间: 2014/8/28 18:16:22
8 |
9 | 功能描述:本软件为本人业余时间所写,其所有源码都可以进行免费的学习交流,切勿用于商业用途
10 |
11 | ----------------------------------------------------------------*/
12 | namespace CRM
13 | {
14 | partial class UCOtherSetting
15 | {
16 | ///
17 | /// 必需的设计器变量。
18 | ///
19 | private System.ComponentModel.IContainer components = null;
20 |
21 | ///
22 | /// 清理所有正在使用的资源。
23 | ///
24 | /// 如果应释放托管资源,为 true;否则为 false。
25 | protected override void Dispose(bool disposing)
26 | {
27 | if (disposing && (components != null))
28 | {
29 | components.Dispose();
30 | }
31 | base.Dispose(disposing);
32 | }
33 |
34 | #region 组件设计器生成的代码
35 |
36 | ///
37 | /// 设计器支持所需的方法 - 不要
38 | /// 使用代码编辑器修改此方法的内容。
39 | ///
40 | private void InitializeComponent()
41 | {
42 | this.chboxAutoStart = new System.Windows.Forms.CheckBox();
43 | this.btnSave = new System.Windows.Forms.Button();
44 | this.SuspendLayout();
45 | //
46 | // chboxAutoStart
47 | //
48 | this.chboxAutoStart.AutoSize = true;
49 | this.chboxAutoStart.Location = new System.Drawing.Point(96, 43);
50 | this.chboxAutoStart.Name = "chboxAutoStart";
51 | this.chboxAutoStart.Size = new System.Drawing.Size(84, 16);
52 | this.chboxAutoStart.TabIndex = 1;
53 | this.chboxAutoStart.Text = "开机自启动";
54 | this.chboxAutoStart.UseVisualStyleBackColor = true;
55 | //
56 | // btnSave
57 | //
58 | this.btnSave.Location = new System.Drawing.Point(254, 39);
59 | this.btnSave.Name = "btnSave";
60 | this.btnSave.Size = new System.Drawing.Size(75, 23);
61 | this.btnSave.TabIndex = 2;
62 | this.btnSave.Text = "保存";
63 | this.btnSave.UseVisualStyleBackColor = true;
64 | this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
65 | //
66 | // UCOtherSetting
67 | //
68 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
69 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
70 | this.Controls.Add(this.btnSave);
71 | this.Controls.Add(this.chboxAutoStart);
72 | this.Name = "UCOtherSetting";
73 | this.Size = new System.Drawing.Size(451, 149);
74 | this.ResumeLayout(false);
75 | this.PerformLayout();
76 |
77 | }
78 |
79 | #endregion
80 |
81 | private System.Windows.Forms.CheckBox chboxAutoStart;
82 | private System.Windows.Forms.Button btnSave;
83 | }
84 | }
85 |
--------------------------------------------------------------------------------
/CRM/SystemSetting/UCOtherSetting.cs:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------
2 | Copyright (C) 2014 宏图会员管理系统(Grant 巩建春)
3 |
4 | 项目名称: 宏图会员管理系统
5 | 创建者: grant (巩建春 emaill : nnn987@126.com ; QQ:406333743;Tel:+86 15619212255)
6 | CLR版本: 4.0.30319.42000
7 | 时间: 2014/8/28 18:16:22
8 |
9 | 功能描述:本软件为本人业余时间所写,其所有源码都可以进行免费的学习交流,切勿用于商业用途
10 |
11 | ----------------------------------------------------------------*/
12 | using System;
13 | using System.Collections.Generic;
14 | using System.ComponentModel;
15 | using System.Drawing;
16 | using System.Data;
17 | using System.Linq;
18 | using System.Text;
19 | using System.Windows.Forms;
20 | using Microsoft.Win32;
21 | using Tools;
22 |
23 | namespace CRM
24 | {
25 | public partial class UCOtherSetting : UserControl
26 | {
27 | public UCOtherSetting()
28 | {
29 | InitializeComponent();
30 | chboxAutoStart.Checked = IsRegeditExit();
31 | }
32 |
33 |
34 | #region 将程序添加到启动项
35 | //private static RegistryKey HKLM = Registry.LocalMachine;
36 | private static RegistryKey HKCU = Registry.CurrentUser;
37 | private static string name = "HTCRM";
38 | private static string path = Application.ExecutablePath;
39 | ///
40 | /// 注册表操作,将程序添加到启动项
41 | ///
42 | public static void SetRegistryKey(bool Started)
43 | {
44 | try
45 | {
46 | RegistryKey Run = HKCU.CreateSubKey(@"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\");
47 | if (Started == true)
48 | {
49 | try
50 | {
51 | Run.SetValue(name, path);
52 | Run.Close();
53 | HKCU.Close();
54 | }
55 | catch (Exception ex)
56 | {
57 | TracingHelper.Error(ex, typeof(UCOtherSetting), "注册表修改失败(开机自启未实现)");
58 | }
59 | }
60 | else
61 | {
62 | if (Run.GetValue(name) != null)
63 | {
64 | Run.DeleteValue(name);
65 | Run.Close();
66 | HKCU.Close();
67 | }
68 | else
69 | return;
70 | }
71 | }
72 | catch (Exception ex)
73 | {
74 | TracingHelper.Error(ex, typeof(UCOtherSetting), "将程序添加到启动项错误");
75 | }
76 | }
77 |
78 | ///
79 | /// 获取是否开机启动
80 | ///
81 | ///
82 | public static bool IsRegeditExit()
83 | {
84 | try
85 | {
86 | RegistryKey software = HKCU.OpenSubKey("SOFTWARE", true);
87 | RegistryKey aimdir = software.OpenSubKey(@"Microsoft\Windows\CurrentVersion\Run\", true);
88 | object runObj = aimdir.GetValue(name);
89 | if (runObj == null || !path.Equals(runObj.ToString()))
90 | return false;
91 | else
92 | return true;
93 | }
94 | catch (Exception ex)
95 | {
96 | TracingHelper.Error(ex, typeof(UCOtherSetting), "获取是否开机启动错误");
97 | }
98 | return false;
99 | }
100 | #endregion
101 |
102 | private void btnSave_Click(object sender, EventArgs e)
103 | {
104 | if (chboxAutoStart.Checked)
105 | {
106 | if (!IsRegeditExit())
107 | SetRegistryKey(true);
108 | }
109 | else
110 | {
111 | if (IsRegeditExit())
112 | SetRegistryKey(false);
113 | }
114 | }
115 | }
116 | }
117 |
--------------------------------------------------------------------------------
/CRM/SystemSetting/UCOtherSetting.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 |
--------------------------------------------------------------------------------
/CRM/SystemSetting/UcWorkTime.cs:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------
2 | Copyright (C) 2014 宏图会员管理系统(Grant 巩建春)
3 |
4 | 项目名称: 宏图会员管理系统
5 | 创建者: grant (巩建春 emaill : nnn987@126.com ; QQ:406333743;Tel:+86 15619212255)
6 | CLR版本: 4.0.30319.42000
7 | 时间: 2014/8/28 18:16:22
8 |
9 | 功能描述:本软件为本人业余时间所写,其所有源码都可以进行免费的学习交流,切勿用于商业用途
10 |
11 | ----------------------------------------------------------------*/
12 | using System;
13 | using System.Collections.Generic;
14 | using System.ComponentModel;
15 | using System.Drawing;
16 | using System.Data;
17 | using System.Linq;
18 | using System.Text;
19 | using System.Windows.Forms;
20 | using Tools;
21 |
22 | namespace CRM
23 | {
24 | public partial class UcWorkTime : UserControl
25 | {
26 | public UcWorkTime()
27 | {
28 | InitializeComponent();
29 | Init();
30 | }
31 | private void Init()
32 | {
33 | try
34 | {
35 | string sql = "select * from SysConfig where key='StartWorkTimeSetting' or key='GoOffWorkTimeSetting'";
36 | DataSet ds = DBHelper.ExecuteDataSet(sql);
37 | if (ds == null || ds.Tables[0].Rows.Count < 2) return;
38 | DataTable dt = ds.Tables[0];
39 | DataRow row0;
40 | DataRow row1;
41 | if (dt.Rows[0]["key"].ToString() == "StartWorkTimeSetting")
42 | {
43 | row0 = dt.Rows[0];
44 | row1 = dt.Rows[1];
45 | }
46 | else
47 | {
48 | row0 = dt.Rows[1];
49 | row1 = dt.Rows[0];
50 | }
51 |
52 | nupdStartHour1.Value = decimal.Parse(row0["Value1"].ToString());
53 | nupdStartMinite1.Value = decimal.Parse(row0["Value2"].ToString());
54 | nupdStartHour2.Value = decimal.Parse(row0["Value3"].ToString());
55 | nupdStartMinite2.Value = decimal.Parse(row0["Value4"].ToString());
56 |
57 | nupdGoOffHour1.Value = decimal.Parse(row1["Value1"].ToString());
58 | nupdGoOffMinite1.Value = decimal.Parse(row1["Value2"].ToString());
59 | nupdGoOffHour2.Value = decimal.Parse(row1["Value3"].ToString());
60 | nupdGoOffMinite2.Value = decimal.Parse(row1["Value4"].ToString());
61 | }
62 | catch (Exception ex)
63 | {
64 | TracingHelper.Error(ex, typeof(UcWorkTime));
65 | }
66 | }
67 |
68 | private void btnSave_Click(object sender, EventArgs e)
69 | {
70 | try
71 | {
72 | if (nupdStartHour1.Value > nupdStartHour2.Value)
73 | {
74 | MessageBox.Show("上班时间不能比迟到时间晚");
75 | return;
76 | }
77 | if (nupdStartHour1.Value == nupdStartHour2.Value)
78 | {
79 | if (nupdStartMinite1.Value > nupdStartMinite2.Value)
80 | {
81 | MessageBox.Show("上班时间不能比迟到时间晚");
82 | return;
83 | }
84 | }
85 | if (nupdGoOffHour1.Value < nupdGoOffHour2.Value)
86 | {
87 | MessageBox.Show("下班时间不能比早退时间早");
88 | return;
89 | }
90 | if (nupdGoOffHour1.Value == nupdGoOffHour2.Value)
91 | {
92 | if (nupdGoOffMinite1.Value < nupdGoOffMinite2.Value)
93 | {
94 | MessageBox.Show("下班时间不能比早退时间早");
95 | return;
96 | }
97 | }
98 | string sql = "Update SysConfig set Value1='{0}',Value2='{1}',Value3='{2}',Value4='{3}' where key='{4}'";
99 | if (DBHelper.ExecuteNonQuery(string.Format(sql, nupdStartHour1.Value, nupdStartMinite1.Value, nupdStartHour2.Value, nupdStartMinite2.Value, "StartWorkTimeSetting")) > 0)
100 | {
101 | if (DBHelper.ExecuteNonQuery(string.Format(sql, nupdGoOffHour1.Value, nupdGoOffMinite1.Value, nupdGoOffHour2.Value, nupdGoOffMinite2.Value, "GoOffWorkTimeSetting")) > 0)
102 | {
103 | MessageBox.Show("保存成功");
104 | }
105 | }
106 | }
107 | catch (Exception ex)
108 | {
109 | TracingHelper.Error(ex, typeof(UcWorkTime));
110 | }
111 | }
112 | }
113 | }
114 |
--------------------------------------------------------------------------------
/CRM/SystemSetting/UcWorkTime.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 |
--------------------------------------------------------------------------------
/CRM/SystemSetting/UserTypeAdd.Designer.cs:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------
2 | Copyright (C) 2014 宏图会员管理系统(Grant 巩建春)
3 |
4 | 项目名称: 宏图会员管理系统
5 | 创建者: grant (巩建春 emaill : nnn987@126.com ; QQ:406333743;Tel:+86 15619212255)
6 | CLR版本: 4.0.30319.42000
7 | 时间: 2014/8/28 18:16:22
8 |
9 | 功能描述:本软件为本人业余时间所写,其所有源码都可以进行免费的学习交流,切勿用于商业用途
10 |
11 | ----------------------------------------------------------------*/
12 | namespace CRM
13 | {
14 | partial class UserTypeAdd
15 | {
16 | ///
17 | /// Required designer variable.
18 | ///
19 | private System.ComponentModel.IContainer components = null;
20 |
21 | ///
22 | /// Clean up any resources being used.
23 | ///
24 | /// true if managed resources should be disposed; otherwise, false.
25 | protected override void Dispose(bool disposing)
26 | {
27 | if (disposing && (components != null))
28 | {
29 | components.Dispose();
30 | }
31 | base.Dispose(disposing);
32 | }
33 |
34 | #region Windows Form Designer generated code
35 |
36 | ///
37 | /// Required method for Designer support - do not modify
38 | /// the contents of this method with the code editor.
39 | ///
40 | private void InitializeComponent()
41 | {
42 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UserTypeAdd));
43 | this.ucUserTypeAndEmployeeMgr1 = new CRM.UCUserTypeAndEmployeeMgr();
44 | this.SuspendLayout();
45 | //
46 | // ucUserTypeAndEmployeeMgr1
47 | //
48 | this.ucUserTypeAndEmployeeMgr1.Dock = System.Windows.Forms.DockStyle.Top;
49 | this.ucUserTypeAndEmployeeMgr1.Location = new System.Drawing.Point(0, 0);
50 | this.ucUserTypeAndEmployeeMgr1.Name = "ucUserTypeAndEmployeeMgr1";
51 | this.ucUserTypeAndEmployeeMgr1.Size = new System.Drawing.Size(391, 352);
52 | this.ucUserTypeAndEmployeeMgr1.TabIndex = 0;
53 | //
54 | // UserTypeAdd
55 | //
56 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
57 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
58 | this.ClientSize = new System.Drawing.Size(391, 356);
59 | this.Controls.Add(this.ucUserTypeAndEmployeeMgr1);
60 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
61 | this.MaximizeBox = false;
62 | this.MinimizeBox = false;
63 | this.Name = "UserTypeAdd";
64 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
65 | this.Text = "UserTypeAdd";
66 | this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.UserTypeAdd_FormClosing);
67 | this.ResumeLayout(false);
68 |
69 | }
70 |
71 | #endregion
72 |
73 | private UCUserTypeAndEmployeeMgr ucUserTypeAndEmployeeMgr1;
74 | }
75 | }
--------------------------------------------------------------------------------
/CRM/SystemSetting/UserTypeAdd.cs:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------
2 | Copyright (C) 2014 宏图会员管理系统(Grant 巩建春)
3 |
4 | 项目名称: 宏图会员管理系统
5 | 创建者: grant (巩建春 emaill : nnn987@126.com ; QQ:406333743;Tel:+86 15619212255)
6 | CLR版本: 4.0.30319.42000
7 | 时间: 2014/8/28 18:16:22
8 |
9 | 功能描述:本软件为本人业余时间所写,其所有源码都可以进行免费的学习交流,切勿用于商业用途
10 |
11 | ----------------------------------------------------------------*/
12 | using System;
13 | using System.Collections.Generic;
14 | using System.ComponentModel;
15 | using System.Data;
16 | using System.Drawing;
17 | using System.Linq;
18 | using System.Text;
19 | using System.Windows.Forms;
20 |
21 | namespace CRM
22 | {
23 | public partial class UserTypeAdd : skinBase
24 | {
25 | public UserTypeAdd()
26 | {
27 | InitializeComponent();
28 | }
29 | public UserTypeAdd(int sort)
30 | {
31 | InitializeComponent();
32 | this.Text = sort == 1 ? "会员类型管理" : "员工类型管理";
33 | ucUserTypeAndEmployeeMgr1.InitData(sort);
34 | }
35 |
36 | private void UserTypeAdd_FormClosing(object sender, FormClosingEventArgs e)
37 | {
38 | this.DialogResult = DialogResult.OK;
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/CRM/SystemSetting/frmSystemSetting.Designer.cs:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------
2 | Copyright (C) 2014 宏图会员管理系统(Grant 巩建春)
3 |
4 | 项目名称: 宏图会员管理系统
5 | 创建者: grant (巩建春 emaill : nnn987@126.com ; QQ:406333743;Tel:+86 15619212255)
6 | CLR版本: 4.0.30319.42000
7 | 时间: 2014/8/28 18:16:22
8 |
9 | 功能描述:本软件为本人业余时间所写,其所有源码都可以进行免费的学习交流,切勿用于商业用途
10 |
11 | ----------------------------------------------------------------*/
12 | namespace CRM
13 | {
14 | partial class frmSystemSetting
15 | {
16 | ///
17 | /// Required designer variable.
18 | ///
19 | private System.ComponentModel.IContainer components = null;
20 |
21 | ///
22 | /// Clean up any resources being used.
23 | ///
24 | /// true if managed resources should be disposed; otherwise, false.
25 | protected override void Dispose(bool disposing)
26 | {
27 | if (disposing && (components != null))
28 | {
29 | components.Dispose();
30 | }
31 | base.Dispose(disposing);
32 | }
33 |
34 | #region Windows Form Designer generated code
35 |
36 | ///
37 | /// Required method for Designer support - do not modify
38 | /// the contents of this method with the code editor.
39 | ///
40 | private void InitializeComponent()
41 | {
42 | System.Windows.Forms.TreeNode treeNode1 = new System.Windows.Forms.TreeNode("企业信息设置");
43 | System.Windows.Forms.TreeNode treeNode2 = new System.Windows.Forms.TreeNode("管理员角色管理");
44 | System.Windows.Forms.TreeNode treeNode3 = new System.Windows.Forms.TreeNode("上下班时间");
45 | System.Windows.Forms.TreeNode treeNode4 = new System.Windows.Forms.TreeNode("会员类型设置");
46 | System.Windows.Forms.TreeNode treeNode5 = new System.Windows.Forms.TreeNode("员工类型设置");
47 | System.Windows.Forms.TreeNode treeNode6 = new System.Windows.Forms.TreeNode("数据备份与还原");
48 | System.Windows.Forms.TreeNode treeNode7 = new System.Windows.Forms.TreeNode("其他设置");
49 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmSystemSetting));
50 | this.tvList = new System.Windows.Forms.TreeView();
51 | this.panelRight = new System.Windows.Forms.Panel();
52 | this.SuspendLayout();
53 | //
54 | // tvList
55 | //
56 | this.tvList.Dock = System.Windows.Forms.DockStyle.Left;
57 | this.tvList.HideSelection = false;
58 | this.tvList.ItemHeight = 30;
59 | this.tvList.Location = new System.Drawing.Point(0, 0);
60 | this.tvList.Name = "tvList";
61 | treeNode1.Name = "节点0";
62 | treeNode1.Text = "企业信息设置";
63 | treeNode2.Name = "tnRoleMgr";
64 | treeNode2.Text = "管理员角色管理";
65 | treeNode3.Name = "TnWorkTime";
66 | treeNode3.Text = "上下班时间";
67 | treeNode4.Name = "节点0";
68 | treeNode4.Text = "会员类型设置";
69 | treeNode5.Name = "节点1";
70 | treeNode5.Text = "员工类型设置";
71 | treeNode6.Name = "节点0";
72 | treeNode6.Text = "数据备份与还原";
73 | treeNode7.Name = "节点0";
74 | treeNode7.Text = "其他设置";
75 | this.tvList.Nodes.AddRange(new System.Windows.Forms.TreeNode[] {
76 | treeNode1,
77 | treeNode2,
78 | treeNode3,
79 | treeNode4,
80 | treeNode5,
81 | treeNode6,
82 | treeNode7});
83 | this.tvList.Size = new System.Drawing.Size(212, 497);
84 | this.tvList.TabIndex = 0;
85 | this.tvList.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.tvList_AfterSelect);
86 | //
87 | // panelRight
88 | //
89 | this.panelRight.Dock = System.Windows.Forms.DockStyle.Fill;
90 | this.panelRight.Location = new System.Drawing.Point(212, 0);
91 | this.panelRight.Name = "panelRight";
92 | this.panelRight.Padding = new System.Windows.Forms.Padding(6);
93 | this.panelRight.Size = new System.Drawing.Size(598, 497);
94 | this.panelRight.TabIndex = 1;
95 | //
96 | // frmSystemSetting
97 | //
98 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
99 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
100 | this.ClientSize = new System.Drawing.Size(810, 497);
101 | this.Controls.Add(this.panelRight);
102 | this.Controls.Add(this.tvList);
103 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
104 | this.Name = "frmSystemSetting";
105 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
106 | this.Text = "系统设置";
107 | this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmSystemSetting_FormClosing);
108 | this.ResumeLayout(false);
109 |
110 | }
111 |
112 | #endregion
113 |
114 | private System.Windows.Forms.TreeView tvList;
115 | private System.Windows.Forms.Panel panelRight;
116 |
117 |
118 | }
119 | }
--------------------------------------------------------------------------------
/CRM/SystemSetting/frmSystemSetting.cs:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------
2 | Copyright (C) 2014 宏图会员管理系统(Grant 巩建春)
3 |
4 | 项目名称: 宏图会员管理系统
5 | 创建者: grant (巩建春 emaill : nnn987@126.com ; QQ:406333743;Tel:+86 15619212255)
6 | CLR版本: 4.0.30319.42000
7 | 时间: 2014/8/28 18:16:22
8 |
9 | 功能描述:本软件为本人业余时间所写,其所有源码都可以进行免费的学习交流,切勿用于商业用途
10 |
11 | ----------------------------------------------------------------*/
12 | using System;
13 | using System.Collections.Generic;
14 | using System.ComponentModel;
15 | using System.Data;
16 | using System.Drawing;
17 | using System.Linq;
18 | using System.Text;
19 | using System.Windows.Forms;
20 |
21 | namespace CRM
22 | {
23 | public partial class frmSystemSetting : skinBase
24 | {
25 | public frmSystemSetting()
26 | {
27 | InitializeComponent();
28 | tvList.SelectedNode = tvList.Nodes[0];
29 | }
30 |
31 | public frmSystemSetting(string txt)
32 | {
33 | InitializeComponent();
34 | foreach (TreeNode node in tvList.Nodes)
35 | {
36 | if(node.Text==txt)
37 | {
38 | tvList.SelectedNode = node;
39 | break;
40 | }
41 | }
42 | }
43 |
44 | private void tvList_AfterSelect(object sender, TreeViewEventArgs e)
45 | {
46 | TreeNode node = tvList.SelectedNode;
47 | if (node == null) return;
48 | Control cnt = null;
49 | switch (node.Text)
50 | {
51 | case "管理员角色管理":
52 | cnt = new UCRoleSetting();
53 | break;
54 | case "上下班时间":
55 | cnt = new UcWorkTime();
56 | break;
57 | case "数据备份与还原":
58 | cnt = new UCBackAndReBack();
59 | break;
60 | case "会员类型设置":
61 | cnt =new UCUserTypeAndEmployeeMgr(1);
62 | break;
63 | case "员工类型设置":
64 | cnt = new UCUserTypeAndEmployeeMgr(2);
65 | break;
66 | case "企业信息设置":
67 | cnt = new UCCompanyInfo();
68 | break;
69 | case "其他设置":
70 | cnt = new UCOtherSetting();
71 | break;
72 | default:
73 | break;
74 | }
75 | if (cnt == null) return;
76 | panelRight.Controls.Clear();
77 | cnt.Dock = DockStyle.Fill;
78 | cnt.BringToFront();
79 | panelRight.Controls.Add(cnt);
80 | }
81 |
82 | private void frmSystemSetting_FormClosing(object sender, FormClosingEventArgs e)
83 | {
84 | this.DialogResult = DialogResult.OK;
85 | }
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/CRM/UCUserInfo.Designer.cs:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------
2 | Copyright (C) 2014 宏图会员管理系统(Grant 巩建春)
3 |
4 | 项目名称: 宏图会员管理系统
5 | 创建者: grant (巩建春 emaill : nnn987@126.com ; QQ:406333743;Tel:+86 15619212255)
6 | CLR版本: 4.0.30319.42000
7 | 时间: 2014/8/28 18:16:22
8 |
9 | 功能描述:本软件为本人业余时间所写,其所有源码都可以进行免费的学习交流,切勿用于商业用途
10 |
11 | ----------------------------------------------------------------*/
12 | namespace CRM
13 | {
14 | partial class UCUserInfo
15 | {
16 | ///
17 | /// Required designer variable.
18 | ///
19 | private System.ComponentModel.IContainer components = null;
20 |
21 | ///
22 | /// Clean up any resources being used.
23 | ///
24 | /// true if managed resources should be disposed; otherwise, false.
25 | protected override void Dispose(bool disposing)
26 | {
27 | if (disposing && (components != null))
28 | {
29 | components.Dispose();
30 | }
31 | base.Dispose(disposing);
32 | }
33 |
34 | #region Windows Form Designer generated code
35 |
36 | ///
37 | /// Required method for Designer support - do not modify
38 | /// the contents of this method with the code editor.
39 | ///
40 | private void InitializeComponent()
41 | {
42 | this.label1 = new System.Windows.Forms.Label();
43 | this.txtUserName = new System.Windows.Forms.TextBox();
44 | this.label2 = new System.Windows.Forms.Label();
45 | this.txtCardId = new System.Windows.Forms.TextBox();
46 | this.label3 = new System.Windows.Forms.Label();
47 | this.txtTel = new System.Windows.Forms.TextBox();
48 | this.SuspendLayout();
49 | //
50 | // label1
51 | //
52 | this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
53 | | System.Windows.Forms.AnchorStyles.Right)));
54 | this.label1.AutoSize = true;
55 | this.label1.Location = new System.Drawing.Point(34, 20);
56 | this.label1.Name = "label1";
57 | this.label1.Size = new System.Drawing.Size(47, 12);
58 | this.label1.TabIndex = 0;
59 | this.label1.Text = "姓 名";
60 | //
61 | // txtUserName
62 | //
63 | this.txtUserName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
64 | | System.Windows.Forms.AnchorStyles.Right)));
65 | this.txtUserName.Location = new System.Drawing.Point(83, 17);
66 | this.txtUserName.Name = "txtUserName";
67 | this.txtUserName.Size = new System.Drawing.Size(154, 21);
68 | this.txtUserName.TabIndex = 1;
69 | //
70 | // label2
71 | //
72 | this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
73 | | System.Windows.Forms.AnchorStyles.Right)));
74 | this.label2.AutoSize = true;
75 | this.label2.Location = new System.Drawing.Point(33, 59);
76 | this.label2.Name = "label2";
77 | this.label2.Size = new System.Drawing.Size(47, 12);
78 | this.label2.TabIndex = 0;
79 | this.label2.Text = "卡 号";
80 | //
81 | // txtCardId
82 | //
83 | this.txtCardId.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
84 | | System.Windows.Forms.AnchorStyles.Right)));
85 | this.txtCardId.Location = new System.Drawing.Point(83, 55);
86 | this.txtCardId.Name = "txtCardId";
87 | this.txtCardId.Size = new System.Drawing.Size(154, 21);
88 | this.txtCardId.TabIndex = 1;
89 | //
90 | // label3
91 | //
92 | this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
93 | | System.Windows.Forms.AnchorStyles.Right)));
94 | this.label3.AutoSize = true;
95 | this.label3.Location = new System.Drawing.Point(27, 96);
96 | this.label3.Name = "label3";
97 | this.label3.Size = new System.Drawing.Size(53, 12);
98 | this.label3.TabIndex = 0;
99 | this.label3.Text = "手机号码";
100 | //
101 | // txtTel
102 | //
103 | this.txtTel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
104 | | System.Windows.Forms.AnchorStyles.Right)));
105 | this.txtTel.Location = new System.Drawing.Point(83, 93);
106 | this.txtTel.Name = "txtTel";
107 | this.txtTel.Size = new System.Drawing.Size(154, 21);
108 | this.txtTel.TabIndex = 1;
109 | //
110 | // UCUserInfo
111 | //
112 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
113 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
114 | this.Controls.Add(this.txtTel);
115 | this.Controls.Add(this.label3);
116 | this.Controls.Add(this.txtCardId);
117 | this.Controls.Add(this.label2);
118 | this.Controls.Add(this.txtUserName);
119 | this.Controls.Add(this.label1);
120 | this.Name = "UCUserInfo";
121 | this.Size = new System.Drawing.Size(276, 130);
122 | this.ResumeLayout(false);
123 | this.PerformLayout();
124 |
125 | }
126 |
127 | #endregion
128 |
129 | private System.Windows.Forms.Label label1;
130 | private System.Windows.Forms.TextBox txtUserName;
131 | private System.Windows.Forms.Label label2;
132 | private System.Windows.Forms.Label label3;
133 | private System.Windows.Forms.TextBox txtTel;
134 | private System.Windows.Forms.TextBox txtCardId;
135 | }
136 | }
--------------------------------------------------------------------------------
/CRM/UCUserInfo.cs:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------
2 | Copyright (C) 2014 宏图会员管理系统(Grant 巩建春)
3 |
4 | 项目名称: 宏图会员管理系统
5 | 创建者: grant (巩建春 emaill : nnn987@126.com ; QQ:406333743;Tel:+86 15619212255)
6 | CLR版本: 4.0.30319.42000
7 | 时间: 2014/8/28 18:16:22
8 |
9 | 功能描述:本软件为本人业余时间所写,其所有源码都可以进行免费的学习交流,切勿用于商业用途
10 |
11 | ----------------------------------------------------------------*/
12 | using System;
13 | using System.Collections.Generic;
14 | using System.ComponentModel;
15 | using System.Data;
16 | using System.Drawing;
17 | using System.Linq;
18 | using System.Text;
19 | using System.Windows.Forms;
20 | using Tools;
21 |
22 | namespace CRM
23 | {
24 | public partial class UCUserInfo : UserControl
25 | {
26 | public DataRow Row;
27 | public UCUserInfo()
28 | {
29 | InitializeComponent();
30 | CommStatic.TxtBoxCardId = txtCardId;
31 | txtUserName.Focus();
32 | }
33 |
34 | public void btnOk_Click(object sender, EventArgs e)
35 | {
36 | try
37 | {
38 | string userName = txtUserName.Text;
39 | string cardId = txtCardId.Text;
40 | string tel = txtTel.Text;
41 | Row = null;//清掉上一次
42 | if (string.IsNullOrEmpty(userName) && string.IsNullOrEmpty(cardId) && string.IsNullOrEmpty(tel))
43 | {
44 | MessageBox.Show("请至少输入一项信息!");
45 | return;
46 | }
47 | string sql = "select * from User where 1=1 ";
48 | if (!string.IsNullOrEmpty(userName))
49 | sql += " and UserName='" + userName + "'";
50 | if (!string.IsNullOrEmpty(cardId))
51 | sql += " and VipCardId='" + cardId + "'";
52 | if (!string.IsNullOrEmpty(tel))
53 | sql += " and Tel='" + tel + "'";
54 | DataSet ds = DBHelper.ExecuteDataSet(sql);
55 | if (ds == null || ds.Tables[0].Rows.Count < 1)
56 | {
57 | MessageBox.Show("没有找到和输入信息完全匹配的用户,请再次核对输入信息");
58 | return;
59 | }
60 | Row = ds.Tables[0].Rows[0];
61 | }
62 | catch (Exception ex)
63 | {
64 | TracingHelper.Error(ex, typeof(UCUserInfo));
65 | MessageBox.Show(ex.Message);
66 | }
67 | }
68 |
69 | private void btnCancle_Click(object sender, EventArgs e)
70 | {
71 | txtCardId.Text = "";
72 | txtTel.Text = "";
73 | txtUserName.Text = "";
74 | }
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/CRM/UCUserInfo.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 |
--------------------------------------------------------------------------------
/CRM/frmCardMgr.cs:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------
2 | Copyright (C) 2014 宏图会员管理系统(Grant 巩建春)
3 |
4 | 项目名称: 宏图会员管理系统
5 | 创建者: grant (巩建春 emaill : nnn987@126.com ; QQ:406333743;Tel:+86 15619212255)
6 | CLR版本: 4.0.30319.42000
7 | 时间: 2014/8/28 18:16:22
8 |
9 | 功能描述:本软件为本人业余时间所写,其所有源码都可以进行免费的学习交流,切勿用于商业用途
10 |
11 | ----------------------------------------------------------------*/
12 | using System;
13 | using System.Collections.Generic;
14 | using System.ComponentModel;
15 | using System.Data;
16 | using System.Drawing;
17 | using System.Linq;
18 | using System.Text;
19 | using System.Windows.Forms;
20 | using System.IO;
21 |
22 | using Tools;
23 |
24 | namespace CRM
25 | {
26 | public partial class frmCardMgr : skinBase
27 | {
28 | private DataTable dtOrg;
29 | public frmCardMgr()
30 | {
31 | InitializeComponent();
32 | dgvCardList.AutoGenerateColumns = false;
33 | InitList();
34 | CommStatic.TxtBoxCardId = txtCardId;
35 | txtCardId.Focus();
36 | }
37 |
38 | private void btnSelect_Click(object sender, EventArgs e)
39 | {
40 | openFileDialog1.Filter = "文本文件(*.txt)|*.txt";
41 | if (openFileDialog1.ShowDialog() == DialogResult.OK)
42 | {
43 | txtFilePath.Text = openFileDialog1.FileName;
44 | }
45 | }
46 |
47 | private void btnImport_Click(object sender, EventArgs e)
48 | {
49 | try
50 | {
51 | if (txtFilePath.Text == "" || !File.Exists(txtFilePath.Text))
52 | {
53 | MessageBox.Show("所选择的路径不存在,请选择正确的文件路径");
54 | return;
55 | }
56 | string lineData;
57 | StringBuilder sb = new StringBuilder();
58 | using (StreamReader reader = new StreamReader(txtFilePath.Text, Encoding.UTF8))
59 | {
60 | lineData = reader.ReadLine();
61 | string[] col;
62 | string sql;
63 | while (!string.IsNullOrEmpty(lineData))
64 | {
65 | string clearTxt = Tools.Tools.Decrypt(lineData);//解除明文
66 | col = clearTxt.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
67 | if (col.Length != 4)
68 | {
69 | sb.Append("------(非法数据)");
70 | goto gotoHere;//跳过
71 | }
72 | sql = "select * from Card where CardID=@CardID";
73 | DataSet ds = DBHelper.ExecuteDataSet(sql, new string[] { "@CardID" }, new object[] { col[0] });
74 | if (ds != null && ds.Tables[0].Rows.Count > 0)
75 | {
76 | sb.AppendLine(lineData + "------(卡已经存在)");
77 | goto gotoHere;
78 | }
79 | sql = "Insert into Card(ID,CardId,Status,Key,CreateTime,Org)values(@ID,@CardId,@Status,@Key,@CreateTime,@Org)";
80 | string[] prm = new string[] { "@ID", "@CardId", "@Status", "@Key", "@CreateTime", "@Org" };
81 | object[] obj = new object[] { Guid.NewGuid().ToString("N"), col[0], col[1], col[2], DateTime.Parse(col[3]), lineData };
82 | if (DBHelper.ExecuteNonQuery(sql, prm, obj) < 1)
83 | sb.AppendLine(lineData + "------(插入数据失败)");
84 | gotoHere:
85 | lineData = reader.ReadLine();
86 | }
87 | }
88 | if (sb.Length > 0)
89 | {
90 | Tools.TracingHelper.Error("有如下卡号导入失败:" + sb.ToString());
91 | MessageBox.Show("有部分卡号导入失败,详情见日志!");
92 | }
93 | else
94 | {
95 | MessageBox.Show("卡号导入成功!");
96 | }
97 | InitList();
98 | CommStatic.FrmMain.InitSystemInfo();
99 | }
100 | catch (Exception ex)
101 | {
102 | TracingHelper.Error(ex, typeof(frmCardMgr));
103 | }
104 | }
105 |
106 | private void InitList()
107 | {
108 | try
109 | {
110 | DataSet ds = DBHelper.ExecuteDataSet("select Id,CardId,(case status when 1 then '未使用' when 2 then '已使用' end) as status,CreateTime from Card order by CreateTime desc", null, null);
111 | if (ds == null || ds.Tables[0].Rows.Count < 1) return;
112 | dtOrg = ds.Tables[0];
113 | dgvCardList.DataSource = dtOrg;
114 | }
115 | catch (Exception ex)
116 | {
117 | TracingHelper.Error(ex, typeof(frmCardMgr));
118 | }
119 |
120 | }
121 |
122 | private void btnQuery_Click(object sender, EventArgs e)
123 | {
124 | try
125 | {
126 | if (txtCardId.Text == "" && cmbxStatus.Text == "")
127 | {
128 | InitList();
129 | return;
130 | }
131 | if (dtOrg == null || dtOrg.Rows.Count < 1)
132 | return;
133 | DataRow[] rows = dtOrg.Select("1=1" + (txtCardId.Text.Trim() == "" ? "" : (" and CardID like'%" + txtCardId.Text.Trim() + "%'")) + (cmbxStatus.Text == "" ? "" : (" and status='" + cmbxStatus.Text + "'")));
134 | DataTable temp = dtOrg.Clone();
135 | foreach (DataRow row in rows)
136 | {
137 | DataRow dr = temp.NewRow();
138 | dr.ItemArray = row.ItemArray;
139 | temp.Rows.Add(dr);
140 | }
141 | dgvCardList.DataSource = temp;
142 | }
143 | catch (Exception ex)
144 | {
145 | TracingHelper.Error(ex, typeof(frmCardMgr));
146 | }
147 | }
148 |
149 | private void frmCardMgr_FormClosing(object sender, FormClosingEventArgs e)
150 | {
151 | CommStatic.TxtBoxCardId = null;
152 | }
153 | }
154 | }
155 |
--------------------------------------------------------------------------------
/CRM/frmCloseAccount.Designer.cs:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------
2 | Copyright (C) 2014 宏图会员管理系统(Grant 巩建春)
3 |
4 | 项目名称: 宏图会员管理系统
5 | 创建者: grant (巩建春 emaill : nnn987@126.com ; QQ:406333743;Tel:+86 15619212255)
6 | CLR版本: 4.0.30319.42000
7 | 时间: 2014/8/28 18:16:22
8 |
9 | 功能描述:本软件为本人业余时间所写,其所有源码都可以进行免费的学习交流,切勿用于商业用途
10 |
11 | ----------------------------------------------------------------*/
12 | namespace CRM
13 | {
14 | partial class frmCloseAccount
15 | {
16 | ///
17 | /// Required designer variable.
18 | ///
19 | private System.ComponentModel.IContainer components = null;
20 |
21 | ///
22 | /// Clean up any resources being used.
23 | ///
24 | /// true if managed resources should be disposed; otherwise, false.
25 | protected override void Dispose(bool disposing)
26 | {
27 | if (disposing && (components != null))
28 | {
29 | components.Dispose();
30 | }
31 | base.Dispose(disposing);
32 | }
33 |
34 | #region Windows Form Designer generated code
35 |
36 | ///
37 | /// Required method for Designer support - do not modify
38 | /// the contents of this method with the code editor.
39 | ///
40 | private void InitializeComponent()
41 | {
42 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmCloseAccount));
43 | this.panel1 = new System.Windows.Forms.Panel();
44 | this.btncancel = new System.Windows.Forms.Button();
45 | this.btnOk = new System.Windows.Forms.Button();
46 | this.ucUserInfo1 = new CRM.UCUserInfo();
47 | this.panel1.SuspendLayout();
48 | this.SuspendLayout();
49 | //
50 | // panel1
51 | //
52 | this.panel1.Controls.Add(this.btncancel);
53 | this.panel1.Controls.Add(this.btnOk);
54 | this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
55 | this.panel1.Location = new System.Drawing.Point(0, 132);
56 | this.panel1.Name = "panel1";
57 | this.panel1.Size = new System.Drawing.Size(266, 65);
58 | this.panel1.TabIndex = 1;
59 | //
60 | // btncancel
61 | //
62 | this.btncancel.Location = new System.Drawing.Point(164, 11);
63 | this.btncancel.Name = "btncancel";
64 | this.btncancel.Size = new System.Drawing.Size(75, 23);
65 | this.btncancel.TabIndex = 0;
66 | this.btncancel.Text = "清空";
67 | this.btncancel.UseVisualStyleBackColor = true;
68 | this.btncancel.Click += new System.EventHandler(this.btncancel_Click);
69 | //
70 | // btnOk
71 | //
72 | this.btnOk.Location = new System.Drawing.Point(28, 10);
73 | this.btnOk.Name = "btnOk";
74 | this.btnOk.Size = new System.Drawing.Size(75, 23);
75 | this.btnOk.TabIndex = 0;
76 | this.btnOk.Text = "查找";
77 | this.btnOk.UseVisualStyleBackColor = true;
78 | this.btnOk.Click += new System.EventHandler(this.btnOk_Click);
79 | //
80 | // ucUserInfo1
81 | //
82 | this.ucUserInfo1.Dock = System.Windows.Forms.DockStyle.Fill;
83 | this.ucUserInfo1.Location = new System.Drawing.Point(0, 0);
84 | this.ucUserInfo1.Name = "ucUserInfo1";
85 | this.ucUserInfo1.Size = new System.Drawing.Size(266, 132);
86 | this.ucUserInfo1.TabIndex = 0;
87 | //
88 | // frmCloseAccount
89 | //
90 | this.AcceptButton = this.btnOk;
91 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
92 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
93 | this.ClientSize = new System.Drawing.Size(266, 197);
94 | this.Controls.Add(this.ucUserInfo1);
95 | this.Controls.Add(this.panel1);
96 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
97 | this.MaximizeBox = false;
98 | this.MinimizeBox = false;
99 | this.Name = "frmCloseAccount";
100 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
101 | this.Text = "手工结账";
102 | this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmCloseAccount_FormClosing);
103 | this.panel1.ResumeLayout(false);
104 | this.ResumeLayout(false);
105 |
106 | }
107 |
108 | #endregion
109 |
110 | private UCUserInfo ucUserInfo1;
111 | private System.Windows.Forms.Panel panel1;
112 | private System.Windows.Forms.Button btncancel;
113 | private System.Windows.Forms.Button btnOk;
114 | }
115 | }
--------------------------------------------------------------------------------
/CRM/frmCloseAccount.cs:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------
2 | Copyright (C) 2014 宏图会员管理系统(Grant 巩建春)
3 |
4 | 项目名称: 宏图会员管理系统
5 | 创建者: grant (巩建春 emaill : nnn987@126.com ; QQ:406333743;Tel:+86 15619212255)
6 | CLR版本: 4.0.30319.42000
7 | 时间: 2014/8/28 18:16:22
8 |
9 | 功能描述:本软件为本人业余时间所写,其所有源码都可以进行免费的学习交流,切勿用于商业用途
10 |
11 | ----------------------------------------------------------------*/
12 | using System;
13 | using System.Collections.Generic;
14 | using System.ComponentModel;
15 | using System.Data;
16 | using System.Drawing;
17 | using System.Linq;
18 | using System.Text;
19 | using System.Windows.Forms;
20 |
21 | namespace CRM
22 | {
23 | public partial class frmCloseAccount : skinBase
24 | {
25 | ///
26 | /// 在这里必须保证是用户sn,而不是员工
27 | ///
28 | public uint sn;
29 | public frmCloseAccount()
30 | {
31 | InitializeComponent();
32 | }
33 |
34 | private void btnOk_Click(object sender, EventArgs e)
35 | {
36 | ucUserInfo1.btnOk_Click(sender, e);
37 | DataRow row = ucUserInfo1.Row;
38 | if (row == null) return;
39 | if (row["VipCardId"] == null || row["VipCardId"].ToString() == "")
40 | {
41 | MessageBox.Show("用户信息不完整,无法进行结账");
42 | return;
43 | }
44 | sn = uint.Parse(row["VipCardId"].ToString());
45 | this.DialogResult = DialogResult.OK;
46 | }
47 |
48 | private void btncancel_Click(object sender, EventArgs e)
49 | {
50 | this.Close();
51 | }
52 |
53 | private void frmCloseAccount_FormClosing(object sender, FormClosingEventArgs e)
54 | {
55 | CommStatic.TxtBoxCardId = null;
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/CRM/frmConsumeDetail.cs:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------
2 | Copyright (C) 2014 宏图会员管理系统(Grant 巩建春)
3 |
4 | 项目名称: 宏图会员管理系统
5 | 创建者: grant (巩建春 emaill : nnn987@126.com ; QQ:406333743;Tel:+86 15619212255)
6 | CLR版本: 4.0.30319.42000
7 | 时间: 2014/8/28 18:16:22
8 |
9 | 功能描述:本软件为本人业余时间所写,其所有源码都可以进行免费的学习交流,切勿用于商业用途
10 |
11 | ----------------------------------------------------------------*/
12 | using System;
13 | using System.Collections.Generic;
14 | using System.ComponentModel;
15 | using System.Data;
16 | using System.Drawing;
17 | using System.Linq;
18 | using System.Text;
19 | using System.Windows.Forms;
20 | using Tools;
21 |
22 | namespace CRM
23 | {
24 | public partial class frmConsumeDetail : skinBase
25 | {
26 | private DataRow row;
27 | public frmConsumeDetail()
28 | {
29 | InitializeComponent();
30 | }
31 |
32 | public frmConsumeDetail(DataRow dr)
33 | {
34 | InitializeComponent();
35 | txtUserName.Focus();
36 | try
37 | {
38 | this.row = dr;
39 | txtCardId.Text = row["CardId"] == null ? "" : row["CardId"].ToString();
40 | txtCurrTime.Text = row["ConsumeTime"] == null ? "" : row["ConsumeTime"].ToString();
41 | txtMoney.Text = row["ConsumeMoney"] == null ? "" : row["ConsumeMoney"].ToString();
42 | txtNum.Text = row["BillID"] == null ? "" : row["BillID"].ToString();
43 | txtUserName.Text = row["UserName"] == null ? "" : row["UserName"].ToString();
44 | txtUserType.Text = row["UserType"] == null ? "" : row["UserType"].ToString();
45 | dgvList.AutoGenerateColumns = false;
46 | InItList();
47 | }
48 | catch (Exception ex)
49 | {
50 | TracingHelper.Error(ex, typeof(frmConsumeDetail));
51 | }
52 |
53 | }
54 | public void InItList()
55 | {
56 | try
57 | {
58 | string sql = "select * from ConsumeHistory where ConsumeBillId='" + row["BillID"].ToString() + "'";
59 | DataSet ds = DBHelper.ExecuteDataSet(sql);
60 | DataTable dt = null;
61 | if (ds != null && ds.Tables[0].Rows.Count > 0)
62 | dt = ds.Tables[0];
63 | dgvList.DataSource = dt;
64 | }
65 | catch (Exception ex)
66 | {
67 | TracingHelper.Error(ex, typeof(frmConsumeDetail));
68 | }
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/CRM/frmContact.cs:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------
2 | Copyright (C) 2014 宏图会员管理系统(Grant 巩建春)
3 |
4 | 项目名称: 宏图会员管理系统
5 | 创建者: grant (巩建春 emaill : nnn987@126.com ; QQ:406333743;Tel:+86 15619212255)
6 | CLR版本: 4.0.30319.42000
7 | 时间: 2014/8/28 18:16:22
8 |
9 | 功能描述:本软件为本人业余时间所写,其所有源码都可以进行免费的学习交流,切勿用于商业用途
10 |
11 | ----------------------------------------------------------------*/
12 | using System;
13 | using System.Collections.Generic;
14 | using System.ComponentModel;
15 | using System.Data;
16 | using System.Drawing;
17 | using System.Linq;
18 | using System.Text;
19 | using System.Windows.Forms;
20 |
21 | namespace CRM
22 | {
23 | public partial class frmContact : skinBase
24 | {
25 | public frmContact()
26 | {
27 | InitializeComponent();
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/CRM/frmIsRun.Designer.cs:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------
2 | Copyright (C) 2014 宏图会员管理系统(Grant 巩建春)
3 |
4 | 项目名称: 宏图会员管理系统
5 | 创建者: grant (巩建春 emaill : nnn987@126.com ; QQ:406333743;Tel:+86 15619212255)
6 | CLR版本: 4.0.30319.42000
7 | 时间: 2014/8/28 18:16:22
8 |
9 | 功能描述:本软件为本人业余时间所写,其所有源码都可以进行免费的学习交流,切勿用于商业用途
10 |
11 | ----------------------------------------------------------------*/
12 | namespace CRM
13 | {
14 | partial class frmIsRun
15 | {
16 | ///
17 | /// Required designer variable.
18 | ///
19 | private System.ComponentModel.IContainer components = null;
20 |
21 | ///
22 | /// Clean up any resources being used.
23 | ///
24 | /// true if managed resources should be disposed; otherwise, false.
25 | protected override void Dispose(bool disposing)
26 | {
27 | if (disposing && (components != null))
28 | {
29 | components.Dispose();
30 | }
31 | base.Dispose(disposing);
32 | }
33 |
34 | #region Windows Form Designer generated code
35 |
36 | ///
37 | /// Required method for Designer support - do not modify
38 | /// the contents of this method with the code editor.
39 | ///
40 | private void InitializeComponent()
41 | {
42 | this.components = new System.ComponentModel.Container();
43 | this.label1 = new System.Windows.Forms.Label();
44 | this.btnOk = new System.Windows.Forms.Button();
45 | this.timer1 = new System.Windows.Forms.Timer(this.components);
46 | this.SuspendLayout();
47 | //
48 | // label1
49 | //
50 | this.label1.AutoSize = true;
51 | this.label1.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
52 | this.label1.ForeColor = System.Drawing.Color.Red;
53 | this.label1.Location = new System.Drawing.Point(11, 27);
54 | this.label1.Name = "label1";
55 | this.label1.Size = new System.Drawing.Size(285, 42);
56 | this.label1.TabIndex = 0;
57 | this.label1.Text = "程序已经运行,请在桌面右下角任务栏查看\r\n\r\n双击或者刷卡图标可激活主界面";
58 | this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
59 | //
60 | // btnOk
61 | //
62 | this.btnOk.Location = new System.Drawing.Point(115, 91);
63 | this.btnOk.Name = "btnOk";
64 | this.btnOk.Size = new System.Drawing.Size(75, 23);
65 | this.btnOk.TabIndex = 1;
66 | this.btnOk.Text = "确定";
67 | this.btnOk.UseVisualStyleBackColor = true;
68 | this.btnOk.Click += new System.EventHandler(this.btnOk_Click);
69 | //
70 | // timer1
71 | //
72 | this.timer1.Interval = 3000;
73 | this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
74 | //
75 | // frmIsRun
76 | //
77 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
78 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
79 | this.ClientSize = new System.Drawing.Size(315, 146);
80 | this.Controls.Add(this.btnOk);
81 | this.Controls.Add(this.label1);
82 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
83 | this.MaximizeBox = false;
84 | this.MinimizeBox = false;
85 | this.Name = "frmIsRun";
86 | this.ShowIcon = false;
87 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
88 | this.Text = "提示";
89 | this.ResumeLayout(false);
90 | this.PerformLayout();
91 |
92 | }
93 |
94 | #endregion
95 |
96 | private System.Windows.Forms.Label label1;
97 | private System.Windows.Forms.Button btnOk;
98 | private System.Windows.Forms.Timer timer1;
99 | }
100 | }
--------------------------------------------------------------------------------
/CRM/frmIsRun.cs:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------
2 | Copyright (C) 2014 宏图会员管理系统(Grant 巩建春)
3 |
4 | 项目名称: 宏图会员管理系统
5 | 创建者: grant (巩建春 emaill : nnn987@126.com ; QQ:406333743;Tel:+86 15619212255)
6 | CLR版本: 4.0.30319.42000
7 | 时间: 2014/8/28 18:16:22
8 |
9 | 功能描述:本软件为本人业余时间所写,其所有源码都可以进行免费的学习交流,切勿用于商业用途
10 |
11 | ----------------------------------------------------------------*/
12 | using System;
13 | using System.Collections.Generic;
14 | using System.ComponentModel;
15 | using System.Data;
16 | using System.Drawing;
17 | using System.Linq;
18 | using System.Text;
19 | using System.Windows.Forms;
20 |
21 | namespace CRM
22 | {
23 | public partial class frmIsRun : skinBase
24 | {
25 | public frmIsRun()
26 | {
27 | InitializeComponent();
28 | timer1.Start();
29 | }
30 |
31 | private void timer1_Tick(object sender, EventArgs e)
32 | {
33 | timer1.Stop();
34 | Environment.Exit(0);
35 | }
36 |
37 | private void btnOk_Click(object sender, EventArgs e)
38 | {
39 | timer1_Tick(sender, e);
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/CRM/frmIsRun.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 |
121 | 17, 17
122 |
123 |
--------------------------------------------------------------------------------
/CRM/frmLogin.cs:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------
2 | Copyright (C) 2014 宏图会员管理系统(Grant 巩建春)
3 |
4 | 项目名称: 宏图会员管理系统
5 | 创建者: grant (巩建春 emaill : nnn987@126.com ; QQ:406333743;Tel:+86 15619212255)
6 | CLR版本: 4.0.30319.42000
7 | 时间: 2014/8/28 18:16:22
8 |
9 | 功能描述:本软件为本人业余时间所写,其所有源码都可以进行免费的学习交流,切勿用于商业用途
10 |
11 | ----------------------------------------------------------------*/
12 | using System;
13 | using System.Collections.Generic;
14 | using System.ComponentModel;
15 | using System.Data;
16 | using System.Drawing;
17 | using System.Text;
18 | using System.Windows.Forms;
19 | using Tools;
20 |
21 | namespace CRM
22 | {
23 | public partial class frmLogin : skinBase
24 | {
25 | public frmLogin()
26 | {
27 | InitializeComponent();
28 | this.lblLockMsg.Visible = false;
29 | txtUserName.Focus();
30 | }
31 |
32 | public frmLogin(bool _isLock)
33 | {
34 | InitializeComponent();
35 | CommStatic.MyCache.Login.isLock = _isLock;
36 | this.lblLockMsg.Visible = true;
37 | }
38 |
39 | private void btnCancel_Click(object sender, EventArgs e)
40 | {
41 | txtPwd.Text = "";
42 | txtUserName.Text = "";
43 |
44 | }
45 |
46 | private void btnLogin_Click(object sender, EventArgs e)
47 | {
48 | try
49 | {
50 | string userName = txtUserName.Text;
51 | if (string.IsNullOrEmpty(userName))
52 | {
53 | MessageBox.Show("请输入登陆账号!");
54 | return;
55 | }
56 | string pwd = txtPwd.Text;
57 | if (string.IsNullOrEmpty(pwd))
58 | {
59 | MessageBox.Show("请输入登陆密码!");
60 | return;
61 | }
62 | if (CommStatic.MyCache != null && CommStatic.MyCache.Login != null && CommStatic.MyCache.Login.isLock)
63 | {
64 | if (userName == CommStatic.MyCache.Login.LoginName)
65 | {
66 | if (Tools.Tools.GetMD5(pwd) == CommStatic.MyCache.Login.Pwd)
67 | {
68 | this.DialogResult = DialogResult.OK;
69 | CommStatic.MyCache.Login.isLock = false;
70 | this.Close();
71 | }
72 | else
73 | {
74 | MessageBox.Show("密码错误,请重新输入");
75 | return;
76 | }
77 | }
78 | else
79 | {
80 | MessageBox.Show("解锁屏账户必须跟登陆账户一致,请输入锁屏前的登陆账户解锁!");
81 | return;
82 | }
83 | }
84 | string sql = "select * from Admin where LoginName=@LoginName";
85 | DataSet ds = DBHelper.ExecuteDataSet(sql, new string[] { "@LoginName" }, new object[] { userName });
86 | if (ds == null || ds.Tables[0].Rows.Count < 1)
87 | {
88 | MessageBox.Show("用户不存在,请重新输入!");
89 | return;
90 | }
91 | DataRow row = ds.Tables[0].Rows[0];
92 | if (row["LoginPwd"].ToString() != Tools.Tools.GetMD5(pwd))
93 | {
94 | MessageBox.Show("密码输入错误,请重新输入正确的密码!");
95 | return;
96 | }
97 | //构造登陆信息
98 |
99 | CommStatic.MyCache.Login = new LoginAdmin() { AdminName = row["AdminName"].ToString(), Id = row["ID"].ToString(), LoginName = row["LoginName"].ToString(), Pwd = row["LoginPwd"].ToString() };
100 | sql = "select Id, Name,RoleList from AdminRole where Id='" + row["Rights"].ToString() + "'";
101 | ds = DBHelper.ExecuteDataSet(sql);
102 | if (ds != null && ds.Tables[0].Rows.Count > 0)
103 | {
104 | row = ds.Tables[0].Rows[0];
105 | CommStatic.MyCache.Login.RightsName = row["Name"] == null ? "" : row["Name"].ToString();
106 | CommStatic.MyCache.Login.Caps = row["RoleList"] == null ? null : row["RoleList"].ToString().Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
107 | }
108 | ActionLog.Add(ActionName.Login, "登陆");//记录日志
109 | this.DialogResult = DialogResult.OK;
110 | this.Close();
111 | }
112 | catch (Exception ex)
113 | {
114 | TracingHelper.Error(ex, typeof(frmLogin));
115 | MessageBox.Show(ex.Message);
116 | }
117 | }
118 |
119 | private void frmLogin_FormClosing(object sender, FormClosingEventArgs e)
120 | {
121 | if (CommStatic.MyCache != null && CommStatic.MyCache.Login!=null&&CommStatic.MyCache.Login.isLock)
122 | {
123 | MessageBox.Show("请输入解锁账户和密码");
124 | e.Cancel = true;
125 | return;
126 | }
127 | }
128 | }
129 | }
130 |
--------------------------------------------------------------------------------
/CRM/frmRechargecs.cs:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------
2 | Copyright (C) 2014 宏图会员管理系统(Grant 巩建春)
3 |
4 | 项目名称: 宏图会员管理系统
5 | 创建者: grant (巩建春 emaill : nnn987@126.com ; QQ:406333743;Tel:+86 15619212255)
6 | CLR版本: 4.0.30319.42000
7 | 时间: 2014/8/28 18:16:22
8 |
9 | 功能描述:本软件为本人业余时间所写,其所有源码都可以进行免费的学习交流,切勿用于商业用途
10 |
11 | ----------------------------------------------------------------*/
12 | using System;
13 | using System.Collections.Generic;
14 | using System.ComponentModel;
15 | using System.Data;
16 | using System.Drawing;
17 | using System.Linq;
18 | using System.Text;
19 | using System.Windows.Forms;
20 | using Tools;
21 |
22 | namespace CRM
23 | {
24 | public partial class frmRechargecs : skinBase
25 | {
26 | private DataRow row;
27 | public uint sn;
28 | public frmRechargecs()
29 | {
30 | InitializeComponent();
31 | }
32 |
33 | private void btnQuery_Click(object sender, EventArgs e)
34 | {
35 | ucUserInfo1.btnOk_Click(sender, e);
36 | this.row = ucUserInfo1.Row;
37 | if (this.row == null)
38 | {
39 | clear();
40 | return;
41 | }
42 | txtCardId.Text = row["VipCardId"] == null ? "" : row["VipCardId"].ToString();
43 | txtCountMoney.Text = row["Money"] == null ? "" : row["Money"].ToString();
44 | txtSex.Text = (row["Sex"] == null ? "" : row["Sex"].ToString())=="1"?"男":"女";
45 | txtStatus.Text = (row["Active"] == null ? "" : row["Active"].ToString()) == "1" ? "启用" : "停用";
46 | txtTel.Text = row["Tel"] == null ? "" : row["Tel"].ToString();
47 | txtUserName.Text = row["UserName"] == null ? "" : row["UserName"].ToString();
48 | sn = uint.Parse(row["VipCardId"].ToString());
49 | }
50 |
51 | private void btnOk_Click(object sender, EventArgs e)
52 | {
53 | try
54 | {
55 | if (this.row == null)
56 | {
57 | MessageBox.Show("请先查找要充值的用户信息");
58 | return;
59 | }
60 | string money = txtReChargeMoney.Text;
61 | if (string.IsNullOrEmpty(money))
62 | {
63 | MessageBox.Show("请输入充值金额");
64 | return;
65 | }
66 | float m;
67 | if (!float.TryParse(money, out m))
68 | {
69 | MessageBox.Show("充值金额必须是半角数字,请重新输入");
70 | return;
71 | }
72 | string sql = "Update User set Money=" + (float.Parse(row["Money"].ToString()) + m) + " where Id='" + row["Id"].ToString() + "'";
73 | if (DBHelper.ExecuteNonQuery(sql) > 0)
74 | {
75 | btnQuery_Click(sender, e);
76 | txtReChargeMoney.Text = "";
77 | MessageBox.Show("充值成功!最新余额" + txtCountMoney.Text+"元");
78 | }
79 | }
80 | catch (Exception ex)
81 | {
82 | TracingHelper.Error(ex, typeof(frmRechargecs));
83 | MessageBox.Show(ex.Message);
84 | }
85 | }
86 |
87 | private void clear()
88 | {
89 | txtCardId.Text ="";
90 | txtCountMoney.Text ="";
91 | txtSex.Text ="";
92 | txtStatus.Text ="";
93 | txtTel.Text ="";
94 | txtUserName.Text ="";
95 | sn =0;
96 | }
97 |
98 | private void frmRechargecs_FormClosing(object sender, FormClosingEventArgs e)
99 | {
100 | this.DialogResult = DialogResult.OK;
101 | CommStatic.TxtBoxCardId = null;
102 | }
103 | }
104 | }
105 |
--------------------------------------------------------------------------------
/CRM/help.chm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/grantgonggithub/CRM/2f026027b97bae878004d3e0dfac3ac0c147569a/CRM/help.chm
--------------------------------------------------------------------------------
/CRM/ico128.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/grantgonggithub/CRM/2f026027b97bae878004d3e0dfac3ac0c147569a/CRM/ico128.ico
--------------------------------------------------------------------------------
/CRM/skinBase.cs:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------
2 | Copyright (C) 2014 宏图会员管理系统(Grant 巩建春)
3 |
4 | 项目名称: 宏图会员管理系统
5 | 创建者: grant (巩建春 emaill : nnn987@126.com ; QQ:406333743;Tel:+86 15619212255)
6 | CLR版本: 4.0.30319.42000
7 | 时间: 2014/8/28 18:16:22
8 |
9 | 功能描述:本软件为本人业余时间所写,其所有源码都可以进行免费的学习交流,切勿用于商业用途
10 |
11 | ----------------------------------------------------------------*/
12 | using System;
13 | using System.Collections.Generic;
14 | using System.Text;
15 | using System.Windows.Forms;
16 |
17 | namespace CRM
18 | {
19 | public class skinBase:Form
20 | {
21 | private Sunisoft.IrisSkin.SkinEngine skinEngine1;
22 |
23 | public skinBase()
24 | {
25 | InitializeComponent();
26 | }
27 |
28 | private void InitializeComponent()
29 | {
30 | this.skinEngine1 = new Sunisoft.IrisSkin.SkinEngine(((System.ComponentModel.Component)(this)));
31 | this.SuspendLayout();
32 | //
33 | // skinEngine1
34 | //
35 | this.skinEngine1.SerialNumber = "";
36 | this.skinEngine1.SkinFile =@"MP10.ssk";
37 | this.skinEngine1.SkinAllForm = true;
38 | //
39 | // skinBase
40 | //
41 | this.ClientSize = new System.Drawing.Size(284, 262);
42 | this.Name = "skinBase";
43 | this.ResumeLayout(false);
44 |
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/CRM/skinBase.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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | 17, 17
122 |
123 |
--------------------------------------------------------------------------------
/DBAcess/DBAccess.cs:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------
2 | Copyright (C) 2014 宏图会员管理系统(Grant 巩建春)
3 |
4 | 项目名称: 宏图会员管理系统
5 | 创建者: grant (巩建春 emaill : nnn987@126.com ; QQ:406333743;Tel:+86 15619212255)
6 | CLR版本: 4.0.30319.42000
7 | 时间: 2014/8/28 18:16:22
8 |
9 | 功能描述:本软件为本人业余时间所写,其所有源码都可以进行免费的学习交流,切勿用于商业用途
10 |
11 | ----------------------------------------------------------------*/
12 |
13 | using System;
14 | using System.Collections.Generic;
15 | using System.Linq;
16 | using System.Data;
17 | using System.Text;
18 |
19 | namespace DBAccess
20 | {
21 | public interface DBAccess
22 | {
23 | int ExecuteNonQuery(string cmdText,CommandType commandType,string[] paramsList,object[] values);
24 |
25 | DataSet ExecuteDataSet(string cmdText, CommandType commandType, string[] paramsList, object[] values);
26 |
27 | void PrepareCommand(IDbCommand cmd, IDbConnection conn, CommandType commandType, string cmdText, string[] paramsList, object[] values);
28 |
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/DBAcess/DBAcess.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 8.0.30703
7 | 2.0
8 | {25352743-08B4-48E6-92E1-0A58C0AD760E}
9 | Library
10 | Properties
11 | DBAcess
12 | DBAcess
13 | v4.0
14 | 512
15 |
16 |
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | pdbonly
27 | true
28 | bin\Release\
29 | TRACE
30 | prompt
31 | 4
32 |
33 |
34 |
35 | DLL\MySql.Data.dll
36 |
37 |
38 |
39 |
40 | DLL\System.Data.SQLite.dll
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
70 |
--------------------------------------------------------------------------------
/DBAcess/DBFactory.cs:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------
2 | Copyright (C) 2014 宏图会员管理系统(Grant 巩建春)
3 |
4 | 项目名称: 宏图会员管理系统
5 | 创建者: grant (巩建春 emaill : nnn987@126.com ; QQ:406333743;Tel:+86 15619212255)
6 | CLR版本: 4.0.30319.42000
7 | 时间: 2014/8/28 18:16:22
8 |
9 | 功能描述:本软件为本人业余时间所写,其所有源码都可以进行免费的学习交流,切勿用于商业用途
10 |
11 | ----------------------------------------------------------------*/
12 |
13 | using System;
14 | using System.Collections.Generic;
15 | using System.Linq;
16 | using System.Text;
17 | using System.Xml;
18 | using System.Data;
19 |
20 | namespace DBAccess
21 | {
22 | public class DBFactory
23 | {
24 | private static readonly Dictionary dbList = new Dictionary();
25 |
26 | ///
27 | /// 统一配置的时候用这个初始化
28 | ///
29 | ///
30 | public static void Initialization(string dbConfig)
31 | {
32 | try
33 | {
34 | if (string.IsNullOrEmpty(dbConfig)) throw new Exception("DataBase Item is Empty,Initialization Error");
35 | XmlDocument doc = new XmlDocument();
36 | doc.LoadXml(dbConfig);
37 | XmlNode database = doc.SelectSingleNode("DataBase/Site");
38 | if (database == null || database.ChildNodes.Count < 1) throw new Exception("DataBase Item is Empty,Initialization Error");
39 | Initialization(database);
40 | }
41 | catch (Exception ex)
42 | {
43 | throw new Exception("DBConfig.config error",ex);
44 | }
45 | }
46 | ///
47 | /// 本地Agent部署,需要用这个初始化
48 | ///
49 | public static void Initialization()
50 | {
51 | string path = AppDomain.CurrentDomain.BaseDirectory + "DBConfig.config";
52 | XmlDocument doc = new XmlDocument();
53 | doc.Load(path);
54 | XmlNode node = doc.SelectSingleNode("LocationConfig");
55 | Initialization(node.InnerXml);
56 | }
57 | ///
58 | /// Resource初始化需要用这个,设置当前site
59 | ///
60 | ///
61 | public static void Initialization(XmlNode site)
62 | {
63 | if (site == null || site.ChildNodes.Count < 1)
64 | {
65 | throw new Exception("site XmlNode error");
66 | }
67 | foreach (XmlNode node in site.ChildNodes)
68 | {
69 | XmlAttribute key = node.Attributes["key"];
70 | XmlAttribute connstr = node.Attributes["connectionString"];
71 | XmlAttribute dbType = node.Attributes["DBType"];
72 | if (key == null || string.IsNullOrEmpty(key.Value) ||
73 | connstr == null || string.IsNullOrEmpty(connstr.Value) ||
74 | dbType == null || string.IsNullOrEmpty(dbType.Value)) continue;
75 | DBAccess db = null;
76 | DBType t;
77 | if (!Enum.TryParse(dbType.Value.ToLower(), out t))
78 | continue;
79 | switch (t)
80 | {
81 | case DBType.sqlserver:
82 | db = new SqlAccess(connstr.Value);
83 | break;
84 | case DBType.mysql:
85 | db = new MySqlAccess(connstr.Value);
86 | break;
87 | case DBType.sqlite:
88 | db = new SqLiteAccess(connstr.Value,null);
89 | break;
90 | default:
91 | continue;
92 | }
93 | if (!dbList.ContainsKey(key.Value))
94 | dbList.Add(key.Value, db);
95 | }
96 | }
97 |
98 | private static DBAccess getDB(string key)
99 | {
100 | DBAccess db;
101 | dbList.TryGetValue(key, out db);
102 | if (db == null) throw new Exception("this DataBase is not found");
103 | return db;
104 | }
105 |
106 | public static int ExecuteNonQuery(SqlParam sqlParam,int poolId)
107 | {
108 | if (sqlParam == null||
109 | string.IsNullOrEmpty(sqlParam.CommondText)
110 | ||string.IsNullOrEmpty(sqlParam.DataBaseName)
111 | ||sqlParam.ParamsList.Length<1) return -1;//这里不允许直接传sql语句,必须使用参数化的
112 | if (poolId < 1) poolId = 1;//默认只有一个数据库
113 | DBAccess db=getDB(string.Format("{0}.{1}",sqlParam.DataBaseName,poolId));
114 | return db.ExecuteNonQuery(sqlParam.CommondText, sqlParam.CmdType,sqlParam.ParamsList,sqlParam.Values);
115 | }
116 |
117 | public static DataSet ExecuteDataSet(SqlParam sqlParam,int poolId)
118 | {
119 | if (sqlParam == null||
120 | string.IsNullOrEmpty(sqlParam.CommondText)
121 | || string.IsNullOrEmpty(sqlParam.DataBaseName)
122 | || sqlParam.ParamsList.Length < 1) return null;//这里不允许直接传sql语句,必须使用参数化的
123 | if (poolId < 1) poolId = 1;//默认只有一个数据库
124 | DBAccess db = getDB(string.Format("{0}.{1}", sqlParam.DataBaseName, poolId));
125 | return db.ExecuteDataSet(sqlParam.CommondText, sqlParam.CmdType,sqlParam.ParamsList,sqlParam.Values);
126 | }
127 |
128 | }
129 | }
130 |
--------------------------------------------------------------------------------
/DBAcess/DBType.cs:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------
2 | Copyright (C) 2014 宏图会员管理系统(Grant 巩建春)
3 |
4 | 项目名称: 宏图会员管理系统
5 | 创建者: grant (巩建春 emaill : nnn987@126.com ; QQ:406333743;Tel:+86 15619212255)
6 | CLR版本: 4.0.30319.42000
7 | 时间: 2014/8/28 18:16:22
8 |
9 | 功能描述:本软件为本人业余时间所写,其所有源码都可以进行免费的学习交流,切勿用于商业用途
10 |
11 | ----------------------------------------------------------------*/
12 | using System;
13 | using System.Collections.Generic;
14 | using System.Linq;
15 | using System.Text;
16 |
17 | namespace DBAccess
18 | {
19 | enum DBType
20 | {
21 | sqlserver,
22 | mysql,
23 | sqlite
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/DBAcess/DLL/MySql.Data.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/grantgonggithub/CRM/2f026027b97bae878004d3e0dfac3ac0c147569a/DBAcess/DLL/MySql.Data.dll
--------------------------------------------------------------------------------
/DBAcess/DLL/System.Data.SQLite.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/grantgonggithub/CRM/2f026027b97bae878004d3e0dfac3ac0c147569a/DBAcess/DLL/System.Data.SQLite.dll
--------------------------------------------------------------------------------
/DBAcess/MySqlAccess.cs:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------
2 | Copyright (C) 2014 宏图会员管理系统(Grant 巩建春)
3 |
4 | 项目名称: 宏图会员管理系统
5 | 创建者: grant (巩建春 emaill : nnn987@126.com ; QQ:406333743;Tel:+86 15619212255)
6 | CLR版本: 4.0.30319.42000
7 | 时间: 2014/8/28 18:16:22
8 |
9 | 功能描述:本软件为本人业余时间所写,其所有源码都可以进行免费的学习交流,切勿用于商业用途
10 |
11 | ----------------------------------------------------------------*/
12 | using System;
13 | using System.Collections.Generic;
14 | using System.Linq;
15 | using System.Data;
16 | using MySql.Data.MySqlClient;
17 | using System.Text;
18 |
19 | namespace DBAccess
20 | {
21 | public class MySqlAccess:DBAccess
22 | {
23 | private string connectionString;
24 | public MySqlAccess(string _connectionString)
25 | {
26 | this.connectionString = _connectionString;
27 | }
28 |
29 | public int ExecuteNonQuery(string cmdText, System.Data.CommandType commandType, string[] paramsList, object[] values)
30 | {
31 | MySqlCommand comd = null;
32 | try
33 | {
34 | comd = new MySqlCommand();
35 | using (MySqlConnection connection = new MySqlConnection(this.connectionString))
36 | {
37 | PrepareCommand(comd, connection, commandType, cmdText, paramsList,values);
38 | int rows = comd.ExecuteNonQuery();
39 | comd.Parameters.Clear();
40 | return rows;
41 | }
42 | }
43 | catch (Exception ex)
44 | {
45 | throw ex;
46 | }
47 | finally
48 | {
49 | if (comd != null)
50 | comd.Dispose();
51 | }
52 | }
53 |
54 | public System.Data.DataSet ExecuteDataSet(string cmdText, System.Data.CommandType commandType, string[] paramsList, object[] values)
55 | {
56 | MySqlCommand comd = null;
57 | MySqlConnection connection = null;
58 | try
59 | {
60 | connection = new MySqlConnection(this.connectionString);
61 | comd = new MySqlCommand();
62 | PrepareCommand(comd, connection, commandType, cmdText, paramsList,values);
63 |
64 | using (MySqlDataAdapter da = new MySqlDataAdapter(comd))
65 | {
66 | DataSet ds = new DataSet();
67 | da.Fill(ds);
68 | comd.Parameters.Clear();
69 | return ds;
70 | }
71 | }
72 | catch (Exception ex)
73 | {
74 | throw ex;
75 | }
76 | finally
77 | {
78 | if (comd != null)
79 | comd.Dispose();
80 | if (connection != null)
81 | connection.Close();
82 | }
83 | }
84 |
85 | public void PrepareCommand(IDbCommand cmd, IDbConnection conn, CommandType commandType, string cmdText, string[] paramsList, object[] values)
86 | {
87 | if (conn.State != ConnectionState.Open)
88 | conn.Open();
89 |
90 | cmd.Connection = conn;
91 | cmd.CommandText = cmdText;
92 | cmd.CommandType = commandType;
93 | if (paramsList == null) return;
94 | if (paramsList.Length < values.Length) throw new Exception("paramsList.length 0)
96 | {
97 | for(int i=0; i 0)
137 | {
138 | for (int i = 0; i < paramsList.Length; i++)
139 | {
140 | cmd.Parameters.Add(new SQLiteParameter() { ParameterName = paramsList[i], Value = values[i] });
141 | }
142 | }
143 | }
144 | }
145 | }
146 |
--------------------------------------------------------------------------------
/DBAcess/SqlAccess.cs:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------
2 | Copyright (C) 2014 宏图会员管理系统(Grant 巩建春)
3 |
4 | 项目名称: 宏图会员管理系统
5 | 创建者: grant (巩建春 emaill : nnn987@126.com ; QQ:406333743;Tel:+86 15619212255)
6 | CLR版本: 4.0.30319.42000
7 | 时间: 2014/8/28 18:16:22
8 |
9 | 功能描述:本软件为本人业余时间所写,其所有源码都可以进行免费的学习交流,切勿用于商业用途
10 |
11 | ----------------------------------------------------------------*/
12 | using System;
13 | using System.Collections.Generic;
14 | using System.Linq;
15 | using System.Data;
16 | using System.Data.SqlClient;
17 | using System.Text;
18 |
19 | namespace DBAccess
20 | {
21 | public class SqlAccess : DBAccess
22 | {
23 | private string connectionString;
24 | public SqlAccess(string _connectionString)
25 | {
26 | this.connectionString = _connectionString;
27 | }
28 |
29 | public int ExecuteNonQuery(string cmdText, CommandType commandType, string[] paramsList, object[] values)
30 | {
31 | SqlCommand comd =null;
32 | try
33 | {
34 | comd = new SqlCommand();
35 | using (SqlConnection connection = new SqlConnection(this.connectionString))
36 | {
37 | PrepareCommand(comd, connection, commandType, cmdText,paramsList, values);
38 | int rows = comd.ExecuteNonQuery();
39 | comd.Parameters.Clear();
40 | return rows;
41 | }
42 | }
43 | catch (Exception ex)
44 | {
45 | throw ex;
46 | }
47 | finally
48 | {
49 | if (comd != null)
50 | comd.Dispose();
51 | }
52 | }
53 |
54 | public System.Data.DataSet ExecuteDataSet(string cmdText, CommandType commandType, string[] paramsList, object[] values)
55 | {
56 | SqlCommand comd=null;
57 | SqlConnection connection =null;
58 | try
59 | {
60 | connection = new SqlConnection(this.connectionString);
61 | comd = new SqlCommand();
62 | PrepareCommand(comd, connection, commandType, cmdText,paramsList, values);
63 |
64 | using (SqlDataAdapter da = new SqlDataAdapter(comd))
65 | {
66 | DataSet ds = new DataSet();
67 | da.Fill(ds);
68 | comd.Parameters.Clear();
69 | return ds;
70 | }
71 | }
72 | catch (Exception ex)
73 | {
74 | throw ex;
75 | }
76 | finally
77 | {
78 | if (comd != null)
79 | comd.Dispose();
80 | if (connection != null)
81 | connection.Close();
82 | }
83 | }
84 |
85 | public void PrepareCommand(IDbCommand cmd, IDbConnection conn, CommandType commandType, string cmdText, string[] paramsList, object[] values)
86 | {
87 | if (conn.State != ConnectionState.Open)
88 | conn.Open();
89 |
90 | cmd.Connection = conn;
91 | cmd.CommandText = cmdText;
92 | cmd.CommandType = commandType;
93 |
94 | if (paramsList.Length < values.Length) throw new Exception("paramsList.length 0)
96 | {
97 | for (int i = 0; i < paramsList.Length; i++)
98 | {
99 | cmd.Parameters.Add(new SqlParameter() { ParameterName = paramsList[i], Value = values[i] });
100 | }
101 | }
102 | //if (cmdParms != null)
103 | //{
104 | // foreach (IDataParameter parm in cmdParms)
105 | // cmd.Parameters.Add(parm);
106 | //}
107 | }
108 | }
109 | }
110 |
--------------------------------------------------------------------------------
/DBAcess/SqlParam.cs:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------
2 | Copyright (C) 2014 宏图会员管理系统(Grant 巩建春)
3 |
4 | 项目名称: 宏图会员管理系统
5 | 创建者: grant (巩建春 emaill : nnn987@126.com ; QQ:406333743;Tel:+86 15619212255)
6 | CLR版本: 4.0.30319.42000
7 | 时间: 2014/8/28 18:16:22
8 |
9 | 功能描述:本软件为本人业余时间所写,其所有源码都可以进行免费的学习交流,切勿用于商业用途
10 |
11 | ----------------------------------------------------------------*/
12 | using System;
13 | using System.Collections.Generic;
14 | using System.Linq;
15 | using System.Data;
16 | using System.Text;
17 |
18 | namespace DBAccess
19 | {
20 | public class SqlParam
21 | {
22 | private string commondText;
23 | public string CommondText
24 | {
25 | get { return commondText; }
26 | set { commondText = value; }
27 | }
28 |
29 | private CommandType commondType;
30 | public CommandType CmdType
31 | {
32 | get { return commondType; }
33 | set { commondType = value; }
34 | }
35 |
36 | private int pooId;
37 | public int PoolId
38 | {
39 | get { return pooId; }
40 | set { pooId = value; }
41 | }
42 |
43 | private string dataBaseName;
44 | public string DataBaseName
45 | {
46 | get { return dataBaseName; }
47 | set { dataBaseName = value; }
48 | }
49 |
50 | private string[] paramsList;
51 |
52 | public string[] ParamsList
53 | {
54 | get { return paramsList; }
55 | set { paramsList = value; }
56 | }
57 | private object[] values;
58 | public object[] Values
59 | {
60 | get { return values; }
61 | set { values = value; }
62 | }
63 |
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 一、综述
2 |
3 | 宏图会员管理系统是一款集会员、会员卡、员工、考勤、产品\服务、消费管理、财务统计、事件提醒、促销、折扣为一体的高度集成化系统,它可以大幅度提高服务型企业的服务质量和效率,提高企业产品、员工以及客户管理的能力,使企业管理者能全方位的了解和控制企业日常经营情况,使员工、产品、客户处于完全可控可操作的系统中,保证资源的最优化,效益的最大化。
4 | 二、读者
5 | 本文档的预期读者如下:
6 | 企业管理人员
7 | 企业员工
8 | 财务人员
9 | 三、名词解释
10 | 1、会员卡:企业发给客户的一种可以标识用户特殊身份的卡片;
11 | 2、促销计划:企业根据销售需要或者节假日的情况,针对全部或者特定消费人群制定的折扣计划,促销计划可以针对全部客户和特定客户设置差异化的折扣点,保证促销的多样性和高效性。
12 | 四、功能模块
13 | (一)、登陆
14 |
15 | 输入用户名和密码点击登陆有如下情况:
16 | 1、用户名错误或者系统不存在这样的用户则提示如下图所示:
17 |
18 | 2、 用户名正确,密码错误提示如下图所示:
19 |
20 | 3、用户名和密码都正确将进入系统主界面,由于账号权限差别,主界面内容会有所不同,权限可自由配置(权限管理会在后面讲解)
21 | 管理员登录后主界面,如下:
22 |
23 | 超级管理员登陆后界面如下:
24 |
25 | (二)、系统设置
26 | 只有系统超级管理员权限的账号登陆系统后才能进行【系统设置】操作,系统设置包含【角色管理】和【上班时间设置】
27 | 1、角色管理,这个功能可以设置系统不同账号拥有的权限,保证不同账号只能操作预先设定的内容,如下图所示:
28 |
29 | 【新增】:可以在上面角色名称后面输入角色名,然后在下面权限列表勾选给这个角色分配的操作权限,这些权限对应了系统所有菜单,勾选之后,凡是分配了这个角色的用户登录,对应的勾选菜单就处于可操作状态,其他未勾选的菜单处于禁用状态,勾选完成之后点击【保存】新角色即可添加完毕,需要注意:新添加角色名称不能已经存在,否则保存失败。
30 | 【编辑】:在下面角色列表中选择一项,点【编辑】按钮,即可在上面看到当前角色的名称和所拥有的权限,可以编辑角色名称,也可以增加或者减少权限,系统预分配的角色不能编辑,修改完毕点【保存】即可完成编辑
31 |
32 | 【删除】:当某个角色不再使用,可以选择这一项后点击【删除】,系统会询问“确定删除吗?”点【确定】即可进行删除操作,系统预置的超级管理角色是不能删除的,另外也只能删除,当前没有分配给任何管理员的角色,否则需要先将分配了这个角色的管理员修改为其他角色,或者将这个管理员删除掉,才能删除这个角色。
33 | 2、上下班时间,考勤管理(后面讲解)需要根据预设定的上班时间确定是否迟到,根据预设定的下班时间确定是否早退,其中上班时间和下班时间是指企业规定的上下班时间,由于考虑的弹性上班和人性化管理,一般在规定时间上有一个宽裕时间即所谓5分钟、10分钟内不算迟到或者早退,如果必须严格按照上下班时间考勤,请将迟到时间跟前面的上班时间设置相同值,早退时间和下班时间设置相同值,如下图所示:
34 | (三)、产品管理
35 | 1、产品管理主界面如下图所示:
36 |
37 | 左侧树列表,列出了当前系统的所有产品,要新增产品只需要点击上面的【新增产品】按钮,即可出现如下图所示界面:
38 |
39 | 在【名称】里输入产品名称,点击保存即可,在主界面的左侧树列表新增一个产品或者服务,在每个产品名称下面都会自动生成两个节点:【日常价格】、【促销计划】
40 | 【日常价格】:指此商品或者服务的正常价格,可以针对不同类型的会员进行设置,如果价格都一样,则无需设置,如下图:
41 |
42 | 【促销计划】:可以针对这个产品或者服务根据不同的销售季节和时段设置每种类型的会员相应的促销折扣计划,系统会在指定时间段内应用相应的折扣点进行结算,如下图:
43 |
44 | 上面箭头部分,表示此商品所有的促销计划,促销计划可以有多个,主要根据时间不同,一个时间点或者时间段为一个促销计划,每个促销计划都会有基本价格,促销时间,针对每种类型的会员的折扣点设置,折扣点表示打几折如:9折表示在基本价格基础上乘0.9,折扣现金表示折扣后的现金是多少,按时段促销表示当前计划在那个时间段的交易中生效,如果不需要促销,则无需设置。
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 | 1、顶部:顶部主要是由两行菜单组成,一行是不常用的文字菜单,一行是常用的快捷菜单,如下图所示:
71 | 文字菜单
72 |
73 | 快捷菜单
74 |
75 | 2、左侧栏:左侧栏分为上半部分【最新消费记录】列表和下半部分【系统信息】
76 | 【最新消费记录】只列出最近50条记录,更多记录请在【消费查询】里面操作,后面会讲到
77 | 【系统信息】列出了,当前系统的一些统计数据,如:当前登录管理员,今天的交易数,金额数、目前的会员数量,员工数量,产品数量,发卡量和库存未发卡的数量,下面是产品促销计划消息窗口,列出今天是否有促销产品,还有事件提醒窗口,事件提醒后面会讲到。
78 | 3、右侧栏:右侧栏主要是用于消费结算明细操作的界面,当客户通过刷卡就可以在【客户信息】框里面列出客户相关信息,如下图:
79 |
80 | 然后收费员选择客户消费的产品名称,系统会根据预设定的产品价格和折扣信息计算出相应的小计金额,列入下面的【消费明细】列表中,收费员可以在列表中修改某个产品的数量,系统会自动根据数量算出小计和总计金额,在不修改数量的情况下,每件产品都默认按一件计算,如下图所示:
81 |
82 | 本次消费的总计金额会在【结算总计】框中的【总计应收】显示出来,同时会根据此会员的账户余额情况,如果【账户余额】大于本次消费【总计应收】则直接扣除【总计应收】对应的金额即【账户扣除】,不用再不交现金即【需补现金】为0,如果【账户余额】小于本次消费【总计应收】则全部扣除余额,差额显示在【需补现金】中,这时收费员就需要向会员在额外收取对应金额的现金,为了便于使用,下面还提供了计算器的功能,输入【实收】金额点击【找零】系统会根据【需补现金】和实收的差额算出找零金额显示在后面框中,如果【需补现金】为0,则会提示“不需要不交现金”,【实收】和【找零】只是为收费员提供方便,不做任何记账参数,系统只会记录【应收】金额,不输入【实收】、【找零】也可以进行结账,另外为了统计员工绩效业绩,在【结算信息】栏里面加入了【接待员工】,可以在结算时选择当前接待的员工,也可以通过刷员工卡,自动选定接待员工,结算后本次消费业绩会计入当前员工名下,便于业绩统计,此为可选项,不选择【接待员工】也可以进行结账,如下图所示:
83 |
84 | (七)、前台结账
85 | 当会员客户忘记携带会员卡时,可以通过此功能使用会员结账功能,点击会员结账,要求输入会员卡号,或者会员姓名或者手机号其中任何一项信息点击确定,系统会查找此会员,如果存在将会在主界面【客户信息】栏中显示出用户相关信息,便于收费员核对,无误之后进入正常结账流程(见第(六)节第2个步骤),如下图所示:
86 |
87 | (八)、会员充值
88 | 点击主界面【会员充值】如下图所示:
89 |
90 | 输入会员姓名、卡号、手机号任意一项,点击查询按钮,如果会员存在则在下面【用户信息】里列出用户相关的信息,然后在下面输入充值金额点击确认充值按钮就可完成充值操作。
91 | (九)、消费查询
92 | 在主界面点击【消费查询】按钮,进入如下界面
93 |
94 | 这里列出了所有的消费记录,上面提供了查询功能,可以按会员姓名、卡号、会员、类型、消费时间查询,也可以按接待员工,收费员、消费金额查询,另外,选择一条消费记录,点【明细】可以查看消费明细。
95 | (十)、考勤管理
96 | 在主界面点击菜单【考勤管理】进入如下界面:
97 |
98 | 上面提供了查询功能,可以根据员工姓名、卡号、打卡时间查询功能,特别说明如下功能:
99 | 1、 全部记录:列出所有打卡的记录,不会过滤重复记录和无效记录(和上面其他查询条件组合查询);
100 | 2、 有效记录:列出每天最早的打卡记录和最晚的打卡记录(和上面其他查询条件组合);
101 | 3、 迟到\早退记录:列出最早的打卡时间晚于上班时间的记录和最晚的打卡时间早于下班时间的打卡记录。
102 | (十一)、卡片管理
103 | 此功能是管理系统会员卡,原始卡片的,系统要想正常发放会员卡必须先将这些会员卡的卡号导入系统卡库,如下图所示:
104 |
105 | 导入数据的原始文件有宏图软件科技提供以保证卡片的合法性和安全性。
106 | 通过【卡库查询】可以查询当前卡库中卡的使用情况。
107 | (十二)、账号管理
108 | 点击主界面【账号管理】菜单,可进入账号管理界面,在此可以对系统的所有管理员进行管理,可以新增、修改管理,冻结账号、删除,详情如下图所示:
109 |
110 | 1、 新增管理员:点击【新增】按钮然后在上面输入框中,输入相关信息,点击保存即可完成新增;
111 | 2、 编辑:选择一个管理,然后点击【编辑】按钮,此管理员信息会自动显示在上面输入框中,可以根据需要修改相关信息。
112 | (十三)、事件提醒
113 | 此功能主要提供给管理员,帮助自己记录和提醒一些重要事项,详见下图:
114 |
115 | 可以根据需要设置如下几种提醒:
116 | 1、 一次提醒:此提醒在指定的时间只提醒一次就结束;
117 | 2、 每日提醒:管理员可以将自己每天准点必须干的事情设置为每日提醒,到每天指定的时间点就会提醒;
118 | 3、 每周提醒:管理员可以将每周某天需要做的固定事情设置为每周提醒,如每周一9:30开周例会,就可以设置为每周提醒;
119 | 4、 每月提醒:管理员可以将每个月某一天要做的事情设置为每月提醒,比如财务每个月1号需要计算员工工资
120 | 以上所有提醒都是在指定时间到来之前10分钟在主界面的【事件提醒】框里面列出,过期一分钟后结束提醒。
121 | (十四)、离开锁屏
122 | 此功能用于当前登录的管理员,要暂时离开电脑一会,为了防止其他人员操作,而做的锁定操作,详见下图:
123 |
124 | 当点击【离开锁屏】按钮之后,系统会弹出登录窗口,需要再次输入账号和密码才可以解锁进入系统,否则整个系统界面都会处于不可用状态,即使会有刷卡也不做任何响应,而且要求必须是锁屏前登录的管理账号才可以解锁。
125 | (十五)、其他说明:
126 | 1、 当某个卡片已经发放出去,就不能再发放给另外一个会员;
127 | 2、 当某个卡片未经过系统发放,直接刷卡系统会提示“此卡没有分配给任何会员,是否新建会员”,如下图所示:
128 |
129 | 3、 当某个卡没有导入系统卡库,或者其他非法未经授权的卡被读入系统后,会提示“非法卡”,系统会主动拒绝,如下图:
130 |
131 | 4、 退出系统、切换账号、打开主界面
132 | 点击系统主界面右上角的关闭按钮,系统不会退出和关闭,会最小化到右下角的任务栏中,并提示相关信息,如下图所示:
133 |
134 | 此时要激活并打开系统主界面,只需要双击下面图标即可,也可以在图标上右键,如下图所示:
135 |
136 | 点击【打开】系统主界面会最大化,此菜单上还有【切换账号】、【退出】
137 | 切换账号:当一个管理员登陆之后,要交接班,或者切换为另一个管理员的账号时,点击此按钮,系统会自动退出当前登陆,并进入登陆窗口,要求输入要切换到的账号。
138 | 退出:要退出宏图会员系统,只能通过点击此按钮退出。
139 | 5、 激活主界面:除了管理员右键点击打开(见上面步骤4)之外,只要有刷卡操作,系统也会自动弹出,并最大化以激活主界面。
140 |
141 |
142 | 初始账户:admin 密码:123456
143 |
144 | 作者: grant (巩建春)
145 | email: nnn987@126.com
146 | QQ: 406333743
147 |
148 | ## -----注意:有时候由于某些情况,可能图片无法正常展示,如果看不到图片,可以尝试下载源码项目中的图片到本地查看----
149 |
150 | 说明: 为了支持开源和犒劳作者的辛苦付出,你可以向作者捐赠,一表对作者辛苦劳动的尊重(微信捐赠二维码见下图)
151 |
152 | 
153 |
154 |
155 | 
156 |
--------------------------------------------------------------------------------
/Reader/IReader.cs:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------
2 | Copyright (C) 2014 宏图会员管理系统(Grant 巩建春)
3 |
4 | 项目名称: 宏图会员管理系统
5 | 创建者: grant (巩建春 emaill : nnn987@126.com ; QQ:406333743;Tel:+86 15619212255)
6 | CLR版本: 4.0.30319.42000
7 | 时间: 2014/8/28 18:16:22
8 |
9 | 功能描述:本软件为本人业余时间所写,其所有源码都可以进行免费的学习交流,切勿用于商业用途
10 |
11 | ----------------------------------------------------------------*/
12 | using System;
13 | using System.Collections.Generic;
14 | using System.Linq;
15 | using System.Text;
16 |
17 | namespace Reader
18 | {
19 | public interface IReader
20 | {
21 | ///
22 | /// 同步调用,直接返回卡号
23 | ///
24 | ///
25 | ///
26 | uint GetCode(byte sing);
27 | ///
28 | /// 异步调用,需要传入回调,单次
29 | ///
30 | ///
31 | /// 回调方法,传回操作异常(如果有),卡号,上下文参数传递
32 | void GetCode(byte sing,object context, Action callBack);
33 |
34 | ///
35 | /// 读写器发声
36 | ///
37 | /// 时长
38 | void Beep(int time);
39 |
40 | ///
41 | /// 停止读卡
42 | ///
43 | void Halt();
44 | ///
45 | /// 轮询读卡,多次
46 | ///
47 | void PollReadCard(byte sing,object context,Action callBack);
48 |
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/Reader/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过以下
6 | // 特性集控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("Reader")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("CHINA")]
12 | [assembly: AssemblyProduct("Reader")]
13 | [assembly: AssemblyCopyright("Copyright © CHINA 2014")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("a360d681-0983-411d-bd64-6f95fa0a5e2f")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 内部版本号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Reader/Reader.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 8.0.30703
7 | 2.0
8 | {7BF82F49-91C8-445B-95D9-E2CA5DE6179F}
9 | Library
10 | Properties
11 | Reader
12 | Reader
13 | v4.0
14 | 512
15 |
16 |
17 | true
18 | full
19 | false
20 | ..\Release\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | pdbonly
27 | true
28 | bin\Release\
29 | TRACE
30 | prompt
31 | 4
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 | Always
52 |
53 |
54 |
55 |
56 | Always
57 |
58 |
59 |
60 |
61 | {980CEAD6-A620-4CBA-997D-1C255BF8EF0D}
62 | Tools
63 |
64 |
65 |
66 |
73 |
--------------------------------------------------------------------------------
/Reader/ReaderManager.cs:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------
2 | Copyright (C) 2014 宏图会员管理系统(Grant 巩建春)
3 |
4 | 项目名称: 宏图会员管理系统
5 | 创建者: grant (巩建春 emaill : nnn987@126.com ; QQ:406333743;Tel:+86 15619212255)
6 | CLR版本: 4.0.30319.42000
7 | 时间: 2014/8/28 18:16:22
8 |
9 | 功能描述:本软件为本人业余时间所写,其所有源码都可以进行免费的学习交流,切勿用于商业用途
10 |
11 | ----------------------------------------------------------------*/
12 | using System;
13 | using System.Collections.Generic;
14 | using System.Linq;
15 | using System.Text;
16 | using System.Threading;
17 |
18 | using Tools;
19 |
20 | namespace Reader
21 | {
22 | public class ReaderManager
23 | {
24 | private static IReader reader = null;
25 | private static int pollTimeSpan=500;
26 | private static Thread th=null;
27 | public static bool InitlizeReader(string readerType,int _pollTimeSpan)
28 | {
29 | if (string.IsNullOrEmpty(readerType))
30 | {
31 | Exception ex = new Exception("readerType InitlizeReader Error");
32 | TracingHelper.Error(ex, typeof(ReaderManager));
33 | throw ex;
34 | }
35 | pollTimeSpan = _pollTimeSpan;
36 | switch (readerType)
37 | {
38 | case "ST":
39 | reader = new STReader();
40 | TracingHelper.Info("ST 初始化成功");
41 | return true;
42 | default:
43 | Exception ex = new Exception(string.Format("{0} is Not active reader,place check config",readerType));
44 | TracingHelper.Error(ex, typeof(ReaderManager));
45 | break;
46 | }
47 | return false;
48 | }
49 |
50 | public static uint GetCode(byte sing)
51 | {
52 | return reader.GetCode(sing);
53 | }
54 |
55 | public static void GetCode(byte sing, object context, Action callBack)
56 | {
57 | reader.GetCode(sing, context, callBack);
58 | }
59 |
60 | public static void Beep(int time)
61 | {
62 | reader.Beep(time);
63 | }
64 |
65 | public static void Halt()
66 | {
67 | reader.Halt();
68 | }
69 |
70 | public static void PollReadCard(byte sing, object context, Action callBack)
71 | {
72 | temp t=new temp(){ Sing=sing, Context=context, CallBack=callBack,reader=reader, pollTimeSpan=pollTimeSpan};
73 | Thread th = new Thread(new ThreadStart(t.StartPoll));
74 | th.Start();
75 | }
76 |
77 | public static void StopReadCard()
78 | {
79 | if(th!=null)
80 | th.Abort();
81 | }
82 |
83 | }
84 |
85 | public class temp
86 | {
87 | public byte Sing;
88 |
89 | public object Context;
90 |
91 | public Action CallBack;
92 |
93 | public IReader reader;
94 |
95 | public int pollTimeSpan;
96 |
97 | public void StartPoll()
98 | {
99 | TracingHelper.Info("start reader cardid");
100 | while (true)
101 | {
102 | reader.GetCode(Sing, Context, delegate(Exception ex, uint sn, object context) {
103 | if(ex!=null)
104 | TracingHelper.Error(ex,typeof(ReaderManager),"callBack return sn="+sn);
105 | if (sn > 0)
106 | {
107 | CallBack(null, sn, context);
108 | reader.Halt();
109 | reader.Beep(80);
110 | }
111 | //else
112 | // CallBack(ex, sn, context);
113 | });
114 | Thread.Sleep(pollTimeSpan);
115 | }
116 | }
117 | }
118 | }
119 |
--------------------------------------------------------------------------------
/Reader/STReader/API_RF.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/grantgonggithub/CRM/2f026027b97bae878004d3e0dfac3ac0c147569a/Reader/STReader/API_RF.cs
--------------------------------------------------------------------------------
/Reader/STReader/EasyPOD.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/grantgonggithub/CRM/2f026027b97bae878004d3e0dfac3ac0c147569a/Reader/STReader/EasyPOD.dll
--------------------------------------------------------------------------------
/Reader/STReader/STReader.cs:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------
2 | Copyright (C) 2014 宏图会员管理系统(Grant 巩建春)
3 |
4 | 项目名称: 宏图会员管理系统
5 | 创建者: grant (巩建春 emaill : nnn987@126.com ; QQ:406333743;Tel:+86 15619212255)
6 | CLR版本: 4.0.30319.42000
7 | 时间: 2014/8/28 18:16:22
8 |
9 | 功能描述:本软件为本人业余时间所写,其所有源码都可以进行免费的学习交流,切勿用于商业用途
10 |
11 | ----------------------------------------------------------------*/
12 | using System;
13 | using System.Collections.Generic;
14 | using System.Linq;
15 | using System.Text;
16 | using Tools;
17 |
18 |
19 | namespace Reader
20 | {
21 | public class STReader:IReader
22 | {
23 | public uint GetCode(byte sing)
24 | {
25 | int ret;
26 | uint snr = 0;
27 | TracingHelper.Info("send reader cardId");
28 | ret = API_RF.rf_card(sing, ref snr);
29 | TracingHelper.Info("recive sn="+snr);
30 | if (ret == 0)
31 | return snr;
32 | else return 0;
33 | }
34 |
35 |
36 | public void GetCode(byte sing,object context, Action callBack)
37 | {
38 | try
39 | {
40 | int ret;
41 | uint snr = 0;
42 | ret = API_RF.rf_card(sing, ref snr);
43 | if (ret == 0)
44 | callBack(null, snr, context);
45 | else callBack(null, 0, context);
46 | }
47 | catch (Exception ex)
48 | {
49 | callBack(ex, 0, context);
50 | }
51 | }
52 |
53 |
54 | public void Beep(int time)
55 | {
56 | API_RF.rf_beep(time);
57 | }
58 |
59 | public void Halt()
60 | {
61 | API_RF.rf_halt();
62 | }
63 |
64 | public void PollReadCard(byte sing, object context, Action callBack)
65 | {
66 | throw new NotImplementedException();
67 | }
68 |
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/Reader/STReader/iccrf.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/grantgonggithub/CRM/2f026027b97bae878004d3e0dfac3ac0c147569a/Reader/STReader/iccrf.dll
--------------------------------------------------------------------------------
/Resource/DBConfig.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/Resource/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过以下
6 | // 特性集控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("Resource")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("CHINA")]
12 | [assembly: AssemblyProduct("Resource")]
13 | [assembly: AssemblyCopyright("Copyright © CHINA 2014")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("6214b444-f5ee-4989-843e-f0eb2ad19a56")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 内部版本号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Resource/Resource.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using DBAccess;
6 | using Router;
7 |
8 | namespace Resource
9 | {
10 | ///
11 | /// 把数据当成一种资源,上层调用者不用关心,数据是本地的还是远程的,但是为了保证性能,这里如果是返回记录集的操作,请自己实现分页,不能返回太大量的数据集,调用之前需要在系统初始化的时候,做Resource.Initialization()的初始化
12 | ///
13 | public class Resource
14 | {
15 | public static void Initialization()
16 | {
17 | DBFactory.Initialization(RouterManger.InitRouter());
18 | }
19 |
20 | public static int ExecuteNonQuery(SqlParam sqlParam, int poolId)
21 | {
22 | string uri;
23 | if (RouterManger.isCurrentSite(poolId, sqlParam.DataBaseName, out uri))
24 | return DBFactory.ExecuteNonQuery(sqlParam, poolId);
25 | else
26 | {
27 | DBAgentSoapClient agent = new DBAgentSoapClient("DBAgentSoap", uri);
28 | //DBAgent.SqlParam sql = new DBAgent.SqlParam() { CmdType=(DBAgent.CommandType)sqlParam.CmdType, CommondText=sqlParam.CommondText, DataBaseName=sqlParam.DataBaseName, ParamsList=sqlParam.ParamsList, Values=sqlParam.Values };
29 | return agent.ExecuteNonQuery(sqlParam, poolId);
30 | }
31 | }
32 |
33 | public static System.Data.DataSet ExecuteDataSet(SqlParam sqlParam, int poolId)
34 | {
35 | string uri;
36 | if (RouterManger.isCurrentSite(poolId, sqlParam.DataBaseName, out uri))
37 | return DBFactory.ExecuteDataSet(sqlParam, poolId);
38 | else
39 | {
40 | DBAgentSoapClient agent = new DBAgentSoapClient("DBAgentSoap", uri);
41 | //DBAgent.SqlParam sql = new DBAgent.SqlParam() { CmdType = (DBAgent.CommandType)sqlParam.CmdType, CommondText = sqlParam.CommondText, DataBaseName = sqlParam.DataBaseName, ParamsList = sqlParam.ParamsList, Values = sqlParam.Values };
42 | return agent.ExecuteDataSet(sqlParam, poolId);
43 | }
44 | }
45 |
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/Resource/Resource.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 8.0.30703
7 | 2.0
8 | {E175C727-894F-4FFF-A4F1-5A962EC91F00}
9 | Library
10 | Properties
11 | Resource
12 | Resource
13 | v4.0
14 | 512
15 |
16 |
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | pdbonly
27 | true
28 | bin\Release\
29 | TRACE
30 | prompt
31 | 4
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 | {25352743-08B4-48E6-92E1-0A58C0AD760E}
55 | DBAcess
56 |
57 |
58 | {FF691C79-88BB-4CFF-8E21-52B4CA3E89B8}
59 | Router
60 |
61 |
62 |
63 |
70 |
--------------------------------------------------------------------------------
/Resource/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
12 |
14 |
15 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/Router/DBPool.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace Router
7 | {
8 | public class DBPool
9 | {
10 | private string key;
11 |
12 | public string Key
13 | {
14 | get { return key; }
15 | set { key = value; }
16 | }
17 |
18 | private string siteName;
19 |
20 | public string SiteName
21 | {
22 | get { return siteName; }
23 | set { siteName = value; }
24 | }
25 |
26 | private string siteUri;
27 |
28 | public string SiteUri
29 | {
30 | get { return siteUri; }
31 | set { siteUri = value; }
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/Router/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过以下
6 | // 特性集控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("Router")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("CHINA")]
12 | [assembly: AssemblyProduct("Router")]
13 | [assembly: AssemblyCopyright("Copyright © CHINA 2014")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("e34479f2-cfd5-4cb7-a380-8f32e7e94388")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 内部版本号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Router/Router.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Linq;
5 | using System.Xml;
6 | using System.Text;
7 |
8 |
9 | namespace Router
10 | {
11 | public class RouterManger
12 | {
13 | private static Dictionary router = new Dictionary();
14 | private static string currentSite;
15 |
16 | public static bool isCurrentSite(int poolId,string dbName,out string siteUri)
17 | {
18 | DBPool pool;
19 | if (!router.TryGetValue(string.Format("{0}.{1}", dbName, poolId), out pool))
20 | throw new Exception("找不到指定的数据库");
21 | siteUri = pool.SiteUri;
22 | return currentSite.ToLower().Equals(pool.SiteName.ToLower());
23 | }
24 |
25 | public static XmlNode InitRouter()
26 | {
27 | try
28 | {
29 | string path = AppDomain.CurrentDomain.BaseDirectory + "DBConfig.config";
30 | XmlDocument doc = new XmlDocument();
31 | doc.Load(path);
32 | XmlNode current = doc.SelectSingleNode("LocationConfig/Router");
33 | if (current == null || current.Attributes["Site"] == null)
34 | {
35 | throw new Exception("LocationConfig/Router error");
36 | }
37 | currentSite = current.Attributes["Site"].Value;
38 | XmlNode node =doc.SelectSingleNode("LocationConfig/DataBase");
39 | foreach (XmlNode site in node.ChildNodes)
40 | {
41 | DBPool dbPool;
42 | if(currentSite.ToLower().Equals(site.Attributes["name"].Value.ToLower()))
43 | current=site;
44 | foreach (XmlNode pool in site.ChildNodes)
45 | {
46 | dbPool = new DBPool() { Key = pool.Attributes["key"].Value, SiteName = site.Attributes["name"].Value, SiteUri = site.Attributes["uri"].Value };
47 | router.Add(dbPool.Key, dbPool);
48 | }
49 | }
50 | return current;
51 | }
52 | catch (Exception ex)
53 | {
54 | throw new Exception("DBConfig.config error",ex);
55 | }
56 |
57 | }
58 |
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/Router/Router.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 8.0.30703
7 | 2.0
8 | {FF691C79-88BB-4CFF-8E21-52B4CA3E89B8}
9 | Library
10 | Properties
11 | Router
12 | Router
13 | v4.0
14 | 512
15 |
16 |
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | pdbonly
27 | true
28 | bin\Release\
29 | TRACE
30 | prompt
31 | 4
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
55 |
--------------------------------------------------------------------------------
/Tools/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的常规信息通过以下
6 | // 特性集控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("Tools")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("CHINA")]
12 | [assembly: AssemblyProduct("Tools")]
13 | [assembly: AssemblyCopyright("Copyright © CHINA 2014")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 使此程序集中的类型
18 | // 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
19 | // 则将该类型上的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("22a4ed81-c72f-4df3-90f6-d315de825f68")]
24 |
25 | // 程序集的版本信息由下面四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 内部版本号
30 | // 修订号
31 | //
32 | // 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
33 | // 方法是按如下所示使用“*”:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Tools/SerializeHelper.cs:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------
2 | Copyright (C) 2014 宏图会员管理系统(Grant 巩建春)
3 |
4 | 项目名称: 宏图会员管理系统
5 | 创建者: grant (巩建春 emaill : nnn987@126.com ; QQ:406333743;Tel:+86 15619212255)
6 | CLR版本: 4.0.30319.42000
7 | 时间: 2014/8/28 18:16:22
8 |
9 | 功能描述:本软件为本人业余时间所写,其所有源码都可以进行免费的学习交流,切勿用于商业用途
10 |
11 | ----------------------------------------------------------------*/
12 | using System;
13 | using System.Collections.Generic;
14 | using System.Linq;
15 | using System.Text;
16 | using System.IO;
17 | using System.Xml.Serialization;
18 |
19 | namespace Tools
20 | {
21 | public static class SerializeHelper
22 | {
23 | public static string XmlSerialize(T obj) where T : class
24 | {
25 | try
26 | {
27 | XmlSerializer serializer = new XmlSerializer(typeof(T));
28 | using (MemoryStream stream = new MemoryStream())
29 | {
30 | serializer.Serialize(stream, obj);
31 | stream.Position = 0;
32 |
33 | StreamReader sr = new StreamReader(stream);
34 | string resultStr = sr.ReadToEnd();
35 | sr.Close();
36 | stream.Close();
37 | return resultStr;
38 | }
39 | }
40 | catch (Exception ex)
41 | {
42 | return null;
43 | }
44 | }
45 |
46 | public static T XmlDeserialize(string xml) where T : class
47 | {
48 | T result = default(T);
49 | try
50 | {
51 | XmlSerializer serializer = new XmlSerializer(typeof(T));
52 | using (MemoryStream ms = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(xml.ToCharArray())))
53 | {
54 | result = (T)serializer.Deserialize(ms);
55 | ms.Close();
56 |
57 | return result;
58 | }
59 | }
60 | catch (Exception ex)
61 | {
62 | return result;
63 | }
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/Tools/Tools.cs:
--------------------------------------------------------------------------------
1 | /*----------------------------------------------------------------
2 | Copyright (C) 2014 宏图会员管理系统(Grant 巩建春)
3 |
4 | 项目名称: 宏图会员管理系统
5 | 创建者: grant (巩建春 emaill : nnn987@126.com ; QQ:406333743;Tel:+86 15619212255)
6 | CLR版本: 4.0.30319.42000
7 | 时间: 2014/8/28 18:16:22
8 |
9 | 功能描述:本软件为本人业余时间所写,其所有源码都可以进行免费的学习交流,切勿用于商业用途
10 |
11 | ----------------------------------------------------------------*/
12 | using System;
13 | using System.Collections.Generic;
14 | using System.Linq;
15 | using System.Text;
16 | using System.Security.Cryptography;
17 | using System.IO;
18 |
19 | namespace Tools
20 | {
21 | public class Tools
22 | {
23 | private readonly static string passWord = "grantgongjianchun!@#$%^&*()brysjhhrhl0123456789";
24 | ///
25 | /// 密码MD5加密
26 | ///
27 | ///
28 | ///
29 | public static string GetMD5(String str)
30 | {
31 | string pwd = "";
32 | MD5 md5 = MD5.Create();
33 | byte[] s = md5.ComputeHash(Encoding.UTF8.GetBytes(str));
34 | for (int i = 0; i < s.Length; i++)
35 | pwd = pwd + s[i].ToString("X");
36 | return pwd;
37 | }
38 |
39 | private static byte[] Encrypt(byte[] clearData, byte[] Key, byte[] IV)
40 | {
41 | MemoryStream ms = new MemoryStream();
42 | Rijndael alg = Rijndael.Create();
43 |
44 | alg.Key = Key;
45 | alg.IV = IV;
46 |
47 | CryptoStream cs = new CryptoStream(ms, alg.CreateEncryptor(), CryptoStreamMode.Write);
48 | cs.Write(clearData, 0, clearData.Length);
49 | cs.Close();
50 |
51 | byte[] encryptedData = ms.ToArray();
52 | return encryptedData;
53 | }
54 | public static string Encrypt(string clearText)
55 | {
56 | return Encrypt(clearText,passWord);
57 | }
58 |
59 | public static string Encrypt(string clearText, string Password)
60 | {
61 | byte[] clearBytes =
62 | System.Text.Encoding.Unicode.GetBytes(clearText);
63 |
64 | PasswordDeriveBytes pdb = new PasswordDeriveBytes(Password,
65 | new byte[] {0x49, 0x76, 0x61, 0x6e, 0x20, 0x4d,
66 | 0x65, 0x64, 0x76, 0x65, 0x64, 0x65, 0x76});
67 |
68 | byte[] encryptedData = Encrypt(clearBytes,
69 | pdb.GetBytes(32), pdb.GetBytes(16));
70 |
71 |
72 | return Convert.ToBase64String(encryptedData);
73 | }
74 |
75 | private static byte[] Decrypt(byte[] cipherData,
76 | byte[] Key, byte[] IV)
77 | {
78 |
79 | MemoryStream ms = new MemoryStream();
80 |
81 | Rijndael alg = Rijndael.Create();
82 |
83 | alg.Key = Key;
84 | alg.IV = IV;
85 |
86 | CryptoStream cs = new CryptoStream(ms,
87 | alg.CreateDecryptor(), CryptoStreamMode.Write);
88 | // Write the data and make it do the decryption
89 | cs.Write(cipherData, 0, cipherData.Length);
90 |
91 | cs.Close();
92 |
93 | byte[] decryptedData = ms.ToArray();
94 | return decryptedData;
95 | }
96 |
97 | public static string Decrypt(string cipherText)
98 | {
99 | return Decrypt(cipherText, passWord);
100 | }
101 |
102 | public static string Decrypt(string cipherText, string Password)
103 | {
104 |
105 | byte[] cipherBytes = Convert.FromBase64String(cipherText);
106 |
107 | PasswordDeriveBytes pdb = new PasswordDeriveBytes(Password,
108 | new byte[] {0x49, 0x76, 0x61, 0x6e, 0x20, 0x4d, 0x65,
109 | 0x64, 0x76, 0x65, 0x64, 0x65, 0x76});
110 |
111 | byte[] decryptedData = Decrypt(cipherBytes,
112 | pdb.GetBytes(32), pdb.GetBytes(16));
113 |
114 | return System.Text.Encoding.Unicode.GetString(decryptedData);
115 | }
116 | }
117 | }
118 |
--------------------------------------------------------------------------------
/Tools/Tools.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | 8.0.30703
7 | 2.0
8 | {980CEAD6-A620-4CBA-997D-1C255BF8EF0D}
9 | Library
10 | Properties
11 | Tools
12 | Tools
13 | v4.0
14 | 512
15 |
16 |
17 | true
18 | full
19 | false
20 | ..\Release\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | pdbonly
27 | true
28 | bin\Release\
29 | TRACE
30 | prompt
31 | 4
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
56 |
--------------------------------------------------------------------------------
/help.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/grantgonggithub/CRM/2f026027b97bae878004d3e0dfac3ac0c147569a/help.png
--------------------------------------------------------------------------------
/qrcode.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/grantgonggithub/CRM/2f026027b97bae878004d3e0dfac3ac0c147569a/qrcode.png
--------------------------------------------------------------------------------