Beispiel #1
0
        public override void LoadDropDownListSources(string fieldName, DropDownList dropDownListControl)
        {
            base.LoadDropDownListSources(fieldName, dropDownListControl);

            if (fieldName.Equals("Application"))
            {
                var applicationData = ApplicationDataManager.GetList(SessionVariables.RequestProfile);
                var dv = applicationData.DefaultView;
                dv.Sort = "Name ASC";
                UIHelper.LoadDropDown(dv.ToTable(), dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      BaseDataModel.BaseDataColumns.ApplicationId);

                dropDownListControl.SelectedValue = SessionVariables.RequestProfile.ApplicationId.ToString();
            }
            else if (fieldName.Equals("systemEntityType"))
            {
                var systemEntityData = FunctionalityEntityStatusDataManager.GetUniqueIdList(
                    "systemEntityType", SessionVariables.RequestProfile);
                var systemEntityDataList     = SystemEntityTypeDataManager.GetList(SessionVariables.RequestProfile);
                var filteredsystemEntityData = GetFilteredList("systemEntityType", systemEntityData, systemEntityDataList);
                filteredsystemEntityData.DefaultView.Sort = SystemEntityTypeDataModel.DataColumns.EntityName + " ASC";
                var sorteddt = filteredsystemEntityData.DefaultView.ToTable();
                UIHelper.LoadDropDown(sorteddt, dropDownListControl, SystemEntityTypeDataModel.DataColumns.EntityName,
                                      SystemEntityTypeDataModel.DataColumns.SystemEntityTypeId);
            }

            else if (fieldName.Equals("Functionality"))
            {
                var functionalityData = FunctionalityEntityStatusDataManager.GetUniqueIdList(
                    "Functionality", SessionVariables.RequestProfile);
                var functionalityDataList     = FunctionalityDataManager.GetList(SessionVariables.RequestProfile);
                var filteredfunctionalityData = GetFilteredList("Functionality", functionalityData, functionalityDataList);
                UIHelper.LoadDropDown(filteredfunctionalityData, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      FunctionalityDataModel.DataColumns.FunctionalityId);
            }

            else if (fieldName.Equals("FunctionalityPriority"))
            {
                var functionalityPriorityData = FunctionalityPriorityDataManager.GetList(SessionVariables.RequestProfile);
                var dv = functionalityPriorityData.DefaultView;
                dv.Sort = "Name ASC";
                UIHelper.LoadDropDown(dv.ToTable(), dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      FunctionalityPriorityDataModel.DataColumns.FunctionalityPriorityId);
            }
            else if (fieldName.Equals("FunctionalityActiveStatus"))
            {
                var functionalityActiveStatusData = FunctionalityActiveStatusDataManager.GetList(SessionVariables.RequestProfile);
                var dv = functionalityActiveStatusData.DefaultView;
                dv.Sort = "Name ASC";
                UIHelper.LoadDropDown(dv.ToTable(), dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      FunctionalityActiveStatusDataModel.DataColumns.FunctionalityActiveStatusId);
            }

            dropDownListControl.SelectedIndex = 0;
        }
Beispiel #2
0
        private void SetupDropdown()
        {
            var isTesting  = SessionVariables.IsTesting;
            var personData = ApplicationUserDataManager.GetList(SessionVariables.RequestProfile);

            UIHelper.LoadDropDown(personData, drpPersonList, ApplicationUserDataModel.DataColumns.FirstName,
                                  ApplicationUserDataModel.DataColumns.ApplicationUserId);

            drpPersonList.SelectedValue = SessionVariables.RequestProfile.AuditId.ToString();

            var applicationData = ApplicationDataManager.GetList(SessionVariables.RequestProfile);

            UIHelper.LoadDropDown(applicationData, drpApplicationList, ApplicationDataModel.DataColumns.Name,
                                  ApplicationDataModel.DataColumns.ApplicationId);

            if (isTesting)
            {
                //drpPersonList.AutoPostBack = true;


                if (drpPersonList.Items.Count > 0)
                {
                    if (!string.IsNullOrEmpty(txtPersonId.Text.Trim()))
                    {
                        drpPersonList.SelectedValue = txtPersonId.Text;
                    }
                    else
                    {
                        txtPersonId.Text = drpPersonList.SelectedItem.Value;
                    }
                }

                if (drpApplicationList.Items.Count > 0)
                {
                    if (!string.IsNullOrEmpty(txtApplicationId.Text.Trim()))
                    {
                        drpApplicationList.SelectedValue = txtApplicationId.Text;
                    }
                    else
                    {
                        txtApplicationId.Text = drpApplicationList.SelectedItem.Value;
                    }
                }
                txtPersonId.Visible      = true;
                txtApplicationId.Visible = true;
            }
            else
            {
                if (!string.IsNullOrEmpty(txtPersonId.Text.Trim()))
                {
                    drpPersonList.SelectedValue = txtPersonId.Text;
                }
                if (!string.IsNullOrEmpty(txtApplicationId.Text.Trim()))
                {
                    drpApplicationList.SelectedValue = txtApplicationId.Text;
                }
            }
        }
Beispiel #3
0
        public override void LoadDropDownListSources(string fieldName, DropDownList dropDownListControl)
        {
            base.LoadDropDownListSources(fieldName, dropDownListControl);

            if (fieldName.Equals("ApplicationId"))
            {
                var applicationData = ApplicationDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(applicationData, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      BaseDataModel.BaseDataColumns.ApplicationId);

                dropDownListControl.SelectedValue = SessionVariables.RequestProfile.ApplicationId.ToString();
            }
        }
Beispiel #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SetUpDateRangeControl();
            if (!IsPostBack)
            {
                var auData = ApplicationUserDataManager.GetList(SessionVariables.RequestProfile);

                UIHelper.LoadDropDown(auData, drpApplicationUser, ApplicationUserDataModel.DataColumns.EmailAddress,
                                      ApplicationUserDataModel.DataColumns.EmailAddress);
                drpApplicationUser.Items.Insert(0, "All");

                var auData1 = ApplicationDataManager.GetList(SessionVariables.RequestProfile);

                UIHelper.LoadDropDown(auData1, drpApplicationId, ApplicationDataModel.DataColumns.Name,
                                      ApplicationDataModel.DataColumns.ApplicationId);
                drpApplicationId.Items.Insert(0, "All");
            }
        }
Beispiel #5
0
        private void SetupDropdown()
        {
            var isTesting = SessionVariables.IsTesting;

            drpParentMenu.ClearSelection();

            var parentMenudata = MenuDataManager.GetList(null, SessionVariables.RequestProfile);

            UIHelper.LoadDropDown(parentMenudata, drpParentMenu, MenuDataModel.DataColumns.MenuDisplayName,
                                  MenuDataModel.DataColumns.MenuId);

            var applicationData = ApplicationDataManager.GetList(SessionVariables.RequestProfile);

            UIHelper.LoadDropDown(applicationData, drpApplicationName, ApplicationDataModel.DataColumns.Name,
                                  ApplicationDataModel.DataColumns.ApplicationId);

            if (isTesting)
            {
                drpParentMenu.AutoPostBack = true;
                if (drpParentMenu.Items.Count > 0)
                {
                    if (!string.IsNullOrEmpty(txtParentMenuId.Text.Trim()))
                    {
                        drpParentMenu.SelectedValue = txtParentMenuId.Text;
                    }
                    else
                    {
                        txtParentMenuId.Text = drpParentMenu.SelectedItem.Value;
                    }
                }
                txtParentMenuId.Visible = true;
            }
            else
            {
                if (!string.IsNullOrEmpty(txtParentMenuId.Text.Trim()))
                {
                    drpParentMenu.SelectedValue = txtParentMenuId.Text;
                }
            }
        }
Beispiel #6
0
        public void CalculateRNandSDWorkedHoursForAllUsers(int appId)
        {
            var resultArray  = new ArrayList();
            var appUserName  = string.Empty;
            var emailAddress = string.Empty;
            var obj          = new ApplicationUserDataModel();
            var dt           = ApplicationUserDataManager.GetList(SessionVariables.RequestProfile);
            var dt1          = ApplicationDataManager.GetList(SessionVariables.RequestProfile);


            for (var i = 0; i < dt.Rows.Count; i++)
            {
                emailAddress = (string)(dt.Rows[i][ApplicationUserDataModel.DataColumns.EmailAddress]);
                //appUserId = (int)(dt.Rows[i][ApplicationUserDataModel.DataColumns.ApplicationUserId]);
                //appId = (int)(dt1.Rows[i][ApplicationDataModel.DataColumns.ApplicationId]);
                appUserName = dt.Rows[i][ApplicationUserDataModel.DataColumns.FirstName] + " " + dt.Rows[i][ApplicationUserDataModel.DataColumns.LastName];
                var result = CalculateRNandSDWorkedHours(emailAddress, appId);
                result.TotalRNHrs = string.Format("{0}.00", result.TotalRNHrs);
                resultArray.Add(result);
            }

            gv.DataSource = resultArray;
            gv.DataBind();
        }
Beispiel #7
0
        public virtual void LoadDropDownListSources(string fieldName, DropDownList dropDownListControl)
        {
            DataTable dataSource = null;

            if (fieldName.Equals("Application"))
            {
                dataSource = ApplicationDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(dataSource, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      BaseDataModel.BaseDataColumns.ApplicationId);

                dropDownListControl.SelectedValue = SessionVariables.RequestProfile.ApplicationId.ToString();
            }
            else if (fieldName.Equals("ParentMenu"))
            {
                var data = new MenuDataModel();

                var appId = BaseSearchFilterControl.GetParameterValueAsInt("Application");
                if (appId.HasValue)
                {
                    data.ApplicationId = appId.Value;
                }
                else
                {
                    data.ApplicationId = SessionVariables.RequestProfile.ApplicationId;
                }

                dataSource = MenuDataManager.ListOfParentMenuOnly(data, SessionVariables.RequestProfile);
                dataSource.DefaultView.Sort = StandardDataModel.StandardDataColumns.Name + " ASC";
                dataSource = dataSource.DefaultView.ToTable();

                dropDownListControl.Items.Clear();

                dropDownListControl.Items.Add(new ListItem("All", "-1"));

                dropDownListControl.DataSource     = dataSource;
                dropDownListControl.DataTextField  = StandardDataModel.StandardDataColumns.Name;
                dropDownListControl.DataValueField = MenuDataModel.DataColumns.MenuId;

                dropDownListControl.DataBind();
            }
            else if (fieldName.Equals("FunctionalityId"))
            {
                dataSource = FunctionalityDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(dataSource, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      FunctionalityDataModel.DataColumns.FunctionalityId);
            }
            else if (fieldName.Equals("DeveloperRoleId"))
            {
                dataSource = DeveloperRoleDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(dataSource, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      DeveloperRoleDataModel.DataColumns.DeveloperRoleId);
            }
            else if (fieldName.Equals("FeatureOwnerStatusId"))
            {
                dataSource = FeatureOwnerStatusDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(dataSource, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      FeatureOwnerStatusDataModel.DataColumns.FeatureOwnerStatusId);
            }

            else if (fieldName.Equals("EntityId"))
            {
                dataSource = Framework.Components.Core.SystemEntityTypeDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(dataSource, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      DataModel.Framework.Core.SystemEntityTypeDataModel.DataColumns.SystemEntityTypeId);
            }

            else if (fieldName.Equals("ProjectId"))
            {
                dataSource = ProjectDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(dataSource, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      ProjectDataModel.DataColumns.ProjectId);
            }
            else if (fieldName.Equals("ApplicationId"))
            {
                var applicationData = ApplicationDataManager.GetList(SessionVariables.RequestProfile);
                var dv = applicationData.DefaultView;
                dv.Sort = "Name ASC";
                UIHelper.LoadDropDown(dv.ToTable(), dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      BaseDataModel.BaseDataColumns.ApplicationId);
            }
            else if (fieldName.Equals("FunctionalityOwner"))
            {
                var drData = FunctionalityOwnerDataManager.GetList(SessionVariables.RequestProfile);
                CommonSearchParameters();
                var originalList  = new ArrayList();
                var duplicateList = new ArrayList();
                foreach (DataRow dtRow in drData.Rows)
                {
                    if (originalList.Contains(dtRow["Developer"]))
                    {
                        duplicateList.Add(dtRow);
                    }
                    else
                    {
                        originalList.Add(dtRow["Developer"]);
                    }
                }
                foreach (DataRow dtRow in duplicateList)
                {
                    drData.Rows.Remove(dtRow);
                }
                UIHelper.LoadDropDown(drData, dropDownListControl,
                                      FunctionalityOwnerDataModel.DataColumns.Developer,
                                      FunctionalityOwnerDataModel.DataColumns.FunctionalityOwnerId);
            }
            else if (fieldName.Equals("FunctionalityActiveStatus"))
            {
                var drData = FunctionalityActiveStatusDataManager.GetList(SessionVariables.RequestProfile);
                CommonSearchParameters();
                UIHelper.LoadDropDown(drData, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      FunctionalityActiveStatusDataModel.DataColumns.FunctionalityActiveStatusId);
            }
            else if (fieldName.Equals("FunctionalityImage"))
            {
                var drData = FunctionalityImageDataManager.GetList(SessionVariables.RequestProfile);
                CommonSearchParameters();
                UIHelper.LoadDropDown(drData, dropDownListControl,
                                      FunctionalityImageDataModel.DataColumns.Title,
                                      FunctionalityImageDataModel.DataColumns.FunctionalityImageId);
            }
            else if (fieldName.Equals("FunctionalityImageAttribute"))
            {
                var drData = FunctionalityImageAttributeDataManager.GetList(SessionVariables.RequestProfile);
                CommonSearchParameters();
                UIHelper.LoadDropDown(drData, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      FunctionalityImageAttributeDataModel.DataColumns.FunctionalityImageAttributeId);
            }
        }
Beispiel #8
0
        public virtual void LoadDropDownListSources(string fieldName, DropDownList dropDownListControl)
        {
            DataTable dataSource = null;

            if (fieldName.Equals("FunctionalityId"))
            {
                dataSource = FunctionalityDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(dataSource, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      FunctionalityDataModel.DataColumns.FunctionalityId);
            }
            else if (fieldName.Equals("ProjectId"))
            {
                dataSource = ProjectDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(dataSource, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      ProjectDataModel.DataColumns.ProjectId);
            }
            else if (fieldName.Equals("DeveloperRoleId"))
            {
                dataSource = DeveloperRoleDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(dataSource, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      DeveloperRoleDataModel.DataColumns.DeveloperRoleId);
            }
            else if (fieldName.Equals("UseCaseId"))
            {
                dataSource = UseCaseDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(dataSource, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      UseCaseDataModel.DataColumns.UseCaseId);
            }

            else if (fieldName.Equals("NeedId"))
            {
                dataSource = NeedDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(dataSource, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      NeedDataModel.DataColumns.NeedId);
            }

            else if (fieldName.Equals("ProjectUseCaseStatusId"))
            {
                dataSource = ProjectUseCaseStatusDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(dataSource, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      ProjectUseCaseStatusDataModel.DataColumns.ProjectUseCaseStatusId);
            }
            else if (fieldName.Equals("FeatureOwnerStatusId"))
            {
                dataSource = FeatureOwnerStatusDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(dataSource, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      FeatureOwnerStatusDataModel.DataColumns.FeatureOwnerStatusId);
            }

            else if (fieldName.Equals("EntityId"))
            {
                dataSource = Framework.Components.Core.SystemEntityTypeDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(dataSource, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      DataModel.Framework.Core.SystemEntityTypeDataModel.DataColumns.SystemEntityTypeId);
            }

            else if (fieldName.Equals("ProjectId"))
            {
                dataSource = ProjectDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(dataSource, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      ProjectDataModel.DataColumns.ProjectId);
            }

            else if (fieldName.Equals("ApplicationId"))
            {
                var applicationData = ApplicationDataManager.GetList(SessionVariables.RequestProfile);
                var dv = applicationData.DefaultView;
                dv.Sort = "Name ASC";
                UIHelper.LoadDropDown(dv.ToTable(), dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      BaseDataModel.BaseDataColumns.ApplicationId);
            }
            else if (fieldName.Equals("FunctionalityOwner"))
            {
                var drData = FunctionalityOwnerDataManager.GetList(SessionVariables.RequestProfile);
                CommonSearchParameters();
                var originalList  = new ArrayList();
                var duplicateList = new ArrayList();
                foreach (DataRow dtRow in drData.Rows)
                {
                    if (originalList.Contains(dtRow["Developer"]))
                    {
                        duplicateList.Add(dtRow);
                    }
                    else
                    {
                        originalList.Add(dtRow["Developer"]);
                    }
                }
                foreach (DataRow dtRow in duplicateList)
                {
                    drData.Rows.Remove(dtRow);
                }
                UIHelper.LoadDropDown(drData, dropDownListControl,
                                      FunctionalityOwnerDataModel.DataColumns.Developer,
                                      FunctionalityOwnerDataModel.DataColumns.FunctionalityOwnerId);
            }
            else if (fieldName.Equals("FunctionalityActiveStatus"))
            {
                var drData = FunctionalityActiveStatusDataManager.GetList(SessionVariables.RequestProfile);
                CommonSearchParameters();
                UIHelper.LoadDropDown(drData, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      FunctionalityActiveStatusDataModel.DataColumns.FunctionalityActiveStatusId);
            }
            else if (fieldName.Equals("FunctionalityImage"))
            {
                var drData = FunctionalityImageDataManager.GetList(SessionVariables.RequestProfile);
                CommonSearchParameters();
                UIHelper.LoadDropDown(drData, dropDownListControl,
                                      FunctionalityImageDataModel.DataColumns.Title,
                                      FunctionalityImageDataModel.DataColumns.FunctionalityImageId);
            }
            else if (fieldName.Equals("FunctionalityImageAttribute"))
            {
                var drData = FunctionalityImageAttributeDataManager.GetList(SessionVariables.RequestProfile);
                CommonSearchParameters();
                UIHelper.LoadDropDown(drData, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      FunctionalityImageAttributeDataModel.DataColumns.FunctionalityImageAttributeId);
            }
            else if (fieldName.Equals("TabParentStructure"))
            {
                var drData = TabParentStructureDataManager.GetList(SessionVariables.RequestProfile);
                CommonSearchParameters();
                UIHelper.LoadDropDown(drData, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      TabParentStructureDataModel.DataColumns.TabParentStructureId);
            }
        }
Beispiel #9
0
        private void SetupDropdown()
        {
            var isTesting            = SessionVariables.IsTesting;
            var systemEntityTypeData = Framework.Components.Core.SystemEntityTypeDataManager.GetList(SessionVariables.RequestProfile);

            UIHelper.LoadDropDown(systemEntityTypeData, drpSystemEntityTypeList, SystemEntityTypeDataModel.DataColumns.EntityName, SystemEntityTypeDataModel.DataColumns.SystemEntityTypeId);

            var applicationData = ApplicationDataManager.GetList(SessionVariables.RequestProfile);

            UIHelper.LoadDropDown(applicationData, drpApplicationList, ApplicationDataModel.DataColumns.Name, ApplicationDataModel.DataColumns.ApplicationId);
            drpApplicationList.AutoPostBack = true;

            var data = new FieldConfigurationModeDataModel();

            data.ApplicationId = Convert.ToInt32(drpApplicationList.SelectedValue);
            //data.ApplicationId = SessionVariables.RequestProfile.ApplicationId;
            var fieldConfigurationModeData = FieldConfigurationModeDataManager.GetDetails(data, SessionVariables.RequestProfile);

            UIHelper.LoadDropDown(fieldConfigurationModeData, ddlFieldConfigurationMode, StandardDataModel.StandardDataColumns.Name, FieldConfigurationModeDataModel.DataColumns.FieldConfigurationModeId);
            if (isTesting)
            {
                drpSystemEntityTypeList.AutoPostBack = true;

                if (drpSystemEntityTypeList.Items.Count > 0)
                {
                    if (!string.IsNullOrEmpty(txtSystemEntityTypeId.Text.Trim()))
                    {
                        drpSystemEntityTypeList.SelectedValue = txtSystemEntityTypeId.Text;
                    }
                    else
                    {
                        txtSystemEntityTypeId.Text = drpSystemEntityTypeList.SelectedItem.Value;
                    }
                }

                txtSystemEntityTypeId.Visible          = true;
                ddlFieldConfigurationMode.AutoPostBack = true;

                if (ddlFieldConfigurationMode.Items.Count > 0)
                {
                    if (!string.IsNullOrEmpty(txtFieldConfigurationMode.Text.Trim()))
                    {
                        ddlFieldConfigurationMode.SelectedValue = txtFieldConfigurationMode.Text;
                    }
                    else
                    {
                        txtFieldConfigurationMode.Text = ddlFieldConfigurationMode.SelectedItem.Value;
                    }
                }
                txtFieldConfigurationMode.Visible = true;
            }
            else
            {
                if (!string.IsNullOrEmpty(txtSystemEntityTypeId.Text.Trim()))
                {
                    drpSystemEntityTypeList.SelectedValue = txtSystemEntityTypeId.Text;
                }
                if (!string.IsNullOrEmpty(txtFieldConfigurationMode.Text.Trim()))
                {
                    ddlFieldConfigurationMode.SelectedValue = txtFieldConfigurationMode.Text;
                }
                txtSystemEntityTypeId.Visible     = false;
                txtFieldConfigurationMode.Visible = false;
            }
        }
Beispiel #10
0
        public void CalculateRNandSDWorkedHoursForAllUsersAllApps()
        {
            gv.DataSource = "";
            gv.DataBind();
            var resultArray  = new ArrayList();
            var appUserName  = string.Empty;
            var emailAddress = string.Empty;
            var result       = new ResultSet(string.Empty, "", "");
            var obj          = new ApplicationUserDataModel();

            SessionVariables.RequestProfile.ApplicationId = 100047;
            var applicationUserList = ApplicationUserDataManager.GetList(SessionVariables.RequestProfile);
            var applicationList     = ApplicationDataManager.GetList(SessionVariables.RequestProfile);
            var bc = new BoundField();

            for (var i = 0; i < applicationUserList.Rows.Count; i++)
            {
                var rnHrs = "0";
                emailAddress = (string)(applicationUserList.Rows[i][ApplicationUserDataModel.DataColumns.EmailAddress]);
                for (var j = 0; j < applicationList.Rows.Count; j++)
                {
                    var applicationName = applicationList.Rows[j][ApplicationDataModel.DataColumns.Name];
                    result = CalculateRNandSDWorkedHours(emailAddress, (int)applicationList.Rows[j][ApplicationDataModel.DataColumns.ApplicationId]);
                    rnHrs  = (int.Parse(result.TotalRNHrs) + int.Parse(rnHrs)).ToString();
                }
                result.TotalRNHrs = string.Format("{0}.00", rnHrs);
                resultArray.Add(result);
            }

            var cell = 3;

            for (var i = 0; i < applicationList.Rows.Count; i++)
            {
                if (!applicationList.Rows[i][ApplicationDataModel.DataColumns.Code].ToString().Equals(""))
                {
                    gv.Columns.Add(new BoundField());
                    var applicationName = applicationList.Rows[i][ApplicationDataModel.DataColumns.Name];
                    gv.Columns[cell].HeaderText = applicationName.ToString();
                    cell++;
                }
            }
            gv.DataSource = resultArray;
            gv.DataBind();
            for (var i = 0; i < applicationUserList.Rows.Count; i++)
            {
                cell         = 3;
                emailAddress = (string)(applicationUserList.Rows[i][ApplicationUserDataModel.DataColumns.EmailAddress]);
                for (var j = 0; j < applicationList.Rows.Count; j++)
                {
                    if (!applicationList.Rows[j][ApplicationDataModel.DataColumns.Code].ToString().Equals(""))
                    {
                        var applicationName = applicationList.Rows[j][ApplicationDataModel.DataColumns.Name];
                        result = CalculateRNandSDWorkedHours(emailAddress, (int)applicationList.Rows[j][ApplicationDataModel.DataColumns.ApplicationId]);
                        gv.Rows[i].Cells[cell].HorizontalAlign = HorizontalAlign.Right;
                        gv.Rows[i].Cells[cell].Text            = string.Format("{0}.00", result.TotalRNHrs);
                        cell++;
                    }
                }
            }


            int rowscount    = gv.Rows.Count;
            int columnscount = gv.Columns.Count;

            for (int j = 3; j < columnscount; j++)
            {
                var countRemove = 0;

                for (int i = 1; i < rowscount; i++)
                {
                    if (Convert.ToDouble(gv.Rows[i].Cells[j].Text) != 0.00)
                    {
                        countRemove++;
                    }
                }
                if (countRemove == 0)
                {
                    gv.Columns[j].Visible = false;
                }
            }
        }
Beispiel #11
0
        protected void btnSubmit_OnClick(object sender, EventArgs e)
        {
            var appId = 0;
            var rs    = new ResultSet("", "", "");
            var rnHrs = "0";

            if (drpApplicationUser.SelectedItem.Value.Equals("All"))
            {
                if (drpApplicationId.SelectedItem.Value.Equals("All"))
                {
                    CalculateRNandSDWorkedHoursForAllUsersAllApps();
                }
                else
                {
                    appId = int.Parse(drpApplicationId.SelectedValue);
                    CalculateRNandSDWorkedHoursForAllUsers(appId);
                }
            }
            else
            {
                var applicationNames = new List <string>();
                if (drpApplicationId.SelectedItem.Value.Equals("All"))
                {
                    var dt           = ApplicationDataManager.GetList(SessionVariables.RequestProfile);
                    var cell         = 3;
                    var emailAddress = drpApplicationUser.SelectedValue;
                    for (var i = 0; i < dt.Rows.Count; i++)
                    {
                        if (!dt.Rows[i][ApplicationDataModel.DataColumns.Code].ToString().Equals(""))
                        {
                            appId = int.Parse(dt.Rows[i][ApplicationDataModel.DataColumns.ApplicationId].ToString());
                            rs    = CalculateRNandSDWorkedHours(emailAddress, appId);
                            rnHrs = (int.Parse(rs.TotalRNHrs) + int.Parse(rnHrs)).ToString();

                            applicationNames.Add(dt.Rows[i][ApplicationDataModel.DataColumns.Name].ToString());
                        }
                    }
                    var count  = applicationNames.Count;
                    var count1 = 3;
                    var limit  = count + count1;
                    for (var i = 3; i < limit; i++)
                    {
                        if (gv.Columns.Count < limit)
                        {
                            gv.Columns.Add(new BoundField());
                            var applicationName = dt.Rows[i][ApplicationDataModel.DataColumns.Name];
                            gv.Columns[cell].HeaderText = applicationName.ToString();
                            cell++;
                        }
                    }

                    rs.TotalRNHrs = string.Format("{0}.00", rnHrs);
                    gv.DataSource = new List <ResultSet>()
                    {
                        rs
                    };
                    gv.DataBind();
                    cell = 3;
                    for (var i = 0; i < dt.Rows.Count; i++)
                    {
                        if (!dt.Rows[i][ApplicationDataModel.DataColumns.Code].ToString().Equals(""))
                        {
                            appId = int.Parse(dt.Rows[i][ApplicationDataModel.DataColumns.ApplicationId].ToString());
                            rs    = CalculateRNandSDWorkedHours(emailAddress, appId);
                            gv.Rows[0].Cells[cell].HorizontalAlign = HorizontalAlign.Right;
                            gv.Rows[0].Cells[cell].Text            = string.Format("{0}.00", rs.TotalRNHrs);
                            cell++;
                        }
                    }
                }
                else
                {
                    gv.DataSource = "";
                    gv.DataBind();
                    appId = int.Parse(drpApplicationId.SelectedValue);
                    var emailAddress = drpApplicationUser.SelectedValue;
                    rs            = CalculateRNandSDWorkedHours(emailAddress, appId);
                    rnHrs         = (int.Parse(rs.TotalRNHrs) + int.Parse(rnHrs)).ToString();
                    rs.TotalRNHrs = string.Format("{0}.00", rnHrs);
                    var listRs = new List <ResultSet> {
                        rs
                    };
                    gv.DataSource = listRs;
                    gv.DataBind();
                }
            }
        }