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

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = MDProjectScheduleItemEntity.FLD_NAME_ProjectScheduleItemID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                mDProjectScheduleItemEntityList = FCCMDProjectScheduleItem.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(mDProjectScheduleItemEntityList ?? new List <MDProjectScheduleItemEntity>());
        }
예제 #2
0
        private void BuildTree()
        {
            this.Nodes.Clear();

            nodeList = FCCMDProjectScheduleItem.GetFacadeCreate().GetIL(null, null, String.Empty, String.Empty, DatabaseOperationType.Load);

            TreeNode rootNode = new TreeNode();

            rootNode.Text         = "Project Schedule Item";
            rootNode.Value        = "0";
            rootNode.SelectAction = TreeNodeSelectAction.SelectExpand;
            rootNode.Expanded     = true;

            LoadCategories(rootNode, null);

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

            try
            {
                mDProjectScheduleItemEntityList = FCCMDProjectScheduleItem.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(mDProjectScheduleItemEntityList ?? new List <MDProjectScheduleItemEntity>());
        }
예제 #4
0
        private void DeleteDocumentCategory()
        {
            Int64 ProjectScheduleItemID;

            Int64.TryParse(treeProjectScheduleItem.SelectedValue, out ProjectScheduleItemID);

            if (ProjectScheduleItemID > 0)
            {
                try
                {
                    Int64 result = -1;

                    String fe = SqlExpressionBuilder.PrepareFilterExpression(MDProjectScheduleItemEntity.FLD_NAME_ProjectScheduleItemID, ProjectScheduleItemID.ToString(), SQLMatchType.Equal);

                    MDProjectScheduleItemEntity mDProjectScheduleItemEntity = new MDProjectScheduleItemEntity();


                    result = FCCMDProjectScheduleItem.GetFacadeCreate().Delete(mDProjectScheduleItemEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                    if (result == 0)
                    {
                        _ProjectScheduleItemID       = 0;
                        _MDProjectScheduleItemEntity = new MDProjectScheduleItemEntity();

                        PrepareInitialView();

                        LoadTreeView();

                        MiscUtil.ShowMessage(lblMessage, "Project Schedule Item has been successfully deleted.", true);
                    }
                    else
                    {
                        MiscUtil.ShowMessage(lblMessage, "Failed to delete Project Document Category.", true);
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
예제 #5
0
        private void SaveMDProjectScheduleItemEntity()
        {
            if (IsValid)
            {
                try
                {
                    MDProjectScheduleItemEntity mDProjectScheduleItemEntity = BuildMDProjectScheduleItemEntity();

                    Int64 result = -1;

                    if (mDProjectScheduleItemEntity.IsNew)
                    {
                        if (treeProjectScheduleItem.SelectedNode != null)
                        {
                            if (treeProjectScheduleItem.SelectedValue == "0")
                            {
                                mDProjectScheduleItemEntity.ParentProjectScheduleItemID = null;
                            }
                            else
                            {
                                mDProjectScheduleItemEntity.ParentProjectScheduleItemID = Int64.Parse(treeProjectScheduleItem.SelectedValue);
                            }
                        }
                        result = FCCMDProjectScheduleItem.GetFacadeCreate().Add(mDProjectScheduleItemEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(MDProjectScheduleItemEntity.FLD_NAME_ProjectScheduleItemID, mDProjectScheduleItemEntity.ProjectScheduleItemID.ToString(), SQLMatchType.Equal);
                        result = FCCMDProjectScheduleItem.GetFacadeCreate().Update(mDProjectScheduleItemEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _ProjectScheduleItemID       = 0;
                        _MDProjectScheduleItemEntity = new MDProjectScheduleItemEntity();
                        PrepareInitialView();
                        BindMDProjectScheduleItemList();

                        if (mDProjectScheduleItemEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Project Schedule Item Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Project Schedule Item Information has been updated successfully.", false);
                        }

                        LoadTreeView();
                    }
                    else
                    {
                        if (mDProjectScheduleItemEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Project Schedule Item Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Project Schedule Item Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }