Пример #1
0
 //���ݿ���������
 private void SetButton_Click(object sender, EventArgs e)
 {
     ConnectServer connect = new ConnectServer();
     if (connect.ShowDialog() == DialogResult.OK)
     {
         string constr = connect.GetSqlStr();
         string jmconstr = TbrERPTools.EncodeBase64(constr);
         PropertyService.Set("sqlconfig", jmconstr);
         PropertyService.Save();
         CWData.ServerFactory.GetServer().ConnectionString = constr;
     }
 }
Пример #2
0
 private void LoadData()
 {
     string constr = PropertyService.Get("sqlconfig", "");
     constr = TbrERPTools.DecodeBase64(constr);
     if (constr == "" || !ConnectServer.isConnection(constr))
     {
         ConnectServer connect = new ConnectServer();
         if (connect.ShowDialog() == DialogResult.OK)
         {
             constr = connect.GetSqlStr();
             string jmconstr = TbrERPTools.EncodeBase64(constr);
             PropertyService.Set("sqlconfig", jmconstr);
             PropertyService.Save();
         }
         else
         {
             Application.Exit();
             return;
         }
     }
     CWData.ServerFactory.GetServer(CWData.ServerType.MasterDB).ConnectionString = constr;
     CWData.ServerFactory.GetServer().ConnectionString = constr;
 }