Esempio n. 1
0
        private static string Save(NotificationPublisherXEventTypeDataModel data, RequestProfile requestProfile, string action)
        {
            var sql = "EXEC ";

            switch (action)
            {
            case "Create":
                sql += "dbo.NotificationPublisherXEventTypeInsert  " +
                       " " + ToSQLParameter(BaseDataModel.BaseDataColumns.AuditId, requestProfile.AuditId) +
                       ", " + ToSQLParameter(BaseDataModel.BaseDataColumns.ApplicationId, requestProfile.ApplicationId);
                break;

            case "Update":
                sql += "dbo.NotificationPublisherXEventTypeUpdate  " +
                       " " + ToSQLParameter(BaseDataModel.BaseDataColumns.AuditId, requestProfile.AuditId) +
                       ", " + ToSQLParameter(BaseDataModel.BaseDataColumns.ApplicationId, requestProfile.ApplicationId);
                break;

            default:
                break;
            }

            sql = sql + ", " + ToSQLParameter(data, NotificationPublisherXEventTypeDataModel.DataColumns.NotificationPublisherXEventTypeId) +
                  ", " + ToSQLParameter(data, NotificationPublisherXEventTypeDataModel.DataColumns.NotificationPublisherId) +
                  ", " + ToSQLParameter(data, NotificationPublisherXEventTypeDataModel.DataColumns.NotificationEventTypeId);

            return(sql);
        }
Esempio n. 2
0
        public static List <NotificationPublisherXEventTypeDataModel> GetEntityList(NotificationPublisherXEventTypeDataModel dataQuery, RequestProfile requestProfile, int returnAuditInfo = BaseDataManager.ReturnAuditInfoOnDetails)
        {
            const string sql = @"dbo.NotificationPublisherXEventTypeSearch ";

            var parameters =
                new
            {
                AuditId         = requestProfile.AuditId
                , ApplicationId = requestProfile.ApplicationId
                , NotificationPublisherXEventTypeId = dataQuery.NotificationPublisherXEventTypeId
                , ReturnAuditInfo         = returnAuditInfo
                , ApplicationMode         = requestProfile.ApplicationModeId
                , NotificationPublisherId = dataQuery.NotificationPublisherId
                , NotificationEventTypeId = dataQuery.NotificationEventTypeId
                , CreatedDateId           = dataQuery.CreatedDateId
                , CreatedTimeId           = dataQuery.CreatedTimeId
            };

            List <NotificationPublisherXEventTypeDataModel> result;

            using (var dataAccess = new DataAccessBase(DataStoreKey))
            {
                result = dataAccess.Connection.Query <NotificationPublisherXEventTypeDataModel>(sql, parameters, commandType: CommandType.StoredProcedure).ToList();
            }


            return(result);
        }
Esempio n. 3
0
        protected override void ShowData(int notificationPublisherXEventTypeId)
        {
            oDetailButtonPanel.SetId = SetId;

            var dataQuery = new NotificationPublisherXEventTypeDataModel();

            dataQuery.NotificationPublisherXEventTypeId = notificationPublisherXEventTypeId;

            var entityList = Framework.Components.EventMonitoring.NotificationPublisherXEventTypeDataManager.GetEntityList(dataQuery, SessionVariables.RequestProfile);

            if (entityList.Count == 1)
            {
                foreach (var entityItem in entityList)
                {
                    lblNotificationPublisherXEventTypeId.Text = entityItem.NotificationPublisherXEventTypeId.ToString();
                    lblNotificationEventType.Text             = entityItem.NotificationEventTypeId.ToString();
                    lblNotificationPublisher.Text             = entityItem.NotificationPublisherId.ToString();
                    lblCreatedDateId.Text = entityItem.CreatedDateId.ToString() + entityItem.CreatedTimeId.ToString();

                    oUpdateInfo.LoadText(entityItem.UpdatedDate, entityItem.UpdatedBy, entityItem.LastAction);

                    oHistoryList.Setup((int)Framework.Components.DataAccess.SystemEntity.NotificationPublisherXEventType, notificationPublisherXEventTypeId, "NotificationPublisherXEventType");
                    dynAuditHistory.Visible = PerferenceUtility.GetUserPreferenceByKeyAsBoolean(ApplicationCommon.HistoryGridVisibilityKey, "NotificationPublisherXEventType");
                }
            }
            else
            {
                Clear();
            }
        }
Esempio n. 4
0
        private DataTable GetData(string name)
        {
            var data = new NotificationPublisherXEventTypeDataModel();
            var dt   = Framework.Components.EventMonitoring.NotificationPublisherXEventTypeDataManager.Search(data, SessionVariables.RequestProfile);

            return(dt);
        }
Esempio n. 5
0
        public static DataTable Search(NotificationPublisherXEventTypeDataModel data, RequestProfile requestProfile)
        {
            var list = GetEntityList(data, requestProfile, 0);

            var table = list.ToDataTable();

            return(table);
        }
Esempio n. 6
0
        private System.Data.DataTable GetData()
        {
            // TODO: on all export pages
            var data = new NotificationPublisherXEventTypeDataModel();

            var dt = Framework.Components.EventMonitoring.NotificationPublisherXEventTypeDataManager.Search(data, SessionVariables.RequestProfile);

            return(dt);
        }
Esempio n. 7
0
        protected override DataTable GetEntityData(int?entityKey)
        {
            var notificationPublisherXEventTypedata = new NotificationPublisherXEventTypeDataModel();

            notificationPublisherXEventTypedata.NotificationPublisherXEventTypeId = entityKey;
            var results = Framework.Components.EventMonitoring.NotificationPublisherXEventTypeDataManager.Search(notificationPublisherXEventTypedata, SessionVariables.RequestProfile);

            return(results);
        }
Esempio n. 8
0
        private void Update(Dictionary <string, string> values)
        {
            var data = new NotificationPublisherXEventTypeDataModel();

            data.NotificationPublisherXEventTypeId = int.Parse(values[NotificationPublisherXEventTypeDataModel.DataColumns.NotificationPublisherXEventTypeId].ToString());
            data.NotificationPublisherId           = int.Parse(values[NotificationPublisherXEventTypeDataModel.DataColumns.NotificationPublisherId].ToString());
            data.NotificationEventTypeId           = int.Parse(values[NotificationPublisherXEventTypeDataModel.DataColumns.NotificationEventTypeId].ToString());
            //data.CreatedDateId = int.Parse(values[NotificationPublisherXEventTypeDataModel.DataColumns.CreatedDateId].ToString());
            Framework.Components.EventMonitoring.NotificationPublisherXEventTypeDataManager.Update(data, SessionVariables.RequestProfile);
            InlineEditingList.Data = GetData();
        }
Esempio n. 9
0
        protected void InsertData()
        {
            var data = new NotificationPublisherXEventTypeDataModel();

            data.NotificationPublisherXEventTypeId = myGenericControl.NotificationPublisherXEventTypeId;
            data.NotificationPublisherId           = myGenericControl.NotificationPublisherId;
            data.NotificationEventTypeId           = myGenericControl.NotificationEventTypeId;
            data.CreatedDateId = myGenericControl.CreatedDateId;
            data.CreatedTimeId = myGenericControl.CreatedTimeId;

            Framework.Components.EventMonitoring.NotificationPublisherXEventTypeDataManager.Create(data, SessionVariables.RequestProfile);
        }
Esempio n. 10
0
        public static DataTable DoesExist(NotificationPublisherXEventTypeDataModel data, RequestProfile requestProfile)
        {
            var sql = "EXEC dbo.NotificationPublisherXEventTypeSearch " +
                      " " + ToSQLParameter(BaseDataModel.BaseDataColumns.AuditId, requestProfile.AuditId) +
                      ", " + ToSQLParameter(BaseDataModel.BaseDataColumns.ApplicationId, requestProfile.ApplicationId) +
                      ", " + ToSQLParameter(data, NotificationPublisherXEventTypeDataModel.DataColumns.NotificationPublisherXEventTypeId);


            var oDT = new Framework.Components.DataAccess.DBDataTable("NotificationPublisherXEventType.DoesExist", sql, DataStoreKey);

            return(oDT.DBTable);
        }
Esempio n. 11
0
        public void LoadData(int notificationPublisherXEventTypeid, bool showId)
        {
            var dataQuery = new NotificationPublisherXEventTypeDataModel();

            dataQuery.NotificationPublisherXEventTypeId = notificationPublisherXEventTypeid;

            var entityList = Framework.Components.EventMonitoring.NotificationPublisherXEventTypeDataManager.GetEntityList(dataQuery, SessionVariables.RequestProfile);


            if (entityList.Count == 1)
            {
                foreach (var entityItem in entityList)
                {
                    if (!showId)
                    {
                        txtNotificationPublisherXEventTypeId.Text = entityItem.NotificationPublisherXEventTypeId.ToString();
                        oHistoryList.Setup((int)Framework.Components.DataAccess.SystemEntity.NotificationPublisherXEventType, notificationPublisherXEventTypeid, "NotificationPublisherXEventType");
                        dynAuditHistory.Visible = PerferenceUtility.GetUserPreferenceByKeyAsBoolean(ApplicationCommon.HistoryGridVisibilityKey, "NotificationPublisherXEventType");
                    }
                    else
                    {
                        txtNotificationPublisherXEventTypeId.Text = String.Empty;
                    }


                    txtNotificationPublisherId.Text = entityItem.NotificationPublisherId.ToString();
                    txtNotificationEventTypeId.Text = entityItem.NotificationEventTypeId.ToString();
                    txtCreatedDateId.Text           = entityItem.CreatedDateId.ToString() + entityItem.CreatedTimeId.ToString();

                    drpNotificationPublisherList.SelectedValue = entityItem.NotificationPublisherId.ToString();
                    drpNotificationEventTypeList.SelectedValue = entityItem.NotificationEventTypeId.ToString();

                    oUpdateInfo.LoadText(entityItem.UpdatedDate, entityItem.UpdatedBy, entityItem.LastAction);
                }
            }
            else
            {
                txtNotificationPublisherId.Text = String.Empty;
                txtNotificationEventTypeId.Text = String.Empty;
                txtCreatedDateId.Text           = String.Empty;
                txtCreatedDateId.Text           = String.Empty;


                drpNotificationPublisherList.SelectedValue = "-1";
                drpNotificationEventTypeList.SelectedValue = "-1";
            }
        }
Esempio n. 12
0
        private DataTable GetData()
        {
            try
            {
                var superKey     = "";
                var selectedrows = new DataTable();
                var NotificationPublisherXEventTypedata = new NotificationPublisherXEventTypeDataModel();

                selectedrows = Framework.Components.EventMonitoring.NotificationPublisherXEventTypeDataManager.GetDetails(NotificationPublisherXEventTypedata, SessionVariables.RequestProfile).Clone();

                if (Request.QueryString["SuperKey"] != null)
                {
                    superKey = Request.QueryString["SuperKey"].ToString();

                    var data = new SuperKeyDetailDataModel();
                    data.SuperKeyId = Convert.ToInt32(superKey);
                    // Change System Entity Type
                    data.SystemEntityTypeId = (int)Framework.Components.DataAccess.SystemEntity.NotificationPublisherXEventType;
                    var dt = Framework.Components.Core.SuperKeyDetailDataManager.Search(data, SessionVariables.RequestProfile);

                    if (dt != null && dt.Rows.Count > 0)
                    {
                        var keys = new int[dt.Rows.Count];
                        for (var i = 0; i < dt.Rows.Count; i++)
                        {
                            keys[i] = Convert.ToInt32(dt.Rows[i][SuperKeyDetailDataModel.DataColumns.EntityKey]);
                            NotificationPublisherXEventTypedata.NotificationPublisherXEventTypeId = keys[i];
                            var result = Framework.Components.EventMonitoring.NotificationPublisherXEventTypeDataManager.GetDetails(NotificationPublisherXEventTypedata, SessionVariables.RequestProfile);
                            selectedrows.ImportRow(result.Rows[0]);
                        }
                    }
                }
                else if (Request.QueryString["SetId"] != null)
                {
                    var key = int.Parse(Request.QueryString["SetId"]);
                    NotificationPublisherXEventTypedata.NotificationPublisherXEventTypeId = key;
                    var result = Framework.Components.EventMonitoring.NotificationPublisherXEventTypeDataManager.GetDetails(NotificationPublisherXEventTypedata, SessionVariables.RequestProfile);
                    selectedrows.ImportRow(result.Rows[0]);
                }
                return(selectedrows);
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
            return(null);
        }
Esempio n. 13
0
        public static void Delete(NotificationPublisherXEventTypeDataModel dataQuery, RequestProfile requestProfile)
        {
            const string sql = @"dbo.NotificationPublisherXEventTypeDelete ";

            var parameters =
                new
            {
                AuditId = requestProfile.AuditId
                , NotificationPublisherXEventTypeId = dataQuery.NotificationPublisherXEventTypeId
                , NotificationPublisherId           = dataQuery.NotificationPublisherId
                , NotificatiionEventTypeId          = dataQuery.NotificationEventTypeId
            };

            using (var dataAccess = new DataAccessBase(DataStoreKey))
            {
                dataAccess.Connection.Execute(sql, parameters, commandType: CommandType.StoredProcedure);
            }
        }
Esempio n. 14
0
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            try
            {
                string[] deleteIndexList = DeleteIds.Split(',');
                foreach (string index in deleteIndexList)
                {
                    var data = new NotificationPublisherXEventTypeDataModel();
                    data.NotificationPublisherXEventTypeId = int.Parse(index);
                    Framework.Components.EventMonitoring.NotificationPublisherXEventTypeDataManager.Delete(data, SessionVariables.RequestProfile);
                }

                Framework.Components.Audit.AuditHistoryDataManager.DeleteDataBySystemEntity(DeleteIds, (int)Framework.Components.DataAccess.SystemEntity.NotificationPublisherXEventType, SessionVariables.RequestProfile);
                Response.Redirect("Default.aspx?Deleted=" + true, false);
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }
Esempio n. 15
0
        protected override DataTable UpdateData()
        {
            var UpdatedData = new DataTable();
            var data        = new NotificationPublisherXEventTypeDataModel();

            UpdatedData = Framework.Components.EventMonitoring.NotificationPublisherXEventTypeDataManager.Search(data, SessionVariables.RequestProfile).Clone();
            for (var i = 0; i < SelectedData.Rows.Count; i++)
            {
                data.NotificationPublisherXEventTypeId =
                    Convert.ToInt32(SelectedData.Rows[i][NotificationPublisherXEventTypeDataModel.DataColumns.NotificationPublisherXEventTypeId].ToString());
                data.NotificationPublisherXEventTypeId =
                    !string.IsNullOrEmpty(CheckAndGetRepeaterTextBoxValue(NotificationPublisherXEventTypeDataModel.DataColumns.NotificationPublisherXEventTypeId))
                                   ? int.Parse(CheckAndGetRepeaterTextBoxValue(NotificationPublisherXEventTypeDataModel.DataColumns.NotificationPublisherXEventTypeId).ToString())
                                   : int.Parse(SelectedData.Rows[i][NotificationPublisherXEventTypeDataModel.DataColumns.NotificationPublisherXEventTypeId].ToString());

                data.NotificationEventTypeId =
                    !string.IsNullOrEmpty(CheckAndGetRepeaterTextBoxValue(NotificationPublisherXEventTypeDataModel.DataColumns.NotificationEventTypeId))
                                    ? int.Parse(CheckAndGetRepeaterTextBoxValue(NotificationPublisherXEventTypeDataModel.DataColumns.NotificationEventTypeId).ToString())
                                    : int.Parse(SelectedData.Rows[i][NotificationPublisherXEventTypeDataModel.DataColumns.NotificationEventTypeId].ToString());

                //data.CreatedDateId  =
                //	!string.IsNullOrEmpty(CheckAndGetRepeaterTextBoxValue(NotificationPublisherXEventTypeDataModel.DataColumns.CreatedDateId))
                //	? int.Parse(CheckAndGetRepeaterTextBoxValue(NotificationPublisherXEventTypeDataModel.DataColumns.CreatedDateId).ToString())
                //	: int.Parse(SelectedData.Rows[i][NotificationPublisherXEventTypeDataModel.DataColumns.CreatedDateId].ToString());

                Framework.Components.EventMonitoring.NotificationPublisherXEventTypeDataManager.Update(data, SessionVariables.RequestProfile);
                data = new NotificationPublisherXEventTypeDataModel();
                data.NotificationPublisherXEventTypeId = Convert.ToInt32(SelectedData.Rows[i][NotificationPublisherXEventTypeDataModel.DataColumns.NotificationPublisherXEventTypeId].ToString());
                var dt = Framework.Components.EventMonitoring.NotificationPublisherXEventTypeDataManager.Search(data, SessionVariables.RequestProfile);

                if (dt.Rows.Count == 1)
                {
                    UpdatedData.ImportRow(dt.Rows[0]);
                }
            }
            return(UpdatedData);
        }
Esempio n. 16
0
        public static NotificationPublisherXEventTypeDataModel GetDetails(NotificationPublisherXEventTypeDataModel data, RequestProfile requestProfile)
        {
            var list = GetEntityList(data, requestProfile, 1);

            return(list.FirstOrDefault());
        }
Esempio n. 17
0
        public static void Update(NotificationPublisherXEventTypeDataModel data, RequestProfile requestProfile)
        {
            var sql = Save(data, requestProfile, "Update");

            Framework.Components.DataAccess.DBDML.RunSQL("NotificationPublisherXEventType.Update", sql, DataStoreKey);
        }
Esempio n. 18
0
        public static string ToSQLParameter(NotificationPublisherXEventTypeDataModel data, string dataColumnName)
        {
            var returnValue = "NULL";

            switch (dataColumnName)
            {
            case NotificationPublisherXEventTypeDataModel.DataColumns.NotificationPublisherXEventTypeId:
                if (data.NotificationPublisherXEventTypeId != null)
                {
                    returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NUMBER, NotificationPublisherXEventTypeDataModel.DataColumns.NotificationPublisherXEventTypeId, data.NotificationPublisherXEventTypeId);
                }
                else
                {
                    returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NULL, NotificationPublisherXEventTypeDataModel.DataColumns.NotificationPublisherXEventTypeId);
                }
                break;

            case NotificationPublisherXEventTypeDataModel.DataColumns.NotificationPublisherId:
                if (data.NotificationPublisherId != null)
                {
                    returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NUMBER, NotificationPublisherXEventTypeDataModel.DataColumns.NotificationPublisherId, data.NotificationPublisherId);
                }
                else
                {
                    returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NULL, NotificationPublisherXEventTypeDataModel.DataColumns.NotificationPublisherId);
                }
                break;

            case NotificationPublisherXEventTypeDataModel.DataColumns.NotificationEventTypeId:
                if (data.NotificationEventTypeId != null)
                {
                    returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NUMBER, NotificationPublisherXEventTypeDataModel.DataColumns.NotificationEventTypeId, data.NotificationEventTypeId);
                }
                else
                {
                    returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NULL, NotificationPublisherXEventTypeDataModel.DataColumns.NotificationEventTypeId);
                }
                break;

            case NotificationPublisherXEventTypeDataModel.DataColumns.CreatedTimeId:
                if (data.CreatedTimeId != null)
                {
                    returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NUMBER, NotificationPublisherXEventTypeDataModel.DataColumns.CreatedTimeId, data.CreatedTimeId);
                }
                else
                {
                    returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NULL, NotificationPublisherXEventTypeDataModel.DataColumns.CreatedTimeId);
                }
                break;

            case NotificationPublisherXEventTypeDataModel.DataColumns.NotificationPublisher:
                if (!string.IsNullOrEmpty(data.NotificationPublisher))
                {
                    returnValue = string.Format(SQL_TEMPLATE_PARAMETER_STRING_OR_DATE, NotificationPublisherXEventTypeDataModel.DataColumns.NotificationPublisher, data.NotificationPublisher);
                }
                else
                {
                    returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NULL, NotificationPublisherXEventTypeDataModel.DataColumns.NotificationPublisher);
                }
                break;

            case NotificationPublisherXEventTypeDataModel.DataColumns.NotificationEventType:
                if (!string.IsNullOrEmpty(data.NotificationEventType))
                {
                    returnValue = string.Format(SQL_TEMPLATE_PARAMETER_STRING_OR_DATE, NotificationPublisherXEventTypeDataModel.DataColumns.NotificationEventType, data.NotificationEventType);
                }
                else
                {
                    returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NULL, NotificationPublisherXEventTypeDataModel.DataColumns.NotificationEventType);
                }
                break;
            }

            return(returnValue);
        }