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

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = MDProjectCategoryEntity.FLD_NAME_ProjectCategoryID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                mDProjectCategoryEntityList = FCCMDProjectCategory.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(mDProjectCategoryEntityList ?? new List <MDProjectCategoryEntity>());
        }
예제 #2
0
        private void SaveMDProjectCategoryEntity()
        {
            if (IsValid)
            {
                try
                {
                    MDProjectCategoryEntity mDProjectCategoryEntity = BuildMDProjectCategoryEntity();

                    Int64 result = -1;

                    if (mDProjectCategoryEntity.IsNew)
                    {
                        result = FCCMDProjectCategory.GetFacadeCreate().Add(mDProjectCategoryEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(MDProjectCategoryEntity.FLD_NAME_ProjectCategoryID, mDProjectCategoryEntity.ProjectCategoryID.ToString(), SQLMatchType.Equal);
                        result = FCCMDProjectCategory.GetFacadeCreate().Update(mDProjectCategoryEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _ProjectCategoryID       = 0;
                        _MDProjectCategoryEntity = new MDProjectCategoryEntity();
                        PrepareInitialView();
                        BindMDProjectCategoryList();

                        if (mDProjectCategoryEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Project Category Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Project Category Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (mDProjectCategoryEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Project Category Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Project Category Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
예제 #3
0
        protected void lvMDProjectCategory_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 ProjectCategoryID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(MDProjectCategoryEntity.FLD_NAME_ProjectCategoryID, ProjectCategoryID.ToString(), SQLMatchType.Equal);

                        MDProjectCategoryEntity mDProjectCategoryEntity = new MDProjectCategoryEntity();


                        result = FCCMDProjectCategory.GetFacadeCreate().Delete(mDProjectCategoryEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _ProjectCategoryID       = 0;
                            _MDProjectCategoryEntity = new MDProjectCategoryEntity();
                            PrepareInitialView();
                            BindMDProjectCategoryList();

                            MiscUtil.ShowMessage(lblMessage, "Project Category has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Project Category.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
        private void BuildTree()
        {
            this.Nodes.Clear();

            projectCategoryList = FCCMDProjectCategory.GetFacadeCreate().GetIL(null, null, String.Empty, String.Empty, DatabaseOperationType.Load);

            TreeNode rootNode = new TreeNode();

            rootNode.Text         = "Project Category Status Tree";
            rootNode.Value        = "0";
            rootNode.SelectAction = TreeNodeSelectAction.Expand;
            rootNode.Expanded     = true;

            LoadCategories(rootNode);

            this.Nodes.Add(rootNode);
        }
        public IList <MDProjectCategoryEntity> GetData()
        {
            IList <MDProjectCategoryEntity> mDProjectCategoryEntityList = new List <MDProjectCategoryEntity>();

            try
            {
                mDProjectCategoryEntityList = FCCMDProjectCategory.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(mDProjectCategoryEntityList ?? new List <MDProjectCategoryEntity>());
        }