コード例 #1
0
        protected override void OnInit(EventArgs e)
        {
            try
            {
                var superKey   = "";
                var setId      = 0;
                var key        = 0;
                var clientdata = new ClientDataModel();
                var results    = ClientDataManager.Search(clientdata, SessionVariables.RequestProfile).Clone();

                if (Request.QueryString["SuperKey"] != null)
                {
                    superKey = Request.QueryString["SuperKey"];
                }
                else if (Request.QueryString["SetId"] != null)
                {
                    setId = int.Parse(Request.QueryString["SetId"]);
                }
                if (int.Parse(superKey) > 0)
                {
                    var data = new SuperKeyDetailDataModel();
                    data.SuperKeyId = Convert.ToInt32(superKey);

                    // Change System Entity Type
                    data.SystemEntityTypeId = (int)SystemEntity.Client;
                    var dt = SuperKeyDetailDataManager.Search(data, SessionVariables.RequestProfile);
                    if (dt != null && dt.Rows.Count > 0)
                    {
                        foreach (DataRow dr in dt.Rows)
                        {
                            key = (int)(dr[SuperKeyDetailDataModel.DataColumns.EntityKey]);
                            clientdata.ClientId = key;
                            var clientdt = ClientDataManager.Search(clientdata, SessionVariables.RequestProfile);
                            if (clientdt.Rows.Count == 1)
                            {
                                results.ImportRow(clientdt.Rows[0]);
                            }
                        }
                    }
                }
                else
                {
                    key = setId;
                    clientdata.ClientId = key;
                    var clientdt = ClientDataManager.Search(clientdata, SessionVariables.RequestProfile);
                    if (clientdt.Rows.Count > 1)
                    {
                        results.ImportRow(clientdt.Rows[0]);
                    }
                }
                SelectedData = new DataTable();
                SelectedData = results.Copy();
                base.OnInit(e);
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
                //throw
            }
        }
コード例 #2
0
        protected override void OnInit(EventArgs e)
        {
            try
            {
                base.OnInit(e);

                var detailsControlPath = ApplicationCommon.GetControlPath("ClientXProject", ControlType.DetailsControl);
                SuperKey = ApplicationCommon.GetSuperKey();
                SetId    = ApplicationCommon.GetSetId();

                if (!string.IsNullOrEmpty(SuperKey))
                {
                    btnClone.Visible = false;

                    var data = new SuperKeyDetailDataModel();
                    data.SuperKeyId = Convert.ToInt32(SuperKey);

                    // Change System Entity Type
                    data.SystemEntityTypeId = (int)SystemEntity.ClientXProject;
                    var dt = SuperKeyDetailDataManager.Search(data, SessionVariables.RequestProfile);
                    if (dt != null && dt.Rows.Count > 0)
                    {
                        foreach (DataRow dr in dt.Rows)
                        {
                            var key = Convert.ToInt32(dr[SuperKeyDetailDataModel.DataColumns.EntityKey]);

                            var detailsControl = (Controls.Details)Page.LoadControl(detailsControlPath);
                            detailsControl.SetId       = key;
                            detailsControl.BorderClass = ApplicationCommon.DetailsBorderClassName;
                            plcDetailsList.Controls.Add(detailsControl);
                            plcDetailsList.Controls.Add(new LiteralControl("<br />"));

                            chkVisible.Checked = detailsControl.IsHistoryVisible;
                        }
                    }
                }
                else
                {
                    var detailsControl = (Controls.Details)Page.LoadControl(detailsControlPath);
                    detailsControl.SetId = SetId;
                    plcDetailsList.Controls.Add(detailsControl);
                    chkVisible.Checked = detailsControl.IsHistoryVisible;
                }
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }
コード例 #3
0
        protected override DataTable GetData()
        {
            try
            {
                SuperKey = ApplicationCommon.GetSuperKey();
                SetId    = ApplicationCommon.GetSetId();

                var selectedrows = new DataTable();
                var projectPortfolioGroupXProjectPortfoliodata = new ProjectPortfolioGroupXProjectPortfolioDataModel();

                selectedrows = ProjectPortfolioGroupXProjectPortfolioDataManager.GetDetails(projectPortfolioGroupXProjectPortfoliodata, SessionVariables.RequestProfile).Clone();
                if (!string.IsNullOrEmpty(SuperKey))
                {
                    var data = new SuperKeyDetailDataModel();
                    data.SuperKeyId = Convert.ToInt32(SuperKey);

                    data.SystemEntityTypeId = (int)SystemEntity.ProjectPortfolioGroupXProjectPortfolio;
                    var dt = 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]);
                            projectPortfolioGroupXProjectPortfoliodata.ProjectPortfolioGroupXProjectPortfolioId = keys[i];
                            var result = ProjectPortfolioGroupXProjectPortfolioDataManager.GetDetails(projectPortfolioGroupXProjectPortfoliodata, SessionVariables.RequestProfile);
                            selectedrows.ImportRow(result.Rows[0]);
                        }
                    }
                }
                else if (SetId != 0)
                {
                    var key = SetId;
                    projectPortfolioGroupXProjectPortfoliodata.ProjectPortfolioGroupXProjectPortfolioId = key;
                    var result = ProjectPortfolioGroupXProjectPortfolioDataManager.GetDetails(projectPortfolioGroupXProjectPortfoliodata, SessionVariables.RequestProfile);
                    selectedrows.ImportRow(result.Rows[0]);
                }
                return(selectedrows);
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
            return(null);
        }
コード例 #4
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            try
            {
                var detailsControlPath = "~/ClientXProject/Controls/Details.ascx";
                var superKey           = ApplicationCommon.GetSuperKey();
                var setId = ApplicationCommon.GetSetId();

                if (!string.IsNullOrEmpty(superKey))
                {
                    var data = new SuperKeyDetailDataModel();
                    data.SuperKeyId = Convert.ToInt32(superKey);

                    // Change System Entity Type
                    data.SystemEntityTypeId = (int)SystemEntity.ClientXProject;
                    var dt = SuperKeyDetailDataManager.Search(data, SessionVariables.RequestProfile);

                    if (dt != null && dt.Rows.Count > 0)
                    {
                        foreach (DataRow dr in dt.Rows)
                        {
                            var key = Convert.ToInt32(dr[SuperKeyDetailDataModel.DataColumns.EntityKey]);

                            if (string.IsNullOrEmpty(DeleteIds))
                            {
                                DeleteIds = key.ToString();
                            }
                            else
                            {
                                DeleteIds += "," + key.ToString();
                            }

                            var detailsControl = (Controls.Details)Page.LoadControl(detailsControlPath);
                            detailsControl.SetId       = key;
                            detailsControl.BorderClass = ApplicationCommon.DetailsBorderClassName;

                            plcDetailsList.Controls.Add(detailsControl);
                            plcDetailsList.Controls.Add(new LiteralControl("<br />"));

                            //chkVisible.Checked = detailsControl.IsHistoryVisible;
                        }
                    }
                }
                else
                {
                    var key = setId;
                    DeleteIds = setId.ToString();

                    var detailsControl = (Controls.Details)Page.LoadControl(detailsControlPath);
                    detailsControl.SetId = key;
                    plcDetailsList.Controls.Add(detailsControl);
                }

                ShowAuditHistory(true);
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }
コード例 #5
0
        protected override void OnInit(EventArgs e)
        {
            try
            {
                var superKey = "";
                var newId    = SystemEntityTypeDataManager.GetNextSequence("TaskAlgorithmItem", (int)SystemEntity.TaskAlgorithmItem, SessionVariables.RequestProfile);
                var TaskAlgorithmItemdata = new TaskAlgorithmItemDataModel();
                var systemdevdata         = new SystemDevNumbersDataModel();
                systemdevdata.ApplicationUserId = SessionVariables.RequestProfile.AuditId;
                var dtnumbers = SystemDevNumbersDataManager.Search(systemdevdata, SessionVariables.RequestProfile);
                var rangefrom =
                    Convert.ToInt32(dtnumbers.Rows[0][SystemDevNumbersDataModel.DataColumns.RangeFrom].ToString());
                var rangeto =
                    Convert.ToInt32(dtnumbers.Rows[0][SystemDevNumbersDataModel.DataColumns.RangeTo].ToString());
                if (Request.QueryString["SuperKey"] != null)
                {
                    superKey = Request.QueryString["SuperKey"].ToString();
                    var data = new SuperKeyDetailDataModel();
                    data.SuperKeyId         = Convert.ToInt32(superKey);
                    data.SystemEntityTypeId = (int)SystemEntity.TaskAlgorithmItem;
                    var dt = SuperKeyDetailDataManager.Search(data, SessionVariables.RequestProfile);

                    if (dt != null && dt.Rows.Count > 0)
                    {
                        foreach (DataRow dr in dt.Rows)
                        {
                            var key = Convert.ToInt32(dr[SuperKeyDetailDataModel.DataColumns.EntityKey]);
                            TaskAlgorithmItemdata.TaskAlgorithmItemId = key;

                            var TaskAlgorithmItemdt = TaskAlgorithmItemDataManager.GetDetails(TaskAlgorithmItemdata, SessionVariables.RequestProfile);

                            if (TaskAlgorithmItemdt.Rows.Count == 1)
                            {
                                var row = TaskAlgorithmItemdt.Rows[0];

                                if (Request.QueryString["Mode"].ToString().Equals("Test"))
                                {
                                    TaskAlgorithmItemdata.TaskAlgorithmItemId = GetNextValidId(rangefrom);
                                }
                                TaskAlgorithmItemdata.ActivityId  = Convert.ToInt32(row[TaskAlgorithmItemDataModel.DataColumns.ActivityId]);
                                TaskAlgorithmItemdata.Description = Convert.ToString(row[TaskAlgorithmItemDataModel.DataColumns.Description]);
                                TaskAlgorithmItemdata.SortOrder   = Convert.ToInt32(row[TaskAlgorithmItemDataModel.DataColumns.SortOrder]);

                                TaskAlgorithmItemDataManager.Create(TaskAlgorithmItemdata, SessionVariables.RequestProfile);
                            }
                        }
                    }
                }
                else if (Request.QueryString["SetId"] != null)
                {
                    var key = int.Parse(Request.QueryString["SetId"]);
                    TaskAlgorithmItemdata.TaskAlgorithmItemId = key;

                    var TaskAlgorithmItemdt = TaskAlgorithmItemDataManager.GetDetails(TaskAlgorithmItemdata, SessionVariables.RequestProfile);

                    if (TaskAlgorithmItemdt.Rows.Count == 1)
                    {
                        var row = TaskAlgorithmItemdt.Rows[0];

                        var newTaskAlgorithmItemdata = new TaskAlgorithmItemDataModel();
                        if (Request.QueryString["Mode"].ToString().Equals("Test"))
                        {
                            newTaskAlgorithmItemdata.TaskAlgorithmItemId = newId = (int)GetNextValidId(rangefrom);
                        }
                        newTaskAlgorithmItemdata.ActivityId  = Convert.ToInt32(row[TaskAlgorithmItemDataModel.DataColumns.ActivityId]);
                        newTaskAlgorithmItemdata.Description = Convert.ToString(row[TaskAlgorithmItemDataModel.DataColumns.Description]);
                        newTaskAlgorithmItemdata.SortOrder   = Convert.ToInt32(row[TaskAlgorithmItemDataModel.DataColumns.SortOrder]);

                        UpdatedFKDepenedencies(key, newId);
                        TaskAlgorithmItemDataManager.Delete(TaskAlgorithmItemdata, SessionVariables.RequestProfile);
                        TaskAlgorithmItemDataManager.Create(newTaskAlgorithmItemdata, SessionVariables.RequestProfile);
                    }
                }
                else if (Request.QueryString["Mode"].ToString().Equals("Renumber"))
                {
                    var seed = int.Parse(Request.QueryString["Seed"].ToString());
                    //ApplicationVariables.Seed;
                    var increment = int.Parse(Request.QueryString["Increment"].ToString());
                    //ApplicationVariables.Increment;
                    TaskAlgorithmItemDataManager.Renumber(seed, increment, SessionVariables.RequestProfile);
                }
                base.OnInit(e);

                Response.Redirect("Default.aspx?Added=true", false);
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }
コード例 #6
0
        protected override void OnInit(EventArgs e)
        {
            try
            {
                var superKey      = string.Empty;
                var newId         = SystemEntityTypeDataManager.GetNextSequence("Client", (int)SystemEntity.Client, SessionVariables.RequestProfile);
                var clientData    = new ClientDataModel();
                var systemDevData = new SystemDevNumbersDataModel();

                systemDevData.ApplicationUserId = SessionVariables.RequestProfile.AuditId;
                var dtnumbers = SystemDevNumbersDataManager.Search(systemDevData, SessionVariables.RequestProfile);

                var rangefrom = Convert.ToInt32(dtnumbers.Rows[0][SystemDevNumbersDataModel.DataColumns.RangeFrom].ToString());
                var rangeto   = Convert.ToInt32(dtnumbers.Rows[0][SystemDevNumbersDataModel.DataColumns.RangeTo].ToString());

                if (Request.QueryString["SuperKey"] != null)
                {
                    superKey = Request.QueryString["SuperKey"];
                    var data = new SuperKeyDetailDataModel();

                    data.SuperKeyId         = Convert.ToInt32(superKey);
                    data.SystemEntityTypeId = (int)SystemEntity.Client;
                    var dt = SuperKeyDetailDataManager.Search(data, SessionVariables.RequestProfile);

                    if (dt != null && dt.Rows.Count > 0)
                    {
                        foreach (DataRow dr in dt.Rows)
                        {
                            var key = (int)(dr[SuperKeyDetailDataModel.DataColumns.EntityKey]);
                            clientData.ClientId = key;

                            var clientdt = ClientDataManager.GetDetails(clientData, SessionVariables.RequestProfile);

                            if (clientdt.Rows.Count == 1)
                            {
                                var row = clientdt.Rows[0];

                                if (Request.QueryString["Mode"].Equals("Test"))
                                {
                                    clientData.ClientId = GetNextValidId(rangefrom);
                                }
                                clientData.Name        = Convert.ToString(row[StandardDataModel.StandardDataColumns.Name]);
                                clientData.Description = Convert.ToString(row[StandardDataModel.StandardDataColumns.Description]);
                                clientData.SortOrder   = (int)(row[StandardDataModel.StandardDataColumns.SortOrder]);

                                ClientDataManager.Create(clientData, SessionVariables.RequestProfile);
                            }
                        }
                    }
                }
                else if (Request.QueryString["SetId"] != null)
                {
                    var key = int.Parse(Request.QueryString["SetId"]);
                    clientData.ClientId = key;

                    var clientdt = ClientDataManager.GetDetails(clientData, SessionVariables.RequestProfile);

                    if (clientdt.Rows.Count == 1)
                    {
                        var row = clientdt.Rows[0];

                        var newclientdata = new ClientDataModel();

                        if (Request.QueryString["Mode"].Equals("Test"))
                        {
                            newclientdata.ClientId = newId = GetNextValidId(rangefrom);
                        }

                        newclientdata.Name        = Convert.ToString(row[StandardDataModel.StandardDataColumns.Name]);
                        newclientdata.Description = Convert.ToString(row[StandardDataModel.StandardDataColumns.Description]);
                        newclientdata.SortOrder   = (int)(row[StandardDataModel.StandardDataColumns.SortOrder]);

                        UpdatedFKDepenedencies(key, newId);

                        ClientDataManager.Delete(clientData, SessionVariables.RequestProfile);
                        ClientDataManager.Create(newclientdata, SessionVariables.RequestProfile);
                    }
                }
                else if (Request.QueryString["Mode"].Equals("Renumber"))
                {
                    var seed = int.Parse(Request.QueryString["Seed"]);
                    //ApplicationVariables.Seed;
                    var increment = int.Parse(Request.QueryString["Increment"]);
                    //ApplicationVariables.Increment;
                    ClientDataManager.Renumber(seed, increment, SessionVariables.RequestProfile);
                }
                base.OnInit(e);

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