C/S同步数据篇:
TODO:
关于同步数据篇:主要讲解理清业务思路,下一篇:同步数据(依据业务需求):【将数据库中sys_Menu数据添加到sys_Menu_Copy】
TODO:
1,表【sys_Menu_Copy】已存在数据,过滤
2,表【sys_Menu_Copy】未存在数据,添加
讲解篇:1,窗体设计器生成的代码2,后台cs代码:
1,窗体设计器生成的代码
namespace DataSynchronousBWokerUI
{
partial class MainForm
{
///
/// 必需的设计器变量。
///
private System.ComponentModel.IContainer components = null;
///
/// 清理所有正在使用的资源。
///
/// 如果应释放托管资源,为 true;否则为 false。
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows 窗体设计器生成的代码
///
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
///
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
this.label = new System.Windows.Forms.Label();
this.btStop = new System.Windows.Forms.Button();
this.btStart = new System.Windows.Forms.Button();
this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.listBox1 = new System.Windows.Forms.ListBox();
this.progressBar1 = new System.Windows.Forms.ProgressBar();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.tableLayoutPanel1.SuspendLayout();
this.SuspendLayout();
//
// label
//
this.label.AutoSize = true;
this.label.Location = new System.Drawing.Point(170, 67);
this.label.Name = "label";
this.label.Size = new System.Drawing.Size(0, 12);
this.label.TabIndex = 13;
//
// btStop
//
this.btStop.Anchor = System.Windows.Forms.AnchorStyles.None;
this.btStop.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btStop.BackgroundImage")));
this.btStop.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btStop.Location = new System.Drawing.Point(212, 53);
this.btStop.Name = "btStop";
this.btStop.Size = new System.Drawing.Size(203, 44);
this.btStop.TabIndex = 12;
this.btStop.Text = "取消同步";
this.btStop.Click += new System.EventHandler(this.btStop_Click);
//
// btStart
//
this.btStart.Anchor = System.Windows.Forms.AnchorStyles.None;
this.btStart.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btStart.BackgroundImage")));
this.btStart.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btStart.Location = new System.Drawing.Point(3, 53);
this.btStart.Name = "btStart";
this.btStart.Size = new System.Drawing.Size(203, 44);
this.btStart.TabIndex = 11;
this.btStart.Text = "同步数据";
this.btStart.Click += new System.EventHandler(this.btStart_Click);
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(33, 143);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(0, 12);
this.label4.TabIndex = 14;
//
// label5
//
this.label5.AutoSize = true;
this.label5.Image = ((System.Drawing.Image)(resources.GetObject("label5.Image")));
this.label5.Location = new System.Drawing.Point(122, 142);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(0, 12);
thi