示例#1
0
        public IList <BDProjectDocumentTemplateMapEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression)
        {
            IList <BDProjectDocumentTemplateMapEntity> bDProjectDocumentTemplateMapEntityList = new List <BDProjectDocumentTemplateMapEntity>();

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = BDProjectDocumentTemplateMapEntity.FLD_NAME_ProjectDocumentTemplateMapID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                bDProjectDocumentTemplateMapEntityList = FCCBDProjectDocumentTemplateMap.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(bDProjectDocumentTemplateMapEntityList ?? new List <BDProjectDocumentTemplateMapEntity>());
        }
示例#2
0
        private void SaveBDProjectDocumentTemplateMapEntity()
        {
            try
            {
                newMappedNodes = treeDocument.CheckedNodes;

                foreach (TreeNode tn in treeDocument.CheckedNodes)
                {
                    BayTreeNodeValue bayTreeNodeValue = new BayTreeNodeValue();
                    bayTreeNodeValue.SetValuesFromString(tn.Value);

                    BDProjectDocumentTemplateMapEntity ent = new BDProjectDocumentTemplateMapEntity();
                    ent.ProjectDocumentID         = Int64.Parse(bayTreeNodeValue.Value);
                    ent.ProjectDocumentTemplateID = ProjectDocumentTemplateID;
                    newMappedDocuments.Add(ent);
                }

                IList <BDProjectDocumentTemplateMapEntity> deleteList = currentMappedDocuments.Except(newMappedDocuments, new CustomerComparer()).ToList();
                IList <BDProjectDocumentTemplateMapEntity> addNewList = newMappedDocuments.Except(currentMappedDocuments, new CustomerComparer()).ToList();

                if (deleteList != null && deleteList.Count > 0)
                {
                    foreach (BDProjectDocumentTemplateMapEntity ent in deleteList)
                    {
                        String fe1 = SqlExpressionBuilder.PrepareFilterExpression(BDProjectDocumentTemplateMapEntity.FLD_NAME_ProjectDocumentTemplateID, ent.ProjectDocumentTemplateID.ToString(), SQLMatchType.Equal);
                        String fe2 = SqlExpressionBuilder.PrepareFilterExpression(BDProjectDocumentTemplateMapEntity.FLD_NAME_ProjectDocumentID, ent.ProjectDocumentID.ToString(), SQLMatchType.Equal);
                        String fe  = SqlExpressionBuilder.PrepareFilterExpression(fe1, SQLJoinType.AND, fe2);

                        FCCBDProjectDocumentTemplateMap.GetFacadeCreate().Delete(ent, fe, DatabaseOperationType.Delete, TransactionRequired.No);
                    }
                }

                if (addNewList != null && addNewList.Count > 0)
                {
                    foreach (BDProjectDocumentTemplateMapEntity ent in addNewList)
                    {
                        FCCBDProjectDocumentTemplateMap.GetFacadeCreate().Add(ent, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                }

                MiscUtil.ShowMessage(lblMessage, "Template Document Map Updated Successfully.", false);
            }
            catch (Exception ex)
            {
                MiscUtil.ShowMessage(lblMessage, "An Error Occoured.", true);
            }
        }
示例#3
0
        public IList <BDProjectDocumentTemplateMapEntity> GetData()
        {
            IList <BDProjectDocumentTemplateMapEntity> bDProjectDocumentTemplateMapEntityList = new List <BDProjectDocumentTemplateMapEntity>();

            try
            {
                bDProjectDocumentTemplateMapEntityList = FCCBDProjectDocumentTemplateMap.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(bDProjectDocumentTemplateMapEntityList ?? new List <BDProjectDocumentTemplateMapEntity>());
        }
        protected void ddlProjectDocumentTemplateID_SelectedIndexChanged(object sender, EventArgs e)
        {
            templateDocumentList = new List <BDProjectDocumentTemplateMapEntity>();

            Int64 projectDocumentTemplateID = 0;

            Int64.TryParse(ddlProjectDocumentTemplateID.SelectedValue, out projectDocumentTemplateID);

            // getting selected documents for template
            if (projectDocumentTemplateID > 0)
            {
                String fe = SqlExpressionBuilder.PrepareFilterExpression(BDProjectDocumentTemplateMapEntity.FLD_NAME_ProjectDocumentTemplateID, projectDocumentTemplateID.ToString(), SQLMatchType.Equal);
                templateDocumentList = FCCBDProjectDocumentTemplateMap.GetFacadeCreate().GetIL(null, null, String.Empty, fe, DatabaseOperationType.LoadWithFilterExpression);
            }

            // setting up node checks
            foreach (TreeNode tn in treeDocument.Nodes)
            {
                IsDocumentNode(tn, 2);
            }
        }
示例#5
0
        private void PrepareEditView()
        {
            String fe = SqlExpressionBuilder.PrepareFilterExpression(BDProjectDocumentTemplateMapEntity.FLD_NAME_ProjectDocumentTemplateID, ProjectDocumentTemplateID.ToString(), SQLMatchType.Equal);

            currentMappedDocuments = FCCBDProjectDocumentTemplateMap.GetFacadeCreate().GetIL(null, null, String.Empty, fe, DatabaseOperationType.LoadWithFilterExpression);

            #region Setting check to the documents

            if (currentMappedDocuments != null && currentMappedDocuments.Count > 0)
            {
                foreach (TreeNode tn in treeDocument.Nodes)
                {
                    IsDocumentNode(tn);
                }
            }
            else
            {
                currentMappedDocuments = new List <BDProjectDocumentTemplateMapEntity>();
            }

            currentMappedNodes = treeDocument.CheckedNodes;

            #endregion
        }