コード例 #1
0
ファイル: ELSDAL.cs プロジェクト: ImranVS/SVNGIT
        public bool InsertData(ELSMaster LOCbject)
        {
            bool Insert = false;

            try
            {
                DataTable eventsdt = new DataTable();
                string    sqlquery = "select * from ELSMaster where AliasName = '" + LOCbject.AliasName + "'";
                eventsdt = objAdaptor.FetchData(sqlquery);
                if (eventsdt.Rows.Count > 0)
                {
                    Insert = false;
                }
                else
                {
                    string SqlQuery = "INSERT INTO ELSMaster (AliasName,EventName,EventId,EventKey,Source,TaskCategory,EventLevel) VALUES('" + LOCbject.AliasName + "','" + LOCbject.EventName + "','" + LOCbject.EventId + "','" + LOCbject.EventKey + "','" + LOCbject.Source + "','" + LOCbject.TaskCategory + "','" + LOCbject.EventLevel + "')";
                    Insert = objAdaptor.ExecuteNonQuery(SqlQuery);
                }
            }
            catch
            {
                Insert = false;
            }
            finally
            {
            }
            return(Insert);
        }
コード例 #2
0
ファイル: ELS_Edit.aspx.cs プロジェクト: ImranVS/SVNGIT
        private ELSMaster CollectDataForELS(string Mode, DataRow ELSRow)
        {
            VSFramework.TripleDES tripleDes = new VSFramework.TripleDES();
            try
            {
                ELSMaster EventMasterObject = new ELSMaster();
                EventMasterObject.EventName = ELSRow["EventName"].ToString();
                EventMasterObject.AliasName = ELSRow["AliasName"].ToString();
                Session["ELSUpdateStatus"]  = EventMasterObject.AliasName;
                EventMasterObject.EventKey  = ELSRow["EventKey"].ToString();

                EventMasterObject.EventId    = ELSRow["EventId"].ToString();
                EventMasterObject.EventLevel = ELSRow["EventLevel"].ToString();

                EventMasterObject.Source       = ELSRow["Source"].ToString();
                EventMasterObject.TaskCategory = ELSRow["TaskCategory"].ToString();

                if (Mode == "Update")
                {
                    EventMasterObject.ID = int.Parse(ELSRow["ID"].ToString());
                }

                return(EventMasterObject);
            }
            catch (Exception ex)
            {
                Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex);
                throw ex;
            }
            finally { }
        }
コード例 #3
0
ファイル: ELSBL.cs プロジェクト: ImranVS/SVNGIT
 public DataTable getCredentialsById(ELSMaster LocObject)
 {
     try
     {
         return(VSWebDAL.ConfiguratorDAL.ELSDAL.Ins.GetDataForCredentialsById(LocObject));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #4
0
ファイル: ELSBL.cs プロジェクト: ImranVS/SVNGIT
 /// <summary>
 /// Call DAL Delete Data
 /// </summary>
 /// <param name="LocObject"></param>
 /// <returns></returns>
 public Object DeleteData(ELSMaster LocObject)
 {
     try
     {
         return(VSWebDAL.ConfiguratorDAL.ELSDAL.Ins.DeleteData(LocObject));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #5
0
ファイル: ELS_Edit.aspx.cs プロジェクト: ImranVS/SVNGIT
        protected void ELSGridView_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
        {
            ELSMaster LocObject = new ELSMaster();

            LocObject.ID = Convert.ToInt32(e.Keys[0]);

            Object ReturnValue = VSWebBL.ConfiguratorBL.ELSBL.Ins.DeleteData(LocObject);

            ASPxGridView gridView = (ASPxGridView)sender;

            gridView.CancelEdit();
            e.Cancel = true;
            fillData(EventKey);
            FillELSGrid();
        }
コード例 #6
0
ファイル: ELSBL.cs プロジェクト: ImranVS/SVNGIT
        public Object ValidateUpdate(ELSMaster LocObject)
        {
            Object ReturnValue = "";

            try
            {
                if (LocObject.EventLevel == null || LocObject.EventLevel == "")
                {
                    return("ER#Please enter the Event Level");
                }
            }
            catch (Exception ex)
            { throw ex; }
            finally
            { }
            return("");
        }
コード例 #7
0
ファイル: ELSDAL.cs プロジェクト: ImranVS/SVNGIT
        public DataTable GetDataForELSByname(ELSMaster LOCbject)
        {
            DataTable LocationsDataTable = new DataTable();

            try
            {
                string SqlQuery = "Select * from ELSMaster where ID ='" + LOCbject.ID + "'";
                LocationsDataTable = objAdaptor.FetchData(SqlQuery);
                //populate & return data object
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
            }
            return(LocationsDataTable);
        }
コード例 #8
0
ファイル: ELSDAL.cs プロジェクト: ImranVS/SVNGIT
        public DataTable GetDataForCredentialsById(ELSMaster LOCbject)
        {
            DataTable LocationsDataTable = new DataTable();

            try
            {
                //string SqlQuery = "Select * from Credentials where AliasName='" + LOCbject.AliasName + "'";
                string SqlQuery = "Select * from ELSMaster where ID=" + LOCbject.ID;
                LocationsDataTable = objAdaptor.FetchData(SqlQuery);
                //populate & return data object
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
            }
            return(LocationsDataTable);
        }
コード例 #9
0
ファイル: ELSDAL.cs プロジェクト: ImranVS/SVNGIT
        public bool UpdateData(ELSMaster LOCbject)
        {
            string SqlQuery = "";
            bool   Update;

            try
            {
                //7/10/2015 NS modified for VSPLUS-1985
                //if (LOCbject.Password == "      ")

                SqlQuery = "UPDATE ELSMaster SET AliasName='" + LOCbject.AliasName + "', EventId='" + LOCbject.EventId + "',EventKey='" + LOCbject.EventKey + "', Source='" + LOCbject.Source + "', TaskCategory='" + LOCbject.TaskCategory + "',EventName='" + LOCbject.EventName + "',EventLevel='" + LOCbject.EventLevel + "' WHERE ID = " + LOCbject.ID + "";
                Update   = objAdaptor.ExecuteNonQuery(SqlQuery);
            }
            catch
            {
                Update = false;
            }
            finally
            {
            }
            return(Update);
        }
コード例 #10
0
ファイル: ELSBL.cs プロジェクト: ImranVS/SVNGIT
        /// <summary>
        /// Call to Update Data of DominoServers based on Key
        /// </summary>
        /// <param name="LocObject">DominoServers object</param>
        /// <returns>Object</returns>
        public bool UpdateData(ELSMaster LocObject)
        {
            bool update = false;

            try
            {
                Object    ReturnValue = ValidateUpdate(LocObject);
                DataTable value       = VSWebDAL.ConfiguratorDAL.ELSDAL.Ins.GetDataForELSByname(LocObject);

                if (value.Rows.Count > 0)
                {
                    string name = value.Rows[0]["AliasName"].ToString();
                    if (ReturnValue.ToString() == "")
                    {
                        if (name != LocObject.AliasName)
                        {
                            update = VSWebDAL.ConfiguratorDAL.ELSDAL.Ins.UpdateData(LocObject);
                        }
                        else
                        {
                            update = false;
                        }
                    }
                    else
                    {
                        return(update);
                    }
                }
                else
                {
                    return(update);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(update);
        }
コード例 #11
0
ファイル: ELSDAL.cs プロジェクト: ImranVS/SVNGIT
        public Object DeleteData(ELSMaster LOCbject)
        {
            Object Update;

            try
            {
                string SqlQuery = "Delete from ELSMaster Where ID=" + LOCbject.ID;

                Update = objAdaptor.ExecuteNonQuery(SqlQuery);

                SqlQuery = "Delete from ELSDetail Where ELSId=" + LOCbject.ID;

                Update = objAdaptor.ExecuteNonQuery(SqlQuery);
            }
            catch
            {
                Update = false;
            }
            finally
            {
            }
            return(Update);
        }
コード例 #12
0
ファイル: ELSBL.cs プロジェクト: ImranVS/SVNGIT
 /// <summary>
 /// Call to Insert Data into Alias
 ///  </summary>
 /// <param name="LocObject">Alias object</param>
 /// <returns></returns>
 public object InsertData(ELSMaster LocObject)
 {
     try
     {
         //Object ReturnValue = ValidateUpdate(LocObject);
         DataTable value = VSWebDAL.ConfiguratorDAL.ELSDAL.Ins.GetDataForELSByname(LocObject);
         if (value.Rows.Count == 0)
         {
             //if (ReturnValue.ToString() == "")
             //{
             return(VSWebDAL.ConfiguratorDAL.ELSDAL.Ins.InsertData(LocObject));
             //}
             //else return ReturnValue;
         }
         else
         {
             return("");
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }