Exemplo n.º 1
0
        private bool CheckandInjectCode(clsVariableSettings cvs)
        {
            bool result = false;

            try
            {
                string SQLSelectSystemInfo = "select Count(*) from tbl_system_info where isEnabled = 1 and ProgramCode='" + cv.Crypt(programname) + "' and LicenseCode = '" + cvs.LicenseCode + "' and ActivationCode = '" + cvs.ActivationCode + "'";
                cdt = new clsDatabaseTransactions();
                DataTable dtResult    = cdt.SelectData(SQLSelectSystemInfo);
                int       RowAffected = dtResult.Rows.Count;
                RowAffected = RowAffected == 1 ? int.Parse(dtResult.Rows[0][0].ToString()) : 0;
                if (RowAffected == 0)
                {
                    string SQLInsertSystemInfo = "Insert into tbl_system_info(ProgramCode,LicenseCode,ActivationCode)" + " Values ('" + cv.Crypt(programname) + "','" + cvs.LicenseCode + "','" + cvs.ActivationCode + "')";
                    result = cdt.InsertData(SQLInsertSystemInfo);
                }
                else
                {
                    result = true;
                }
            }
            catch
            {
            }
            return(result);
        }
Exemplo n.º 2
0
 private void GetDBSettings()
 {
     tmrLoading.Stop();
     try
     {
         cvs = new clsVariableSettings();
         cvs = cv.ValidateIni();
         if (cvs != null)
         {
             Servername   = cvs.ServerName;
             Databasename = cvs.DatabaseName;
             DBUsername   = cvs.UserName;
             DBPassword   = cvs.Password;
             SystemName   = cvs.SystemCode;
         }
     }
     catch
     {
     }
     tmrLoading.Start();
 }
        private void LoadINI()
        {
            try
            {
                cvs = new clsVariableSettings();
                cvs = cv.ValidateIni();
                if (cvs != null)
                {
                    tbCompanyName.Text = cvs.CompanyName;
                    tbLicense.Text     = cvs.LicenseCode;
                    tbActivation.Text  = cvs.ActivationCode;

                    tbServerName.Text   = cvs.ServerName;
                    tbDatabasename.Text = cvs.DatabaseName;
                    tbDBUsername.Text   = cvs.UserName;
                    tbDBPassword.Text   = cvs.Password;
                }
            }
            catch
            {
            }
        }