Exemplo n.º 1
0
        private static string CreateOrUpdate(FunctionalityEntityStatusArchiveDataModel data, RequestProfile requestProfile, string action)
        {
            var sql = "EXEC ";

            switch (action)
            {
            case "Create":
                sql += "dbo.FunctionalityEntityStatusArchiveInsert  ";
                break;

            case "Update":
                sql += "dbo.FunctionalityEntityStatusArchiveUpdate  ";
                break;

            default:
                break;
            }

            sql = sql + " " + ToSQLParameter(BaseDataModel.BaseDataColumns.AuditId, requestProfile.AuditId) +
                  ", " + ToSQLParameter(data, FunctionalityEntityStatusArchiveDataModel.DataColumns.FunctionalityEntityStatusArchiveId, data.FunctionalityEntityStatusArchiveId) +
                  ", " + ToSQLParameter(data, FunctionalityEntityStatusArchiveDataModel.DataColumns.RecordDate, data.RecordDate) +
                  ", " + ToSQLParameter(data, FunctionalityEntityStatusArchiveDataModel.DataColumns.SystemEntityType, data.SystemEntityType) +
                  ", " + ToSQLParameter(data, FunctionalityEntityStatusArchiveDataModel.DataColumns.Functionality, data.Functionality) +
                  ", " + ToSQLParameter(data, FunctionalityEntityStatusArchiveDataModel.DataColumns.FunctionalityStatus, data.FunctionalityStatus) +
                  ", " + ToSQLParameter(data, FunctionalityEntityStatusArchiveDataModel.DataColumns.FunctionalityPriority, data.FunctionalityPriority) +
                  ", " + ToSQLParameter(data, FunctionalityEntityStatusArchiveDataModel.DataColumns.FunctionalityEntityStatusId, data.FunctionalityEntityStatusId) +
                  ", " + ToSQLParameter(data, FunctionalityEntityStatusArchiveDataModel.DataColumns.AssignedTo, data.AssignedTo) +
                  ", " + ToSQLParameter(data, FunctionalityEntityStatusArchiveDataModel.DataColumns.Memo, data.Memo) +
                  ", " + ToSQLParameter(data, FunctionalityEntityStatusArchiveDataModel.DataColumns.TargetDate, data.TargetDate) +
                  ", " + ToSQLParameter(data, FunctionalityEntityStatusArchiveDataModel.DataColumns.StartDate, data.StartDate) +
                  ", " + ToSQLParameter(data, FunctionalityEntityStatusArchiveDataModel.DataColumns.KnowledgeDate, data.KnowledgeDate) +
                  ", " + ToSQLParameter(data, FunctionalityEntityStatusArchiveDataModel.DataColumns.AcknowledgedById, data.AcknowledgedById) +
                  ", " + ToSQLParameter(data, FunctionalityEntityStatusArchiveDataModel.DataColumns.AcknowledgedBy, data.AcknowledgedBy);
            return(sql);
        }
Exemplo n.º 2
0
        private DataTable GetData()
        {
            var data = new FunctionalityEntityStatusArchiveDataModel();
            var dt   = TaskTimeTracker.Components.Module.ApplicationDevelopment.FunctionalityEntityStatusArchiveDataManager.Search(data, SessionVariables.RequestProfile);

            return(dt);
        }
Exemplo n.º 3
0
        public static DataTable Search(FunctionalityEntityStatusArchiveDataModel data, RequestProfile requestProfile)
        {
            var list = GetEntityDetails(data, requestProfile, 0);

            var table = list.ToDataTable();

            return(table);
        }
Exemplo n.º 4
0
        private DataTable GetFunctionalityEntityStatusArchiveData(int functionalityEntityStatusId)
        {
            var data = new FunctionalityEntityStatusArchiveDataModel();

            data.FunctionalityEntityStatusId = functionalityEntityStatusId;
            var dt = FunctionalityEntityStatusArchiveDataManager.SearchHistory(data, SessionVariables.RequestProfile);

            return(dt);
        }
Exemplo n.º 5
0
        public static bool DoesExist(FunctionalityEntityStatusArchiveDataModel data, RequestProfile requestProfile)
        {
            var doesExistRequest = new FunctionalityEntityStatusArchiveDataModel();

            doesExistRequest.Name = data.Name;

            var list = GetEntityDetails(doesExistRequest, requestProfile, 0);

            return(list.Count > 0);
        }
Exemplo n.º 6
0
        public static DataTable SearchHistory(FunctionalityEntityStatusArchiveDataModel data, RequestProfile requestProfile)
        {
            // formulate SQL
            var sql = "EXEC dbo.FunctionalityEntityStatusArchiveSearchHistory " +
                      " " + ToSQLParameter(BaseDataModel.BaseDataColumns.AuditId, requestProfile.AuditId) +
                      ", " + ToSQLParameter(data, FunctionalityEntityStatusArchiveDataModel.DataColumns.FunctionalityEntityStatusArchiveId, data.FunctionalityEntityStatusArchiveId) +
                      ", " + ToSQLParameter(data, FunctionalityEntityStatusArchiveDataModel.DataColumns.SystemEntityType, data.SystemEntityType) +
                      ", " + ToSQLParameter(data, FunctionalityEntityStatusArchiveDataModel.DataColumns.Functionality, data.Functionality) +
                      ", " + ToSQLParameter(data, FunctionalityEntityStatusArchiveDataModel.DataColumns.FunctionalityStatus, data.FunctionalityStatus) +
                      ", " + ToSQLParameter(data, FunctionalityEntityStatusArchiveDataModel.DataColumns.FunctionalityPriority, data.FunctionalityPriority) +
                      ", " + ToSQLParameter(data, FunctionalityEntityStatusArchiveDataModel.DataColumns.FunctionalityEntityStatusId, data.FunctionalityEntityStatusId);

            var oDT = new DBDataTable("FunctionalityEntityStatusArchive.Search", sql, DataStoreKey);

            return(oDT.DBTable);
        }
Exemplo n.º 7
0
        public static void Delete(FunctionalityEntityStatusArchiveDataModel dataQuery, RequestProfile requestProfile)
        {
            const string sql = @"dbo.FunctionalityEntityStatusArchiveDelete ";

            var parameters =
                new
            {
                AuditId = requestProfile.AuditId
                ,
                FunctionalityEntityStatusArchiveId = dataQuery.FunctionalityEntityStatusArchiveId
            };

            using (var dataAccess = new DataAccessBase(DataStoreKey))
            {
                dataAccess.Connection.Execute(sql, parameters, commandType: CommandType.StoredProcedure);
            }
        }
Exemplo n.º 8
0
        protected override void ShowData(int functionalityEntityStatusArchiveid)
        {
            //oDetailButtonPanel.SetId = SetId;
            var data = new FunctionalityEntityStatusArchiveDataModel();

            data.FunctionalityEntityStatusArchiveId = functionalityEntityStatusArchiveid;
            var items = TaskTimeTracker.Components.Module.ApplicationDevelopment.FunctionalityEntityStatusArchiveDataManager.GetEntityDetails(data, SessionVariables.RequestProfile);

            if (items.Count == 1)
            {
                var item = items[0];

                lblFunctionalityEntityStatusArchiveId.Text = Convert.ToString(item.FunctionalityEntityStatusArchiveId);
                lblRecordDate.Text                  = Convert.ToString(item.RecordDate);
                lblSystemEntityType.Text            = Convert.ToString(item.SystemEntityType);
                lblFunctionality.Text               = Convert.ToString(item.Functionality);
                lblFunctionalityStatus.Text         = Convert.ToString(item.FunctionalityStatus);
                lblFunctionalityPriority.Text       = Convert.ToString(item.FunctionalityPriority);
                lblFunctionalityEntityStatusId.Text = Convert.ToString(item.FunctionalityEntityStatusId);
                lblAssignedTo.Text                  = Convert.ToString(item.AssignedTo);
                lblMemo.Text             = Convert.ToString(item.Memo);
                lblKnowledgeDate.Text    = Convert.ToString(item.KnowledgeDate);
                lblTargetDate.Text       = Convert.ToString(item.TargetDate);
                lblStartDate.Text        = Convert.ToString(item.StartDate);
                lblAcknowledgedById.Text = Convert.ToString(item.AcknowledgedById);
                lblAcknowledgedBy.Text   = Convert.ToString(item.AcknowledgedBy);

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

                oHistoryList.Setup(PrimaryEntity, functionalityEntityStatusArchiveid, "FunctionalityEntityStatusArchive");
            }
            else
            {
                Clear();
            }
        }
Exemplo n.º 9
0
        public static void Update(FunctionalityEntityStatusArchiveDataModel data, RequestProfile requestProfile)
        {
            var sql = CreateOrUpdate(data, requestProfile, "Update");

            DBDML.RunSQL("FunctionalityEntityStatusArchive.Update", sql, DataStoreKey);
        }
Exemplo n.º 10
0
        public static List <FunctionalityEntityStatusArchiveDataModel> GetEntityDetails(FunctionalityEntityStatusArchiveDataModel dataQuery, RequestProfile requestProfile, int returnAuditInfo = BaseDataManager.ReturnAuditInfoOnDetails)
        {
            const string sql = @"dbo.FunctionalityEntityStatusArchiveSearch ";

            var parameters =
                new
            {
                AuditId = requestProfile.AuditId
                , FunctionalityEntityStatusArchiveId = dataQuery.FunctionalityEntityStatusArchiveId
                , SystemEntityType            = dataQuery.SystemEntityType
                , Functionality               = dataQuery.Functionality
                , FunctionalityStatus         = dataQuery.FunctionalityStatus
                , FunctionalityPriority       = dataQuery.FunctionalityPriority
                , FunctionalityEntityStatusId = dataQuery.FunctionalityEntityStatusId
                , ReturnAuditInfo             = returnAuditInfo
            };

            List <FunctionalityEntityStatusArchiveDataModel> result;

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

            return(result);
        }
Exemplo n.º 11
0
        public static FunctionalityEntityStatusArchiveDataModel GetDetails(FunctionalityEntityStatusArchiveDataModel data, RequestProfile requestProfile)
        {
            var list = GetEntityDetails(data, requestProfile, 1);

            return(list.FirstOrDefault());
        }
Exemplo n.º 12
0
        public static string ToSQLParameter(FunctionalityEntityStatusArchiveDataModel data, string dataColumnName, object value)
        {
            var returnValue = "NULL";

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

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

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

            case FunctionalityEntityStatusArchiveDataModel.DataColumns.FunctionalityStatus:
                if (value != null)
                {
                    returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NUMBER, FunctionalityEntityStatusArchiveDataModel.DataColumns.FunctionalityStatus, value);
                }
                else
                {
                    returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NULL, FunctionalityEntityStatusArchiveDataModel.DataColumns.FunctionalityStatus);
                }
                break;

            case FunctionalityEntityStatusArchiveDataModel.DataColumns.FunctionalityPriority:
                if (data.FunctionalityPriority != null)
                {
                    returnValue = string.Format(SQL_TEMPLATE_PARAMETER_STRING_OR_DATE, FunctionalityEntityStatusArchiveDataModel.DataColumns.FunctionalityPriority, data.FunctionalityPriority);
                }
                else
                {
                    returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NULL, FunctionalityEntityStatusArchiveDataModel.DataColumns.FunctionalityPriority);
                }
                break;

            case FunctionalityEntityStatusArchiveDataModel.DataColumns.Memo:
                if (data.Memo != null)
                {
                    returnValue = string.Format(SQL_TEMPLATE_PARAMETER_STRING_OR_DATE, FunctionalityEntityStatusArchiveDataModel.DataColumns.Memo, data.Memo);
                }
                else
                {
                    returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NULL, FunctionalityEntityStatusArchiveDataModel.DataColumns.Memo);
                }
                break;

            case FunctionalityEntityStatusArchiveDataModel.DataColumns.SystemEntityType:
                if (data.SystemEntityType != null)
                {
                    returnValue = string.Format(SQL_TEMPLATE_PARAMETER_STRING_OR_DATE, FunctionalityEntityStatusArchiveDataModel.DataColumns.SystemEntityType, data.SystemEntityType);
                }
                else
                {
                    returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NULL, FunctionalityEntityStatusArchiveDataModel.DataColumns.SystemEntityType);
                }
                break;

            case FunctionalityEntityStatusArchiveDataModel.DataColumns.StartDate:
                if (data.StartDate != null)
                {
                    returnValue = string.Format(SQL_TEMPLATE_PARAMETER_STRING_OR_DATE, FunctionalityEntityStatusArchiveDataModel.DataColumns.StartDate, data.StartDate);
                }
                else
                {
                    returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NULL, FunctionalityEntityStatusArchiveDataModel.DataColumns.StartDate);
                }
                break;


            case FunctionalityEntityStatusArchiveDataModel.DataColumns.TargetDate:
                if (data.TargetDate != null)
                {
                    returnValue = string.Format(SQL_TEMPLATE_PARAMETER_STRING_OR_DATE, FunctionalityEntityStatusArchiveDataModel.DataColumns.TargetDate, data.TargetDate);
                }
                else
                {
                    returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NULL, FunctionalityEntityStatusArchiveDataModel.DataColumns.TargetDate);
                }
                break;


            case FunctionalityEntityStatusArchiveDataModel.DataColumns.AssignedTo:
                if (data.AssignedTo != null)
                {
                    returnValue = string.Format(SQL_TEMPLATE_PARAMETER_STRING_OR_DATE, FunctionalityEntityStatusArchiveDataModel.DataColumns.AssignedTo, data.AssignedTo);
                }
                else
                {
                    returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NULL, FunctionalityEntityStatusArchiveDataModel.DataColumns.AssignedTo);
                }
                break;



            default:
                returnValue = StandardDataManager.ToSQLParameter(data, dataColumnName);
                break;
            }

            return(returnValue);
        }
Exemplo n.º 13
0
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            try
            {
                var      notDeletableIds = new List <int>();
                string[] deleteIndexList = DeleteIds.Split(',');
                foreach (string index in deleteIndexList)
                {
                    var data = new FunctionalityEntityStatusDataModel();
                    data.FunctionalityEntityStatusId = int.Parse(index);
                    if (!TaskTimeTracker.Components.Module.ApplicationDevelopment.FunctionalityEntityStatusDataManager.IsDeletable(data, SessionVariables.RequestProfile))
                    {
                        notDeletableIds.Add(Convert.ToInt32(data.FunctionalityEntityStatusId));
                    }
                }
                if (notDeletableIds.Count == 0)
                {
                    foreach (string index in deleteIndexList)
                    {
                        var data = new FunctionalityEntityStatusDataModel();
                        data.FunctionalityEntityStatusId = int.Parse(index);
                        TaskTimeTracker.Components.Module.ApplicationDevelopment.FunctionalityEntityStatusDataManager.Delete(data, SessionVariables.RequestProfile);
                    }
                    Framework.Components.Audit.AuditHistoryDataManager.DeleteDataBySystemEntity(DeleteIds, (int)Framework.Components.DataAccess.SystemEntity.FunctionalityEntityStatus, SessionVariables.RequestProfile);

                    Response.Redirect(Page.GetRouteUrl("FunctionalityEntityStatusEntityRoute", new { Action = "Default", SetId = true }), false);
                }
                else
                {
                    var msg = String.Empty;
                    foreach (var id in notDeletableIds)
                    {
                        if (!string.IsNullOrEmpty(msg))
                        {
                            msg += ", <br/>";
                        }
                        msg += "FunctionalityEntityStatusId: " + id + " has detail records";
                        var data = new FunctionalityEntityStatusArchiveDataModel();
                        data.FunctionalityEntityStatusId = id;
                        var dt = TaskTimeTracker.Components.Module.ApplicationDevelopment.FunctionalityEntityStatusArchiveDataManager.Search(data, SessionVariables.RequestProfile);
                        foreach (DataRow dr in dt.Rows)
                        {
                            var fesarchid = int.Parse(dr[FunctionalityEntityStatusArchiveDataModel.DataColumns.FunctionalityEntityStatusArchiveId].ToString());
                            data.FunctionalityEntityStatusArchiveId = fesarchid;
                            TaskTimeTracker.Components.Module.ApplicationDevelopment.FunctionalityEntityStatusArchiveDataManager.Delete(data, SessionVariables.RequestProfile);
                        }
                        var fesdata = new FunctionalityEntityStatusDataModel();
                        fesdata.FunctionalityEntityStatusId = id;
                        TaskTimeTracker.Components.Module.ApplicationDevelopment.FunctionalityEntityStatusDataManager.Delete(fesdata, SessionVariables.RequestProfile);

                        Framework.Components.Audit.AuditHistoryDataManager.DeleteDataBySystemEntity(id.ToString(), (int)Framework.Components.DataAccess.SystemEntity.FunctionalityEntityStatus, SessionVariables.RequestProfile);

                        Response.Redirect(Page.GetRouteUrl("FunctionalityEntityStatusEntityRoute", new { Action = "Default", SetId = true }), false);
                    }
                    Response.Write(msg);
                }
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }