Exemplo n.º 1
0
 private void MDIParent_Load(object sender, EventArgs e)
 {
     if (this.picEnter.Enabled)
     {
         this.lblDays.Text = "";
         DataSet dataSet = new DataSet();
         dataSet.ReadXml(Application.StartupPath + "\\p3.xml", XmlReadMode.ReadSchema);
         string text  = dataSet.Tables["t1"].Rows[0]["c3"].ToString();
         string text2 = dataSet.Tables["t1"].Rows[0]["c2"].ToString();
         clsMe  clsMe = new clsMe();
         text  = clsMe.Decrypt(text, "ja7z%$Or29W]", Encoding.Default);
         text2 = clsMe.Decrypt(text2, "ja7z%$Or29W]", Encoding.Default);
         text2 = text2.Substring(text2.IndexOf("%") + 1);
         this.lblPrompt.Text = text + "                    " + MDIParent.dsP.Tables["v"].Rows[0]["fxrq"].ToString();
         if (text2.CompareTo(MDIParent.dsP.Tables["v"].Rows[0]["ver"].ToString()) != 0)
         {
             MessageBox.Show(this, "数据文件和配置文件参数设置不一样,暂时无法提供查询服务!\r\n咨询电话:010-51268119!", "提示!", MessageBoxButtons.OK);
             File.Delete(Directory.GetCurrentDirectory() + "\\p3.xml");
             this.picEnter.Enabled = false;
             this.lblDays.Visible  = false;
         }
         else
         {
             if (MDIParent.dsP.Tables["v"].Rows[0]["fxrq"].ToString().CompareTo(text) > 0)
             {
                 MessageBox.Show(this, "您已过数据服务期限,暂时无法提供查询服务!\r\n咨询电话:010-51268119!", "提示!", MessageBoxButtons.OK);
                 this.picEnter.Enabled  = false;
                 this.lblDays.Visible   = false;
                 this.lblPrompt.Visible = false;
                 frmHao frmHao = new frmHao("");
                 MDIParent.SetParent(frmHao.Handle, MDIParent.MDIForm.Handle);
                 frmHao.Show();
             }
             else
             {
                 DateTime d     = Convert.ToDateTime(text);
                 DateTime today = DateTime.Today;
                 int      days  = (d - today).Days;
                 if (days <= 30)
                 {
                     this.pictureBox2.Visible = true;
                     this.lblDays.Text        = "急!最后" + days.ToString() + "天了!赶紧续费!";
                 }
                 else
                 {
                     if (days <= 60)
                     {
                         this.pictureBox2.Visible = true;
                         this.lblDays.Text        = "剩下" + days.ToString() + "天的时间了!该续费了!";
                     }
                     else
                     {
                         if (days <= 90)
                         {
                             this.pictureBox2.Visible = true;
                             this.lblDays.Text        = "还可以使用" + days.ToString() + "天!抓紧续费吧!";
                         }
                     }
                 }
             }
         }
         Rectangle rectangle = default(Rectangle);
         rectangle = Screen.GetWorkingArea(this);
         MDIParent.screen_width  = rectangle.Width;
         MDIParent.screen_height = rectangle.Height;
     }
     else
     {
         this.lblPrompt.Visible = false;
         this.lblDays.Visible   = false;
     }
 }
Exemplo n.º 2
0
 private void MDIParent_Load(object sender, EventArgs e)
 {
     if (this.picEnter.Enabled)
     {
         this.lblDays.Text = "";
         DataSet dataSet = new DataSet();
         dataSet.ReadXml(Application.StartupPath + "\\p3.xml", XmlReadMode.ReadSchema);
         string text = dataSet.Tables["t1"].Rows[0]["c3"].ToString();
         string text2 = dataSet.Tables["t1"].Rows[0]["c2"].ToString();
         clsMe clsMe = new clsMe();
         text = clsMe.Decrypt(text, "ja7z%$Or29W]", Encoding.Default);
         text2 = clsMe.Decrypt(text2, "ja7z%$Or29W]", Encoding.Default);
         text2 = text2.Substring(text2.IndexOf("%") + 1);
         this.lblPrompt.Text = text + "                    " + MDIParent.dsP.Tables["v"].Rows[0]["fxrq"].ToString();
         if (text2.CompareTo(MDIParent.dsP.Tables["v"].Rows[0]["ver"].ToString()) != 0)
         {
             MessageBox.Show(this, "数据文件和配置文件参数设置不一样,暂时无法提供查询服务!\r\n咨询电话:010-51268119!", "提示!", MessageBoxButtons.OK);
             File.Delete(Directory.GetCurrentDirectory() + "\\p3.xml");
             this.picEnter.Enabled = false;
             this.lblDays.Visible = false;
         }
         else
         {
             if (MDIParent.dsP.Tables["v"].Rows[0]["fxrq"].ToString().CompareTo(text) > 0)
             {
                 MessageBox.Show(this, "您已过数据服务期限,暂时无法提供查询服务!\r\n咨询电话:010-51268119!", "提示!", MessageBoxButtons.OK);
                 this.picEnter.Enabled = false;
                 this.lblDays.Visible = false;
                 this.lblPrompt.Visible = false;
                 frmHao frmHao = new frmHao("");
                 MDIParent.SetParent(frmHao.Handle, MDIParent.MDIForm.Handle);
                 frmHao.Show();
             }
             else
             {
                 DateTime d = Convert.ToDateTime(text);
                 DateTime today = DateTime.Today;
                 int days = (d - today).Days;
                 if (days <= 30)
                 {
                     this.pictureBox2.Visible = true;
                     this.lblDays.Text = "急!最后" + days.ToString() + "天了!赶紧续费!";
                 }
                 else
                 {
                     if (days <= 60)
                     {
                         this.pictureBox2.Visible = true;
                         this.lblDays.Text = "剩下" + days.ToString() + "天的时间了!该续费了!";
                     }
                     else
                     {
                         if (days <= 90)
                         {
                             this.pictureBox2.Visible = true;
                             this.lblDays.Text = "还可以使用" + days.ToString() + "天!抓紧续费吧!";
                         }
                     }
                 }
             }
         }
         Rectangle rectangle = default(Rectangle);
         rectangle = Screen.GetWorkingArea(this);
         MDIParent.screen_width = rectangle.Width;
         MDIParent.screen_height = rectangle.Height;
     }
     else
     {
         this.lblPrompt.Visible = false;
         this.lblDays.Visible = false;
     }
 }
Exemplo n.º 3
0
 private void navBarItemLinkClicked(object sender, NavBarLinkEventArgs e)
 {
     string a = e.Link.Caption.ToString().Trim();
     this.Cursor = Cursors.WaitCursor;
     if (a == "农药登记查询")
     {
         frmNY frm = new frmNY();
         this.OpenFrm(frm);
     }
     if (a == "生产企业=>农药")
     {
         frmQY2NY frm2 = new frmQY2NY();
         this.OpenFrm(frm2);
     }
     if (a == "作物对象=>农药")
     {
         frmZWFZDX2NY frm3 = new frmZWFZDX2NY();
         this.OpenFrm(frm3);
     }
     if (a == "农药单混剂查询")
     {
         frmNYDHJ frm4 = new frmNYDHJ();
         this.OpenFrm(frm4);
     }
     if (a == "临时转正式")
     {
         frmLS2ZS frm5 = new frmLS2ZS();
         this.OpenFrm(frm5);
     }
     if (a == "农药新命名规则")
     {
         frmNewDJMC frm6 = new frmNewDJMC();
         this.OpenFrm(frm6);
     }
     if (a == "农药有效性查询")
     {
         frmNYUsed frm7 = new frmNYUsed();
         this.OpenFrm(frm7);
     }
     if (a == "过期产品查询")
     {
         frmNYUnused frm8 = new frmNYUnused();
         this.OpenFrm(frm8);
     }
     if (a == "农药标签信息查询")
     {
         frmBQ frm9 = new frmBQ();
         this.OpenFrm(frm9);
     }
     if (a == "禁限用查询")
     {
         frmJXY frm10 = new frmJXY();
         this.OpenFrm(frm10);
     }
     if (a == "农药受理查询")
     {
         frmSLCP frm11 = new frmSLCP();
         this.OpenFrm(frm11);
     }
     if (a == "生产企业查询")
     {
         frmQY frm12 = new frmQY();
         this.OpenFrm(frm12);
     }
     if (a == "农药单位查询")
     {
         frmDW frm13 = new frmDW();
         this.OpenFrm(frm13);
     }
     if (a == "农药=>生产企业")
     {
         frmNY2QY frm14 = new frmNY2QY();
         this.OpenFrm(frm14);
     }
     if (a == "试验单位查询")
     {
         frmSYDW frm15 = new frmSYDW();
         this.OpenFrm(frm15);
     }
     if (a == "有效成分查询")
     {
         frmYXCF frm16 = new frmYXCF();
         this.OpenFrm(frm16);
     }
     if (a == "成分=>作物对象")
     {
         frmYXCF2ZWFZDX frm17 = new frmYXCF2ZWFZDX();
         this.OpenFrm(frm17);
     }
     if (a == "作物=>防治对象")
     {
         frmZW2FZDX frm18 = new frmZW2FZDX();
         this.OpenFrm(frm18);
     }
     if (a == "防治对象=>作物")
     {
         frmFZDX2ZW frm19 = new frmFZDX2ZW();
         this.OpenFrm(frm19);
     }
     if (a == "合理使用准则")
     {
         frmHLSYZZ frm20 = new frmHLSYZZ();
         this.OpenFrm(frm20);
     }
     if (a == "中毒与急救")
     {
         frmZD2JJ frm21 = new frmZD2JJ();
         this.OpenFrm(frm21);
     }
     if (a == "农药类别=>成分")
     {
         frmNYLB2YXCF frm22 = new frmNYLB2YXCF();
         this.OpenFrm(frm22);
     }
     if (a == "有效成分=>剂型")
     {
         frmYXCF2JX frm23 = new frmYXCF2JX();
         this.OpenFrm(frm23);
     }
     if (a == "环境毒性查询")
     {
         frmHJDX frm24 = new frmHJDX();
         this.OpenFrm(frm24);
     }
     if (a == "田间试验查询")
     {
         frmTJSY frm25 = new frmTJSY();
         this.OpenFrm(frm25);
     }
     if (a == "数据升级")
     {
         frmHao frmHao = new frmHao("");
         frmHao.ShowDialog();
     }
     if (a == "汇款信息")
     {
         clsCommon clsCommon = new clsCommon();
         clsCommon.RunProcess(Directory.GetCurrentDirectory() + "\\account.doc");
     }
     this.Cursor = Cursors.Default;
 }