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

            var data = new TaskPriorityXApplicationUserDataManager.Data();

            data.TaskPriorityXApplicationUserId = taskPriorityXApplicationUserId;
            var items = TaskPriorityXApplicationUserDataManager.GetEntityDetails(data, SessionVariables.RequestProfile);


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

            var item = items[0];

            TaskPriorityXApplicationUserId = item.TaskPriorityXApplicationUserId;
            TaskId             = item.TaskId;
            ApplicationUserId  = item.ApplicationUserId;
            TaskPriorityTypeId = item.TaskPriorityTypeId;

            if (!showId)
            {
                txtTaskPriorityXApplicationUserId.Text = item.TaskPriorityXApplicationUserId.ToString();
                oHistoryList.Setup(PrimaryEntity, taskPriorityXApplicationUserId, PrimaryEntityKey);
            }
            else
            {
                txtTaskPriorityXApplicationUserId.Text = String.Empty;
            }
        }
Exemplo n.º 2
0
        public override int?Save(string action)
        {
            var data = new TaskPriorityXApplicationUserDataManager.Data();

            data.TaskPriorityXApplicationUserId = TaskPriorityXApplicationUserId;
            data.TaskId             = TaskId;
            data.ApplicationUserId  = ApplicationUserId;
            data.TaskPriorityTypeId = TaskPriorityTypeId;

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

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

            return(TaskPriorityXApplicationUserId);
        }
Exemplo n.º 3
0
        protected override void ShowData(int taskPriorityXApplicationUserId)
        {
            base.ShowData(taskPriorityXApplicationUserId);

            oDetailButtonPanel.SetId = SetId;

            Clear();

            var data = new TaskPriorityXApplicationUserDataManager.Data();

            data.TaskPriorityXApplicationUserId = taskPriorityXApplicationUserId;

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

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

                lblTaskPriorityXApplicationUserId.Text = item.TaskPriorityXApplicationUserId.ToString();
                lblTask.Text             = item.TaskId.ToString();
                lblApplicationUser.Text  = item.ApplicationUserId.ToString();
                lblTaskPriorityType.Text = item.TaskPriorityTypeId.ToString();

                oHistoryList.Setup(PrimaryEntity, taskPriorityXApplicationUserId, "TaskPriorityXApplicationUser");
            }
        }
Exemplo n.º 4
0
        private System.Data.DataTable GetData()
        {
            // TODO: on all export pages
            var data = new TaskPriorityXApplicationUserDataManager.Data();

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

            return(dt);
        }
Exemplo n.º 5
0
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     try
     {
         string[] deleteIndexList = DeleteIds.Split(',');
         foreach (string index in deleteIndexList)
         {
             var data = new TaskPriorityXApplicationUserDataManager.Data();
             data.TaskPriorityXApplicationUserId = int.Parse(index);
             TaskPriorityXApplicationUserDataManager.Delete(data, SessionVariables.RequestProfile);
             DeleteAndRedirect();
         }
     }
     catch (Exception ex)
     {
         Response.Write(ex.Message);
     }
 }
Exemplo n.º 6
0
        protected override DataTable GetData()
        {
            var dt = TaskPriorityXApplicationUserDataManager.Search(oSearchFilter.SearchParameters, SessionVariables.RequestProfile);

            return(dt);
        }