Exemple #1
0
        private void panel1_Click(object sender, EventArgs e)
        {
            try
            {
                foreach (Control c in this.Parent.Controls)
                {
                    if (c.Tag != null)
                    {
                        USynMin us = c as USynMin;
                        us.pictureBox2.Visible = false;
                        us.label1.ForeColor    = Color.Silver;
                        us.label2.ForeColor    = Color.Silver;
                    }
                }
                pictureBox2.Visible = true;
                label1.ForeColor    = Color.Black;
                label2.ForeColor    = Color.Black;
                db.SetPIVAsDB(string.Format("UPDATE [dbo].[SynSet] SET [SynTimeCode] = '{0}' WHERE [SynCode]='{1}'", Tag.ToString(), USynMinSet.SynCode).ToString());
                USynMinSet.SynTimeCode = Tag.ToString();
                switch (Tag.ToString())
                {
                case "1":
                {
                    label1.Text = "一次";
                    label2.Text = "每天定时执行一次同步";
                    label3.Text = "在" + (USynMinSet.begin.Contains(",") ? USynMinSet.begin.Split(',')[0] : USynMinSet.begin) + "点执行";
                    break;
                }

                case "2":
                {
                    label1.Text = "时段";
                    label2.Text = "每天的一个时间段内间隔执行同步";
                    label3.Text = "间隔" + USynMinSet.space + "分钟执行";
                    break;
                }

                case "3":
                {
                    label1.Text = "全天";
                    label2.Text = "全天间隔执行同步";
                    label3.Text = "间隔" + USynMinSet.space + "分钟执行";
                    break;
                }

                case "4":
                {
                    label1.Text         = "手动";
                    pictureBox1.Visible = false;
                    break;
                }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemple #2
0
        private void Create()
        {
            usso     = new USynMinSetOpen();
            uSynMin4 = new USynMin();
            uSynMin3 = new USynMin();
            uSynMin2 = new USynMin();
            uSynMin1 = new USynMin();

            usso.Location = new System.Drawing.Point(108, 53);
            usso.Name     = "usso";
            usso.TabIndex = 4;
            usso.Visible  = false;

            uSynMin4.BackColor       = System.Drawing.Color.Transparent;
            uSynMin4.BackgroundImage = SetSyn.Properties.Resources.mulv13;
            uSynMin4.Location        = new System.Drawing.Point(0, 165);
            uSynMin4.Margin          = new System.Windows.Forms.Padding(0);
            uSynMin4.Name            = "uSynMin4";
            uSynMin4.Size            = new System.Drawing.Size(349, 55);
            uSynMin4.TabIndex        = 3;
            uSynMin4.Tag             = "4";

            uSynMin3.Location = new System.Drawing.Point(0, 110);
            uSynMin3.Margin   = new System.Windows.Forms.Padding(0);
            uSynMin3.Name     = "uSynMin3";
            uSynMin3.Size     = new System.Drawing.Size(349, 55);
            uSynMin3.TabIndex = 2;
            uSynMin3.Tag      = "3";

            uSynMin2.Location = new System.Drawing.Point(0, 55);
            uSynMin2.Margin   = new System.Windows.Forms.Padding(0);
            uSynMin2.Name     = "uSynMin2";
            uSynMin2.Size     = new System.Drawing.Size(349, 55);
            uSynMin2.TabIndex = 1;
            uSynMin2.Tag      = "2";

            uSynMin1.BackColor       = System.Drawing.Color.Transparent;
            uSynMin1.BackgroundImage = SetSyn.Properties.Resources.mulv111;
            uSynMin1.Location        = new System.Drawing.Point(0, 0);
            uSynMin1.Margin          = new System.Windows.Forms.Padding(0);
            uSynMin1.Name            = "uSynMin1";
            uSynMin1.Size            = new System.Drawing.Size(349, 55);
            uSynMin1.TabIndex        = 0;
            uSynMin1.Tag             = "1";

            this.panel1.Controls.Add(this.usso);
            this.panel1.Controls.Add(this.uSynMin4);
            this.panel1.Controls.Add(this.uSynMin3);
            this.panel1.Controls.Add(this.uSynMin2);
            this.panel1.Controls.Add(this.uSynMin1);
        }