Exemple #1
0
        /// <summary>
        /// Insert data into NotesDatabases table
        /// </summary>
        /// <param name="DSObject">NotesDatabases object</param>
        /// <returns></returns>

        public bool InsertData(NotesDatabases NDObject)
        {
            bool Insert = false;
            //1/15/2016 NS modified for VSPLUS-2501
            int paramnum = 0;

            string[] paramnames  = new string[16];
            string[] paramvalues = new string[16];
            try
            {
                paramnum        = 16;
                paramnames[0]   = "@name";
                paramnames[1]   = "@category";
                paramnames[2]   = "@scaninterval";
                paramnames[3]   = "@offhrscaninterval";
                paramnames[4]   = "@serverid";
                paramnames[5]   = "@enabled";
                paramnames[6]   = "@respthreshold";
                paramnames[7]   = "@retryinterval";
                paramnames[8]   = "@servername";
                paramnames[9]   = "@filename";
                paramnames[10]  = "@triggertype";
                paramnames[11]  = "@triggerval";
                paramnames[12]  = "@abovebelow";
                paramnames[13]  = "@repdest";
                paramnames[14]  = "@initrep";
                paramnames[15]  = "@id";
                paramvalues[0]  = NDObject.Name;
                paramvalues[1]  = NDObject.Category;
                paramvalues[2]  = Convert.ToString(NDObject.ScanInterval);
                paramvalues[3]  = Convert.ToString(NDObject.OffHoursScanInterval);
                paramvalues[4]  = Convert.ToString(NDObject.ServerID);
                paramvalues[5]  = Convert.ToString(NDObject.Enabled);
                paramvalues[6]  = Convert.ToString(NDObject.ResponseThreshold);
                paramvalues[7]  = Convert.ToString(NDObject.RetryInterval);
                paramvalues[8]  = NDObject.ServerName;
                paramvalues[9]  = NDObject.FileName;
                paramvalues[10] = NDObject.TriggerType;
                paramvalues[11] = Convert.ToString(NDObject.TriggerValue);
                paramvalues[12] = NDObject.AboveBelow;
                paramvalues[13] = NDObject.ReplicationDestination;
                paramvalues[14] = Convert.ToString(NDObject.InitiateReplication);
                paramvalues[15] = Convert.ToString(NDObject.ID);
                string SqlQuery = "INSERT INTO NotesDatabases (Name,Category,ScanInterval,OffHoursScanInterval,Enabled,ResponseThreshold" +
                                  ",RetryInterval,ServerID,ServerName,FileName,TriggerType,TriggerValue,AboveBelow,ReplicationDestination,InitiateReplication)" +
                                  "VALUES(" + paramnames[0] + "," + paramnames[1] + "," + paramnames[2] + "," + paramnames[3] +
                                  "," + paramnames[5] + "," + paramnames[6] + "," + paramnames[7] + "," + paramnames[4] + "," + paramnames[8] + "," + paramnames[9] +
                                  "," + paramnames[10] + "," + paramnames[11] + "," + paramnames[12] + "," + paramnames[13] +
                                  "," + paramnames[14] + ")";


                Insert = objAdaptor.ExecuteQueryWithParams(SqlQuery, paramnum, paramnames, paramvalues);
            }
            catch
            {
                Insert = false;
            }
            return(Insert);
        }
Exemple #2
0
        //public DataTable GetDataForELSByname(LogFile LOCbject)
        //{
        //    DataTable LocationsDataTable = new DataTable();
        //    try
        //    {
        //        string SqlQuery = "Select * from LogFile where AliasName='" + LOCbject.AliasName + "'";
        //        LocationsDataTable = objAdaptor.FetchData(SqlQuery);
        //        //populate & return data object
        //    }
        //    catch (Exception ex)
        //    {
        //        throw ex;
        //    }
        //    finally
        //    {
        //    }
        //    return LocationsDataTable;
        //}
        //public bool InsertData(LogFile LOgbject)
        //{

        //	bool Insert = false;
        //	try
        //	{
        //		string SqlQuery = "INSERT INTO [LogFile] (Keyword,RepeatOnce,Log,AgentLog,NotRequiredKeyword,DominoEventLogId) VALUES('" + LOgbject.Keyword + "','" + LOgbject.RepeatOnce + "','" + LOgbject.Log + "','" + LOgbject.AgentLog + "','" + LOgbject.NotRequiredKeyword + "'," + LOgbject.DominoEventLogId + ")";
        //		Insert = objAdaptor.ExecuteNonQuery(SqlQuery);
        //	}
        //	catch
        //	{
        //		Insert = false;
        //	}
        //	finally
        //	{
        //	}
        //	return Insert;
        //}


        public bool InsertData(LogFile LOgbject)
        {
            //7/22/2016 Sowjanya modified for VSPLUS-3128
            bool Insert = false;

            int paramnum = 0;

            string[] paramnames  = new string[6];
            string[] paramvalues = new string[6];
            try
            {
                paramnum      = 6;
                paramnames[0] = "@Keyword";
                paramnames[1] = "@RepeatOnce";
                paramnames[2] = "@Log";
                paramnames[3] = "@AgentLog";
                paramnames[4] = "@NotRequiredKeyword";
                paramnames[5] = "@DominoEventLogId";


                paramvalues[0] = LOgbject.Keyword;
                paramvalues[1] = Convert.ToString(LOgbject.RepeatOnce);
                paramvalues[2] = Convert.ToString(LOgbject.Log);
                paramvalues[3] = Convert.ToString(LOgbject.AgentLog);
                paramvalues[4] = LOgbject.NotRequiredKeyword;
                paramvalues[5] = Convert.ToString(LOgbject.DominoEventLogId);

                string SqlQuery = "INSERT INTO LogFile (Keyword,RepeatOnce,Log,AgentLog,NotRequiredKeyword,DominoEventLogId)" +

                                  "VALUES(" + paramnames[0] + "," + paramnames[1] + "," + paramnames[2] + "," + paramnames[3] + "," + paramnames[4] + "," + paramnames[5] + ")";



                Insert = objAdaptor.ExecuteQueryWithParams(SqlQuery, paramnum, paramnames, paramvalues);
            }
            catch
            {
                Insert = false;
            }
            finally
            {
            }
            return(Insert);
        }
Exemple #3
0
        /// <summary>
        /// Insert data into Locations table
        /// </summary>
        /// <param name="DSObject">Locations object</param>
        /// <returns></returns>

        public bool InsertData(Locations LOCbject)
        {
            //4/5/2016 Sowjanya modified for VSPLUS-2497
            bool Insert = false;

            int paramnum = 0;

            string[] paramnames  = new string[4];
            string[] paramvalues = new string[4];
            try
            {
                paramnum      = 4;
                paramnames[0] = "@Location";
                paramnames[1] = "@Country";
                paramnames[2] = "@State";
                paramnames[3] = "@City";


                paramvalues[0] = LOCbject.Location;
                paramvalues[1] = LOCbject.Country;
                paramvalues[2] = LOCbject.State;
                paramvalues[3] = LOCbject.City;

                string SqlQuery = "INSERT INTO Locations (Location,Country,State,City)" +

                                  "VALUES(" + paramnames[0] + "," + paramnames[1] + "," + paramnames[2] + "," + paramnames[3] + ")";



                Insert = objAdaptor.ExecuteQueryWithParams(SqlQuery, paramnum, paramnames, paramvalues);
            }
            catch
            {
                Insert = false;
            }
            finally
            {
            }
            return(Insert);
        }