Ejemplo n.º 1
0
        public void LoadData(int featureOwnerStatusId, bool showId)
        {
            Clear();

            var data = new FeatureOwnerStatusDataModel();

            data.FeatureOwnerStatusId = SystemKeyId;

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

            if (items.Count != 1)
            {
                return;
            }

            var item = items[0];

            SetData(item);

            if (!showId)
            {
                SystemKeyId = item.FeatureOwnerStatusId;
                oHistoryList.Setup(PrimaryEntity, featureOwnerStatusId, PrimaryEntityKey);
            }
            else
            {
                CoreSystemKey.Text = String.Empty;
            }
        }
Ejemplo n.º 2
0
        public override int?Save(string action)
        {
            var data = new FeatureOwnerStatusDataModel();

            data.FeatureOwnerStatusId = SystemKeyId;
            data.Name        = Name;
            data.Description = Description;
            data.SortOrder   = SortOrder;

            if (action == "Insert")
            {
                var dtFeatureOwnerStatus = TaskTimeTracker.Components.Module.ApplicationDevelopment.FeatureOwnerStatusDataManager.DoesExist(data, SessionVariables.RequestProfile);

                if (dtFeatureOwnerStatus.Rows.Count == 0)
                {
                    TaskTimeTracker.Components.Module.ApplicationDevelopment.FeatureOwnerStatusDataManager.Create(data, SessionVariables.RequestProfile);
                }
                else
                {
                    throw new Exception("Record with given ID already exists.");
                }
            }
            else
            {
                TaskTimeTracker.Components.Module.ApplicationDevelopment.FeatureOwnerStatusDataManager.Update(data, SessionVariables.RequestProfile);
            }

            return(data.FeatureOwnerStatusId);
        }
Ejemplo n.º 3
0
        public static int Create(FeatureOwnerStatusDataModel data, RequestProfile requestProfile)
        {
            var sql   = Save(data, "Create", requestProfile);
            var newId = DBDML.RunScalarSQL("FeatureOwnerStatus.Insert", sql, DataStoreKey);

            return(Convert.ToInt32(newId));
        }
Ejemplo n.º 4
0
        public static string Save(FeatureOwnerStatusDataModel data, string action, RequestProfile requestProfile)
        {
            var sql = "EXEC ";

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

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

            default:
                break;
            }
            sql = sql + ", " + ToSQLParameter(data, FeatureOwnerStatusDataModel.DataColumns.FeatureOwnerStatusId) +
                  ", " + ToSQLParameter(data, StandardDataModel.StandardDataColumns.Name) +
                  ", " + ToSQLParameter(data, StandardDataModel.StandardDataColumns.Description) +
                  ", " + ToSQLParameter(data, StandardDataModel.StandardDataColumns.SortOrder);

            return(sql);
        }
Ejemplo n.º 5
0
        protected override void ShowData(int featureOwnerStatusId)
        {
            oDetailButtonPanel.SetId = SetId;
            var data = new FeatureOwnerStatusDataModel();

            data.FeatureOwnerStatusId = featureOwnerStatusId;

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

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

                lblFeatureOwnerStatusId.Text = Convert.ToString(item.FeatureOwnerStatusId);
                lblName.Text        = Convert.ToString(item.Name);
                lblDescription.Text = Convert.ToString(item.Description);
                lblSortOrder.Text   = Convert.ToString(item.SortOrder);

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

                oHistoryList.Setup(PrimaryEntity, featureOwnerStatusId, "FeatureOwnerStatus");
            }
            else
            {
                Clear();
            }
        }
Ejemplo n.º 6
0
        protected override void Clear()
        {
            base.Clear();

            var data = new FeatureOwnerStatusDataModel();

            SetData(data);
        }
Ejemplo n.º 7
0
        public static DataSet GetChildren(FeatureOwnerStatusDataModel data, RequestProfile requestProfile)
        {
            var sql = "EXEC dbo.FeatureOwnerStatusChildrenGet" +
                      " " + ToSQLParameter(BaseDataModel.BaseDataColumns.AuditId, requestProfile.AuditId) +
                      ", " + ToSQLParameter(data, FeatureOwnerStatusDataModel.DataColumns.FeatureOwnerStatusId);
            var oDT = new Framework.Components.DataAccess.DBDataSet("Get Children", sql, DataStoreKey);

            return(oDT.DBDataset);
        }
Ejemplo n.º 8
0
        private System.Data.DataTable GetData()
        {
            // TODO: on all export pages
            var data = new FeatureOwnerStatusDataModel();

            var dt = TaskTimeTracker.Components.Module.ApplicationDevelopment.FeatureOwnerStatusDataManager.Search(data, SessionVariables.RequestProfile);

            return(dt);
        }
Ejemplo n.º 9
0
        protected override DataTable GetEntityData(int?entityKey)
        {
            var featureOwnerStatusdata = new FeatureOwnerStatusDataModel();

            featureOwnerStatusdata.FeatureOwnerStatusId = entityKey;
            var results = TaskTimeTracker.Components.Module.ApplicationDevelopment.FeatureOwnerStatusDataManager.Search(featureOwnerStatusdata, SessionVariables.RequestProfile);

            return(results);
        }
Ejemplo n.º 10
0
        private DataTable GetData(string name)
        {
            var data = new FeatureOwnerStatusDataModel();

            data.Name = name;

            var dt = TaskTimeTracker.Components.Module.ApplicationDevelopment.FeatureOwnerStatusDataManager.Search(data, SessionVariables.RequestProfile);

            return(dt);
        }
Ejemplo n.º 11
0
        protected override void Update(Dictionary <string, string> values)
        {
            var data = new FeatureOwnerStatusDataModel();

            // copies properties from values dictionary object to data object
            PropertyMapper.CopyProperties(data, values);

            TaskTimeTracker.Components.Module.ApplicationDevelopment.FeatureOwnerStatusDataManager.Update(data, SessionVariables.RequestProfile);
            base.Update(values);
        }
Ejemplo n.º 12
0
        public static bool DoesExist(FeatureOwnerStatusDataModel data, RequestProfile requestProfile)
        {
            var doesExistRequest = new FeatureOwnerStatusDataModel();

            doesExistRequest.ApplicationId = data.ApplicationId;
            doesExistRequest.Name          = data.Name;

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

            return(list.Count > 0);
        }
Ejemplo n.º 13
0
        private void UpdateData(ArrayList values)
        {
            var data = new FeatureOwnerStatusDataModel();

            data.FeatureOwnerStatusId = int.Parse(values[0].ToString());
            data.Name        = values[1].ToString();
            data.Description = values[2].ToString();
            data.SortOrder   = int.Parse(values[3].ToString());
            TaskTimeTracker.Components.Module.ApplicationDevelopment.FeatureOwnerStatusDataManager.Update(data, SessionVariables.RequestProfile);
            ReBindEditableGrid();
        }
Ejemplo n.º 14
0
        public static void Delete(FeatureOwnerStatusDataModel data, RequestProfile requestProfile)
        {
            const string sql = @"dbo.FeatureOwnerStatusDelete ";

            var parameters =
                new
            {
                AuditId = requestProfile.AuditId
                , FeatureOwnerStatusId = data.FeatureOwnerStatusId
            };

            using (var dataAccess = new DataAccessBase(DataStoreKey))
            {
                dataAccess.Connection.Execute(sql, parameters, commandType: CommandType.StoredProcedure);
            }
        }
Ejemplo n.º 15
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 FeatureOwnerStatusDataModel();
             data.FeatureOwnerStatusId = int.Parse(index);
             if (!TaskTimeTracker.Components.Module.ApplicationDevelopment.FeatureOwnerStatusDataManager.IsDeletable(data, SessionVariables.RequestProfile))
             {
                 notDeletableIds.Add(Convert.ToInt32(data.FeatureOwnerStatusId));
             }
         }
         if (notDeletableIds.Count == 0)
         {
             foreach (string index in deleteIndexList)
             {
                 var data = new FeatureOwnerStatusDataModel();
                 data.FeatureOwnerStatusId = int.Parse(index);
                 TaskTimeTracker.Components.Module.ApplicationDevelopment.FeatureOwnerStatusDataManager.Delete(data, SessionVariables.RequestProfile);
             }
             Framework.Components.Audit.AuditHistoryDataManager.DeleteDataBySystemEntity(DeleteIds, (int)Framework.Components.DataAccess.SystemEntity.FeatureOwnerStatus, SessionVariables.RequestProfile);
             Response.Redirect(Page.GetRouteUrl("FeatureOwnerStatusEntityRoute", new { Action = "Default", SetId = true }), false);
         }
         else
         {
             var msg = String.Empty;
             foreach (var id in notDeletableIds)
             {
                 if (!string.IsNullOrEmpty(msg))
                 {
                     msg += ", <br/>";
                 }
                 msg += "FeatureOwnerStatusId: " + id + " has detail records";
             }
             Response.Write(msg);
         }
     }
     catch (Exception ex)
     {
         Response.Write(ex.Message);
     }
 }
Ejemplo n.º 16
0
        public static bool IsDeletable(FeatureOwnerStatusDataModel data, RequestProfile requestProfile)
        {
            var isDeletable = true;
            var ds          = GetChildren(data, requestProfile);

            if (ds != null && ds.Tables.Count > 0)
            {
                foreach (DataTable dt in ds.Tables)
                {
                    if (dt.Rows.Count > 0)
                    {
                        isDeletable = false;
                        break;
                    }
                }
            }
            return(isDeletable);
        }
Ejemplo n.º 17
0
        protected override DataTable UpdateData()
        {
            var UpdatedData = new DataTable();
            var data        = new FeatureOwnerStatusDataModel();

            UpdatedData = TaskTimeTracker.Components.Module.ApplicationDevelopment.FeatureOwnerStatusDataManager.Search(data, SessionVariables.RequestProfile).Clone();
            for (var i = 0; i < SelectedData.Rows.Count; i++)
            {
                data.FeatureOwnerStatusId =
                    Convert.ToInt32(SelectedData.Rows[i][FeatureOwnerStatusDataModel.DataColumns.FeatureOwnerStatusId].ToString());

                data.Name =
                    !string.IsNullOrEmpty(CheckAndGetRepeaterTextBoxValue(StandardDataModel.StandardDataColumns.Name))
                     ? CheckAndGetRepeaterTextBoxValue(StandardDataModel.StandardDataColumns.Name)
                     : SelectedData.Rows[i][StandardDataModel.StandardDataColumns.Name].ToString();

                data.Description = !string.IsNullOrEmpty(CheckAndGetRepeaterTextBoxValue(StandardDataModel.StandardDataColumns.Description))
                    ? CheckAndGetRepeaterTextBoxValue(StandardDataModel.StandardDataColumns.Description)
                    : SelectedData.Rows[i][StandardDataModel.StandardDataColumns.Description].ToString();

                data.SortOrder =
                    !string.IsNullOrEmpty(CheckAndGetRepeaterTextBoxValue(StandardDataModel.StandardDataColumns.SortOrder))
                    ? int.Parse(CheckAndGetRepeaterTextBoxValue(StandardDataModel.StandardDataColumns.SortOrder).ToString())
                    : int.Parse(SelectedData.Rows[i][StandardDataModel.StandardDataColumns.SortOrder].ToString());

                TaskTimeTracker.Components.Module.ApplicationDevelopment.FeatureOwnerStatusDataManager.Update(data, SessionVariables.RequestProfile);
                data = new FeatureOwnerStatusDataModel();
                data.FeatureOwnerStatusId = Convert.ToInt32(SelectedData.Rows[i][FeatureOwnerStatusDataModel.DataColumns.FeatureOwnerStatusId].ToString());
                var dt = TaskTimeTracker.Components.Module.ApplicationDevelopment.FeatureOwnerStatusDataManager.Search(data, SessionVariables.RequestProfile);


                if (dt.Rows.Count == 1)
                {
                    UpdatedData.ImportRow(dt.Rows[0]);
                }
            }
            return(UpdatedData);
        }
Ejemplo n.º 18
0
        protected override DataTable GetData()
        {
            try
            {
                SuperKey = ApplicationCommon.GetSuperKey();
                SetId    = ApplicationCommon.GetSetId();

                var selectedrows           = new DataTable();
                var featureOwnerStatusdata = new FeatureOwnerStatusDataModel();

                selectedrows = TaskTimeTracker.Components.Module.ApplicationDevelopment.FeatureOwnerStatusDataManager.GetDetails(featureOwnerStatusdata, SessionVariables.RequestProfile).Clone();
                if (!string.IsNullOrEmpty(SuperKey))
                {
                    var systemEntityTypeId = (int)PrimaryEntity;
                    var lstEntityKeys      = ApplicationCommon.GetSuperKeyDetails(systemEntityTypeId, SuperKey);

                    foreach (var entityKey in lstEntityKeys)
                    {
                        featureOwnerStatusdata.FeatureOwnerStatusId = entityKey;
                        var result = TaskTimeTracker.Components.Module.ApplicationDevelopment.FeatureOwnerStatusDataManager.GetDetails(featureOwnerStatusdata, SessionVariables.RequestProfile);
                        selectedrows.ImportRow(result.Rows[0]);
                    }
                }
                else
                {
                    featureOwnerStatusdata.FeatureOwnerStatusId = SetId;
                    var result = TaskTimeTracker.Components.Module.ApplicationDevelopment.FeatureOwnerStatusDataManager.GetDetails(featureOwnerStatusdata, SessionVariables.RequestProfile);
                    selectedrows.ImportRow(result.Rows[0]);
                }
                return(selectedrows);
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }

            return(null);
        }
Ejemplo n.º 19
0
        public static string ToSQLParameter(FeatureOwnerStatusDataModel data, string dataColumnName)
        {
            var returnValue = "NULL";

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

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

            return(returnValue);
        }
Ejemplo n.º 20
0
        public static List <FeatureOwnerStatusDataModel> GetEntityDetails(FeatureOwnerStatusDataModel dataQuery, RequestProfile requestProfile, int returnAuditInfo = BaseDataManager.ReturnAuditInfoOnDetails)
        {
            const string sql = @"dbo.FeatureOwnerStatusSearch ";

            var parameters =
                new
            {
                AuditId                = requestProfile.AuditId
                , ApplicationId        = requestProfile.ApplicationId
                , ApplicationMode      = requestProfile.ApplicationModeId
                , ReturnAuditInfo      = returnAuditInfo
                , FeatureOwnerStatusId = dataQuery.FeatureOwnerStatusId
                , Name = dataQuery.Name
            };

            List <FeatureOwnerStatusDataModel> result;

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

            return(result);
        }
Ejemplo n.º 21
0
        public static DataTable Search(FeatureOwnerStatusDataModel data, RequestProfile requestProfile)
        {
            var list = GetEntityDetails(data, requestProfile, 0);

            return(list.ToDataTable());
        }
Ejemplo n.º 22
0
        public void SetData(FeatureOwnerStatusDataModel data)
        {
            SystemKeyId = data.FeatureOwnerStatusId;

            base.SetData(data);
        }
Ejemplo n.º 23
0
        public static FeatureOwnerStatusDataModel GetDetails(FeatureOwnerStatusDataModel data, RequestProfile requestProfile)
        {
            var list = GetEntityDetails(data, requestProfile, 1);

            return(list.FirstOrDefault());
        }
Ejemplo n.º 24
0
        public static void Update(FeatureOwnerStatusDataModel data, RequestProfile requestProfile)
        {
            var sql = Save(data, "Update", requestProfile);

            DBDML.RunSQL("FeatureOwnerStatus.Update", sql, DataStoreKey);
        }
Ejemplo n.º 25
0
 private void ReBindEditableGrid()
 {
     var data = new FeatureOwnerStatusDataModel();
     var dtFeatureOwnerStatus = TaskTimeTracker.Components.Module.ApplicationDevelopment.FeatureOwnerStatusDataManager.Search(data, SessionVariables.RequestProfile);
 }