Ejemplo n.º 1
0
        public int UpdateRunMode(string runMode)
        {
            int mode = 0;

            try
            {
                int    count = 0;
                string Query = "SELECT Count(*) FROM Settings WHERE sname = 'runmode'";
                count = objAdaptor.ExecuteScalar(Query);
                string SqlQuery = "";
                if (count == 0)
                {
                    SqlQuery = "INSERT INTO Settings VALUES('RunMode','" + runMode + "','System.String')";
                }
                else
                {
                    SqlQuery = "UPDATE Settings SET svalue='" + runMode + "' WHERE sname = 'RunMode'";
                }

                mode = objAdaptor.ExecuteNonQueryRetRows(SqlQuery);
            }
            catch
            {
            }
            return(mode);
        }
Ejemplo n.º 2
0
        public int GetIBMConnectionTestsId(string tests)
        {
            int i;

            try
            {
                string sqlQuerry = "SELECT Id  from TestsMaster WHERE Tests = '" + tests + "'";
                i = objAdaptor.ExecuteScalar(sqlQuerry);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(i);
        }
Ejemplo n.º 3
0
        public void UpdateUserPreferences(string PreferenceName, string PreferenceValue, int UserID)
        {
            if (PreferenceName == "FilterBy")
            {
                PreferenceValue = PreferenceValue.Replace("'", "''");
            }
            //2/14/2013 NS modified
            int mode = 0;

            try
            {
                int    count = 0;
                string Query = "SELECT Count(*) FROM UserPreferences WHERE PreferenceName = '" + PreferenceName + "' and UserID =" + UserID;
                count = objAdaptor.ExecuteScalar(Query);
                string SqlQuery = "";
                if (count == 0)
                {
                    SqlQuery = "INSERT INTO UserPreferences VALUES('" + PreferenceName + "','" + PreferenceValue + "'," + UserID + ")";
                }
                else
                {
                    SqlQuery = "UPDATE UserPreferences SET PreferenceValue='" + PreferenceValue + "' WHERE PreferenceName = '" + PreferenceName + "' and UserID =" + UserID;
                }

                mode = objAdaptor.ExecuteNonQueryRetRows(SqlQuery);
                //SqlQuery = "SELECT * FROM UserPreferences WHERE UserID =" + UserID;
                //return objAdaptor.FetchData(SqlQuery);
            }



            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 4
0
        public bool UpdateScanvalue(string sname, string svalue, string stype)
        {
            //26/11/2014 Sowjanya modified
            bool UpdateRet = false;
            int  mode      = 0;

            try
            {
                if (sname != null && sname != "")
                {
                    int    count = 0;
                    string Query = "SELECT Count(*) FROM ScanSettings WHERE sname = '" + sname + "' and svalue='" + svalue + "'";
                    count = objAdaptor.ExecuteScalar(Query);
                    string SqlQuery = "";
                    if (count == 0)
                    {
                        SqlQuery = "INSERT INTO ScanSettings(sname,svalue,stype) VALUES('" + sname + "','" + svalue + "','" + stype + "')";
                        mode     = objAdaptor.ExecuteNonQueryRetRows(SqlQuery);
                    }
                    else
                    {
                        //SqlQuery = "UPDATE Settings SET svalue='" + svalue + "',stype ='" + stype + "' WHERE sname = '" + sname + "'";
                    }


                    if (mode == 1)
                    {
                        UpdateRet = true;
                    }
                }
            }
            catch
            {
            }
            return(UpdateRet);
        }
Ejemplo n.º 5
0
        public bool InsertLicense(License keyvalue)
        {
            DataTable licensekey = new DataTable();
            bool      UpdateRet  = false;
            int       mode       = 0;

            try
            {
                int count = 0;
                /* 4/27/2015 NS modified for VSPLUS-1700 */

                /*
                 * string Query = "SELECT Count(*) FROM License WHERE LicenseKey = '" + keyvalue.LicenseKey + "'";
                 * count = objAdaptor.ExecuteScalar(Query);
                 * string SqlQuery = "";
                 * if (count == 0)
                 * {
                 *  SqlQuery = "INSERT INTO License([LicenseKey],[Units],[InstallType],[CompanyName],[LicenseType],[ExpirationDate]) VALUES('" + keyvalue.LicenseKey + "'," +
                 *  " " + keyvalue.Units + ",'" + keyvalue.InstallType + "','" + keyvalue.CompanyName + "','" + keyvalue.LicenseType + "','" + keyvalue.ExpirationDate + "')";
                 * }
                 * else
                 * {
                 *  SqlQuery = "UPDATE License SET LicenseKey='" + keyvalue.LicenseKey + "',Units=" + keyvalue.Units + ",InstallType='" + keyvalue.InstallType + "',CompanyName='" + keyvalue.CompanyName + "'," +
                 *      "LicenseType='" + keyvalue.LicenseType + "',ExpirationDate='" + keyvalue.ExpirationDate + "'";
                 * }
                 */
                string Query = "SELECT Count(*) FROM License";
                count = objAdaptor.ExecuteScalar(Query);
                string SqlQuery = "";
                if (count != 0)
                {
                    SqlQuery = "DELETE FROM License";
                    objAdaptor.ExecuteNonQuery(SqlQuery);
                }
                SqlQuery = "INSERT INTO License([LicenseKey],[Units],[InstallType],[CompanyName],[LicenseType],[ExpirationDate]) VALUES('" + keyvalue.LicenseKey + "'," +
                           " " + keyvalue.Units + ",'" + keyvalue.InstallType + "','" + keyvalue.CompanyName + "','" + keyvalue.LicenseType + "','" + keyvalue.ExpirationDate + "')";
                mode = objAdaptor.ExecuteNonQueryRetRows(SqlQuery);
                if (mode == 1)
                {
                    licensekey = objAdaptor.FetchLicense("PR_EncDecLicense", false);
                    UpdateRet  = true;
                }
            }
            catch
            {
            }
            return(UpdateRet);
        }