Example #1
0
        public void LoadData(int taskPriorityTypeId, bool showId)
        {
            Clear();

            var data = new TaskPriorityTypeDataModel();

            data.TaskPriorityTypeId = taskPriorityTypeId;

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

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

            var item = items[0];

            SetData(item);

            if (!showId)
            {
                SystemKeyId = item.TaskPriorityTypeId;
                Weight      = item.Weight;
                oHistoryList.Setup(PrimaryEntity, taskPriorityTypeId, PrimaryEntityKey);
            }
            else
            {
                CoreSystemKey.Text = String.Empty;
            }
        }
Example #2
0
        public override void LoadDropDownListSources(string fieldName, DropDownList dropDownListControl)
        {
            base.LoadDropDownListSources(fieldName, dropDownListControl);

            if (fieldName.Equals("ApplicationUserId"))
            {
                var applicationUserdata = ApplicationUserDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(applicationUserdata, dropDownListControl,
                                      ApplicationUserDataModel.DataColumns.FirstName,
                                      ApplicationUserDataModel.DataColumns.ApplicationUserId);
            }
            if (fieldName.Equals("TaskPriorityTypeId"))
            {
                var taskPriorityTypedata = TaskPriorityTypeDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(taskPriorityTypedata, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      TaskPriorityTypeDataModel.DataColumns.TaskPriorityTypeId);
            }
            if (fieldName.Equals("TaskId"))
            {
                var taskdata = TaskDataManager.GetList(SessionVariables.RequestProfile);
                UIHelper.LoadDropDown(taskdata, dropDownListControl,
                                      StandardDataModel.StandardDataColumns.Name,
                                      TaskDataModel.DataColumns.TaskId);
            }
        }
Example #3
0
        public override int?Save(string action)
        {
            var data = new TaskPriorityTypeDataModel();

            data.TaskPriorityTypeId = SystemKeyId;
            data.Name        = Name;
            data.Description = Description;
            data.SortOrder   = SortOrder;
            data.Weight      = Weight;

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

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

            return(data.TaskPriorityTypeId);
        }
Example #4
0
        protected override void ShowData(int taskPriorityTypeId)
        {
            base.ShowData(taskPriorityTypeId);

            oDetailButtonPanel.SetId = SetId;

            Clear();

            var data = new TaskPriorityTypeDataModel();

            data.TaskPriorityTypeId = taskPriorityTypeId;

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

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

                lblWeight.Text = item.Weight.ToString();

                SetData(item);

                oHistoryList.Setup(PrimaryEntity, taskPriorityTypeId, "TaskPriorityType");
            }
        }
Example #5
0
        protected override DataTable GetEntityData(int?entityKey)
        {
            var taskPriorityTypedata = new TaskPriorityTypeDataModel();

            taskPriorityTypedata.TaskPriorityTypeId = entityKey;
            var results = TaskPriorityTypeDataManager.Search(taskPriorityTypedata, SessionVariables.RequestProfile);

            return(results);
        }
Example #6
0
        private System.Data.DataTable GetData()
        {
            // TODO: on all export pages
            var data = new TaskPriorityTypeDataModel();

            var dt = TaskPriorityTypeDataManager.Search(data, SessionVariables.RequestProfile);

            return(dt);
        }
Example #7
0
        protected override void Update(Dictionary <string, string> values)
        {
            var data = new TaskPriorityTypeDataModel();

            PropertyMapper.CopyProperties(data, values);

            TaskPriorityTypeDataManager.Update(data, SessionVariables.RequestProfile);

            base.Update(values);
        }
Example #8
0
        private void UpdateData(ArrayList values)
        {
            var data = new TaskPriorityTypeDataModel();

            data.TaskPriorityTypeId = int.Parse(values[0].ToString());
            data.Name        = values[1].ToString();
            data.Description = values[2].ToString();
            data.SortOrder   = int.Parse(values[3].ToString());
            TaskPriorityTypeDataManager.Update(data, SessionVariables.RequestProfile);
            ReBindEditableGrid();
        }
Example #9
0
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     try
     {
         string[] deleteIndexList = DeleteIds.Split(',');
         foreach (string index in deleteIndexList)
         {
             var data = new TaskPriorityTypeDataModel();
             data.TaskPriorityTypeId = int.Parse(index);
             TaskPriorityTypeDataManager.Delete(data, SessionVariables.RequestProfile);
             DeleteAndRedirect();
         }
     }
     catch (Exception ex)
     {
         Response.Write(ex.Message);
     }
 }
Example #10
0
        protected override DataTable UpdateData()
        {
            var UpdatedData = new DataTable();
            var data        = new TaskPriorityTypeDataModel();

            UpdatedData = TaskPriorityTypeDataManager.Search(data, SessionVariables.RequestProfile).Clone();
            for (var i = 0; i < SelectedData.Rows.Count; i++)
            {
                data.TaskPriorityTypeId =
                    Convert.ToInt32(SelectedData.Rows[i][TaskPriorityTypeDataModel.DataColumns.TaskPriorityTypeId].ToString());
                data.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))
                                        : int.Parse(SelectedData.Rows[i][StandardDataModel.StandardDataColumns.SortOrder].ToString());

                data.Weight =
                    !string.IsNullOrEmpty(CheckAndGetRepeaterTextBoxValue(TaskPriorityTypeDataModel.DataColumns.Weight))
                                        ? decimal.Parse(CheckAndGetRepeaterTextBoxValue(TaskPriorityTypeDataModel.DataColumns.Weight))
                                        : decimal.Parse(SelectedData.Rows[i][TaskPriorityTypeDataModel.DataColumns.Weight].ToString());

                TaskPriorityTypeDataManager.Update(data, SessionVariables.RequestProfile);
                data = new TaskPriorityTypeDataModel();
                data.TaskPriorityTypeId = Convert.ToInt32(SelectedData.Rows[i][TaskPriorityTypeDataModel.DataColumns.TaskPriorityTypeId].ToString());
                var dt = TaskPriorityTypeDataManager.Search(data, SessionVariables.RequestProfile);

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

                var selectedrows         = new DataTable();
                var taskPriorityTypedata = new TaskPriorityTypeDataModel();

                selectedrows = TaskPriorityTypeDataManager.GetDetails(taskPriorityTypedata, SessionVariables.RequestProfile).Clone();
                if (!string.IsNullOrEmpty(SuperKey))
                {
                    var systemEntityTypeId = (int)PrimaryEntity;
                    var lstEntityKeys      = ApplicationCommon.GetSuperKeyDetails(systemEntityTypeId, SuperKey);

                    foreach (var entityKey in lstEntityKeys)
                    {
                        taskPriorityTypedata.TaskPriorityTypeId = entityKey;
                        var result = TaskPriorityTypeDataManager.GetDetails(taskPriorityTypedata, SessionVariables.RequestProfile);
                        selectedrows.ImportRow(result.Rows[0]);
                    }
                }
                else
                {
                    taskPriorityTypedata.TaskPriorityTypeId = SetId;
                    var result = TaskPriorityTypeDataManager.GetDetails(taskPriorityTypedata, SessionVariables.RequestProfile);
                    selectedrows.ImportRow(result.Rows[0]);
                }
                return(selectedrows);
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
            return(null);
        }
Example #12
0
        private void SetupDropdown()
        {
            var isTesting = SessionVariables.IsTesting;

            var taskPriorityTypeData = TaskPriorityTypeDataManager.GetList(SessionVariables.RequestProfile);

            UIHelper.LoadDropDown(taskPriorityTypeData, drpTaskPriorityTypeList, StandardDataModel.StandardDataColumns.Name,
                                  TaskPriorityTypeDataModel.DataColumns.TaskPriorityTypeId);



            var taskData = TaskDataManager.GetList(SessionVariables.RequestProfile);

            UIHelper.LoadDropDown(taskData, drpTaskList, StandardDataModel.StandardDataColumns.Name,
                                  TaskDataModel.DataColumns.TaskId);



            var ApplicationUserData = ApplicationUserDataManager.GetList(SessionVariables.RequestProfile);

            UIHelper.LoadDropDown(ApplicationUserData, drpApplicationUserList, ApplicationUserDataModel.DataColumns.FirstName,
                                  ApplicationUserDataModel.DataColumns.ApplicationUserId);


            if (isTesting)
            {
                drpTaskList.AutoPostBack             = true;
                drpTaskPriorityTypeList.AutoPostBack = true;
                drpApplicationUserList.AutoPostBack  = true;
                if (drpTaskPriorityTypeList.Items.Count > 0)
                {
                    if (!string.IsNullOrEmpty(txtTaskPriorityTypeId.Text.Trim()))
                    {
                        drpTaskPriorityTypeList.SelectedValue = txtTaskPriorityTypeId.Text;
                    }
                    else
                    {
                        txtTaskPriorityTypeId.Text = drpTaskPriorityTypeList.SelectedItem.Value;
                    }
                }
                if (drpTaskList.Items.Count > 0)
                {
                    if (!string.IsNullOrEmpty(txtTaskId.Text.Trim()))
                    {
                        drpTaskList.SelectedValue = txtTaskId.Text;
                    }
                    else
                    {
                        txtTaskId.Text = drpTaskList.SelectedItem.Value;
                    }
                }
                if (drpApplicationUserList.Items.Count > 0)
                {
                    if (!string.IsNullOrEmpty(txtApplicationUserId.Text.Trim()))
                    {
                        drpApplicationUserList.SelectedValue = txtApplicationUserId.Text;
                    }
                    else
                    {
                        txtApplicationUserId.Text = drpApplicationUserList.SelectedItem.Value;
                    }
                }
                txtTaskPriorityTypeId.Visible = true;
                txtTaskId.Visible             = true;
                txtApplicationUserId.Visible  = true;
            }
            else
            {
                if (!string.IsNullOrEmpty(txtTaskPriorityTypeId.Text.Trim()))
                {
                    drpTaskPriorityTypeList.SelectedValue = txtTaskPriorityTypeId.Text;
                }
                if (!string.IsNullOrEmpty(txtTaskId.Text.Trim()))
                {
                    drpTaskList.SelectedValue = txtTaskId.Text;
                }
                if (!string.IsNullOrEmpty(txtApplicationUserId.Text.Trim()))
                {
                    drpApplicationUserList.SelectedValue = txtApplicationUserId.Text;
                }
            }
        }
Example #13
0
 private void ReBindEditableGrid()
 {
     var data = new TaskPriorityTypeDataModel();
     var dtTaskPriorityType = TaskPriorityTypeDataManager.Search(data, SessionVariables.RequestProfile);
 }
Example #14
0
        protected override DataTable GetData()
        {
            var dt = TaskPriorityTypeDataManager.Search(oSearchFilter.SearchParameters, SessionVariables.RequestProfile);

            return(dt);
        }