public IList <MDProjectAssignedPersonTeamRoleEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression)
        {
            IList <MDProjectAssignedPersonTeamRoleEntity> mDProjectAssignedPersonTeamRoleEntityList = new List <MDProjectAssignedPersonTeamRoleEntity>();

            try
            {
                if (pageSize == -1)
                {
                    pageSize = 1000000000;
                }

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = MDProjectAssignedPersonTeamRoleEntity.FLD_NAME_ProjectAssignedPersonTeamRoleID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

                startRowIndex = Convert.ToInt32(startRowIndex / pageSize) + 1;

                mDProjectAssignedPersonTeamRoleEntityList = FCCMDProjectAssignedPersonTeamRole.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

                if (mDProjectAssignedPersonTeamRoleEntityList != null && mDProjectAssignedPersonTeamRoleEntityList.Count > 0)
                {
                    totalRowCount = mDProjectAssignedPersonTeamRoleEntityList[0].TotalRowCount;
                }
            }
            catch (Exception ex)
            {
            }

            return(mDProjectAssignedPersonTeamRoleEntityList ?? new List <MDProjectAssignedPersonTeamRoleEntity>());
        }
        private void SaveMDProjectAssignedPersonTeamRoleEntity()
        {
            if (IsValid)
            {
                try
                {
                    MDProjectAssignedPersonTeamRoleEntity mDProjectAssignedPersonTeamRoleEntity = BuildMDProjectAssignedPersonTeamRoleEntity();

                    Int64 result = -1;

                    if (mDProjectAssignedPersonTeamRoleEntity.IsNew)
                    {
                        result = FCCMDProjectAssignedPersonTeamRole.GetFacadeCreate().Add(mDProjectAssignedPersonTeamRoleEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(MDProjectAssignedPersonTeamRoleEntity.FLD_NAME_ProjectAssignedPersonTeamRoleID, mDProjectAssignedPersonTeamRoleEntity.ProjectAssignedPersonTeamRoleID.ToString(), SQLMatchType.Equal);
                        result = FCCMDProjectAssignedPersonTeamRole.GetFacadeCreate().Update(mDProjectAssignedPersonTeamRoleEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _ProjectAssignedPersonTeamRoleID       = 0;
                        _MDProjectAssignedPersonTeamRoleEntity = new MDProjectAssignedPersonTeamRoleEntity();
                        PrepareInitialView();
                        BindMDProjectAssignedPersonTeamRoleList();

                        if (mDProjectAssignedPersonTeamRoleEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Project Assigned Person Team Role Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Project Assigned Person Team Role Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (mDProjectAssignedPersonTeamRoleEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Project Assigned Person Team Role Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Project Assigned Person Team Role Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
        protected void lvMDProjectAssignedPersonTeamRole_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 ProjectAssignedPersonTeamRoleID;

            Int64.TryParse(e.CommandArgument.ToString(), out ProjectAssignedPersonTeamRoleID);

            if (ProjectAssignedPersonTeamRoleID > 0)
            {
                if (string.Equals(e.CommandName, "EditItem"))
                {
                    _ProjectAssignedPersonTeamRoleID = ProjectAssignedPersonTeamRoleID;

                    PrepareEditView();

                    cpeEditor.Collapsed   = false;
                    cpeEditor.ClientState = "false";
                }
                else if (string.Equals(e.CommandName, "DeleteItem"))
                {
                    try
                    {
                        Int64 result = -1;

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(MDProjectAssignedPersonTeamRoleEntity.FLD_NAME_ProjectAssignedPersonTeamRoleID, ProjectAssignedPersonTeamRoleID.ToString(), SQLMatchType.Equal);

                        MDProjectAssignedPersonTeamRoleEntity mDProjectAssignedPersonTeamRoleEntity = new MDProjectAssignedPersonTeamRoleEntity();


                        result = FCCMDProjectAssignedPersonTeamRole.GetFacadeCreate().Delete(mDProjectAssignedPersonTeamRoleEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _ProjectAssignedPersonTeamRoleID       = 0;
                            _MDProjectAssignedPersonTeamRoleEntity = new MDProjectAssignedPersonTeamRoleEntity();
                            PrepareInitialView();
                            BindMDProjectAssignedPersonTeamRoleList();

                            MiscUtil.ShowMessage(lblMessage, "Project Assigned Person Team Role has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Project Assigned Person Team Role.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
        public IList <MDProjectAssignedPersonTeamRoleEntity> GetData()
        {
            IList <MDProjectAssignedPersonTeamRoleEntity> mDProjectAssignedPersonTeamRoleEntityList = new List <MDProjectAssignedPersonTeamRoleEntity>();

            try
            {
                mDProjectAssignedPersonTeamRoleEntityList = FCCMDProjectAssignedPersonTeamRole.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

                if (mDProjectAssignedPersonTeamRoleEntityList != null && mDProjectAssignedPersonTeamRoleEntityList.Count > 0)
                {
                    totalRowCount = mDProjectAssignedPersonTeamRoleEntityList[0].TotalRowCount;
                }
            }
            catch (Exception ex)
            {
            }

            return(mDProjectAssignedPersonTeamRoleEntityList ?? new List <MDProjectAssignedPersonTeamRoleEntity>());
        }