Пример #1
0
        public void LoadData(int taskAlgorithmId, bool showId)
        {
            Clear();

            var data = new TaskAlgorithmDataModel();

            data.TaskAlgorithmId = taskAlgorithmId;

            var items = TaskAlgorithmDataManager.GetEntityDetails(data, SessionVariables.RequestProfile);

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

            var item = items[0];

            SetData(item);

            if (!showId)
            {
                SystemKeyId = item.TaskAlgorithmId;
                oHistoryList.Setup(PrimaryEntity, taskAlgorithmId, PrimaryEntityKey);
            }
            else
            {
                CoreSystemKey.Text = String.Empty;
            }
        }
Пример #2
0
        public override int?Save(string action)
        {
            var data = new TaskAlgorithmDataModel();

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

            if (action == "Insert")
            {
                var dtTaskAlgorithm = TaskAlgorithmDataManager.DoesExist(data, SessionVariables.RequestProfile);

                if (dtTaskAlgorithm.Rows.Count == 0)
                {
                    TaskAlgorithmDataManager.Create(data, SessionVariables.RequestProfile);
                }
                else
                {
                    throw new Exception("Record with given ID already exists.");
                }
            }
            else
            {
                TaskAlgorithmDataManager.Update(data, SessionVariables.RequestProfile);
            }

            return(data.TaskAlgorithmId);
        }
Пример #3
0
        private void SetupDropdown()
        {
            var isTesting    = SessionVariables.IsTesting;
            var activityData = ActivityDataManager.GetList(SessionVariables.RequestProfile);

            UIHelper.LoadDropDown(activityData, drpActivityList, StandardDataModel.StandardDataColumns.Name, ActivityDataModel.DataColumns.ActivityId);

            var taskAlgorithmItemIdData = TaskAlgorithmDataManager.GetList(SessionVariables.RequestProfile);

            UIHelper.LoadDropDown(taskAlgorithmItemIdData, drpTaskAlgorithmList, StandardDataModel.StandardDataColumns.Name, TaskAlgorithmDataModel.DataColumns.TaskAlgorithmId);

            if (isTesting)
            {
                drpActivityList.AutoPostBack      = true;
                drpTaskAlgorithmList.AutoPostBack = true;

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

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

                txtActivityId.Visible      = true;
                txtTaskAlgorithmId.Visible = true;
            }
            else
            {
                if (!string.IsNullOrEmpty(txtActivityId.Text.Trim()))
                {
                    drpActivityList.SelectedValue = txtActivityId.Text;
                }

                if (!string.IsNullOrEmpty(txtTaskAlgorithmId.Text.Trim()))
                {
                    drpTaskAlgorithmList.SelectedValue = txtTaskAlgorithmId.Text;
                }
            }
        }
Пример #4
0
        public override void LoadDropDownListSources(string fieldName, DropDownList dropDownListControl)
        {
            base.LoadDropDownListSources(fieldName, dropDownListControl);

            if (fieldName.Equals("ActivityId"))
            {
                var activityData = ActivityDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(activityData, dropDownListControl, StandardDataModel.StandardDataColumns.Name, ActivityDataModel.DataColumns.ActivityId);
            }

            if (fieldName.Equals("TaskAlgorithmId"))
            {
                var taskAlgorithmItemIdData = TaskAlgorithmDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(taskAlgorithmItemIdData, dropDownListControl, StandardDataModel.StandardDataColumns.Name, TaskAlgorithmDataModel.DataColumns.TaskAlgorithmId);
            }
        }
Пример #5
0
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     try
     {
         string[] deleteIndexList = DeleteIds.Split(',');
         foreach (string index in deleteIndexList)
         {
             var data = new TaskAlgorithmDataModel();
             data.TaskAlgorithmId = int.Parse(index);
             TaskAlgorithmDataManager.Delete(data, SessionVariables.RequestProfile);
             DeleteAndRedirect();
         }
     }
     catch (Exception ex)
     {
         Response.Write(ex.Message);
     }
 }
Пример #6
0
        protected override void ShowData(int taskAlgorithmId)
        {
            base.ShowData(taskAlgorithmId);

            oDetailButtonPanel.SetId = SetId;

            Clear();

            var data = new TaskAlgorithmDataModel();

            data.TaskAlgorithmId = taskAlgorithmId;

            var items = TaskAlgorithmDataManager.GetEntityDetails(data, SessionVariables.RequestProfile);

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

                SetData(item);

                oHistoryList.Setup(PrimaryEntity, taskAlgorithmId, "TaskAlgorithm");
            }
        }
Пример #7
0
        protected override DataTable GetData()
        {
            var dt = TaskAlgorithmDataManager.Search(oSearchFilter.SearchParameters, SessionVariables.RequestProfile);

            return(dt);
        }