예제 #1
0
파일: Form1.cs 프로젝트: wwkkww1983/yh
        private void Form1_Load(object sender, System.EventArgs e)
        {
            CAutoBackup cab = new CAutoBackup();

            if (this.m_sCon == null)
            {
                cab.iniCon();
                this.m_sCon = CAutoBackup.m_sCon;
            }
            else
            {
                CAutoBackup.m_sCon = this.m_sCon;
            }
            string strFileName = "";

            cab.getFileName(ref strFileName);
            this.txtFileName.Text = strFileName;
            if (this.txtFileName.Text.Trim() == "")
            {
                this.chkAutoBack.Checked = false;
            }
            else

            {
                this.chkAutoBack.Checked = true;
            }
        }
예제 #2
0
파일: Form1.cs 프로젝트: wwkkww1983/yh
 //设置自动备份的路径
 private bool setFileName()
 {
     try
     {
         CAutoBackup cab    = new CAutoBackup();
         string      strErr = "";
         if (cab.backUp(CAutoBackup.m_sCon.Database, this.txtFileName.Text.Trim(), ref strErr) == false)
         {
             return(false);
         }
         if (cab.bSetFileName(CAutoBackup.m_sCon.Database, this.txtFileName.Text.Trim()) == false)
         {
             return(false);
         }
         return(true);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
         return(false);
     }
 }
예제 #3
0
파일: frmWaterSys.cs 프로젝트: hkiaipc/yh
 private void execTime(string strName)
 {
     try
     {
         string strErr="";
         string strFileName="";
         if(strName=="backUp")
         {
             BengZhan.AutoBackup.CAutoBackup cab=new CAutoBackup();
             cab.backUp(ref strErr,ref strFileName);
         }
     }
     catch(Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
예제 #4
0
파일: frmWaterSys.cs 프로젝트: hkiaipc/yh
        private void autoBackup()
        {
            try
            {
                XmlDocument xDoc=new XmlDocument();
                xDoc.Load("Server.xml");
                string strCon=xDoc.DocumentElement.SelectSingleNode("./strCon").InnerText.Trim();
                SqlConnection sConEx=new   SqlConnection(strCon);
                sConEx.Open();

                BengZhan.AutoBackup.CAutoBackup cab=new BengZhan.AutoBackup.CAutoBackup();
                BengZhan.AutoBackup.CAutoBackup.m_sCon=sConEx;
                this.Cursor=Cursors.WaitCursor;
                cab.autoBackup();
                this.Cursor=Cursors.Default;
            }
            catch(Exception ex)
            {
                this.Cursor=Cursors.Default;
                MessageBox.Show(ex.ToString());
            }
        }
예제 #5
0
파일: frmWaterSys.cs 프로젝트: hkiaipc/yh
        private void mnuDbUp_Click(object sender, System.EventArgs e)
        {
            XmlDocument xDoc=new XmlDocument();
            xDoc.Load("Info.xml");

            string strBUp=xDoc.DocumentElement.SelectSingleNode("./bUp").Attributes.GetNamedItem("val").Value.ToString().Trim();

            if(strBUp=="false")
            {
                MessageBox.Show("�����ݿ�汾�Ѿ������£�����Ҫ������");
                return;
            }

                        CAutoBackup cab=new CAutoBackup();
                        cab.iniCon();
                        if(cab.executeSqlFile("delTable.sql")==true)
                        {
                            MessageBox.Show("������ɣ�");
                        }
            xDoc.DocumentElement.SelectSingleNode("./bUp").Attributes.GetNamedItem("val").Value="true";
            xDoc.Save("info.xml");
        }
예제 #6
0
파일: Form1.cs 프로젝트: hkiaipc/yh
        //�����Զ����ݵ�·��
        private bool setFileName()
        {
            try
            {

                CAutoBackup cab=new CAutoBackup();
                string strErr="";
                if(cab.backUp(CAutoBackup.m_sCon.Database,this.txtFileName.Text.Trim(),ref strErr)==false)
                {
                    return false;
                }
                if(cab.bSetFileName(CAutoBackup.m_sCon.Database,this.txtFileName.Text.Trim())==false)
                {
                    return false;
                }
                return true;
            }
            catch(Exception ex)
            {
                MessageBox.Show(ex.ToString());
                return false;
            }
        }
예제 #7
0
파일: Form1.cs 프로젝트: hkiaipc/yh
        private void Form1_Load(object sender, System.EventArgs e)
        {
            CAutoBackup cab=new CAutoBackup();
            if(this.m_sCon==null)
            {
                cab.iniCon();
                this.m_sCon=CAutoBackup.m_sCon;
            }
            else
            {
                CAutoBackup.m_sCon=this.m_sCon;
            }
            string strFileName="";
            cab.getFileName(ref strFileName);
            this.txtFileName.Text=strFileName;
            if(this.txtFileName.Text.Trim()=="")
            {
                this.chkAutoBack.Checked=false;
            }
            else

            {
                this.chkAutoBack.Checked=true;
            }
        }