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

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = MDDesignationEntity.FLD_NAME_DesignationID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                mDDesignationEntityList = FCCMDDesignation.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(mDDesignationEntityList ?? new List <MDDesignationEntity>());
        }
Ejemplo n.º 2
0
        private void LoadSubCategories(TreeNode parentCategory)
        {
            Int64 departmentID = Int64.Parse(parentCategory.Value);

            String fe = SqlExpressionBuilder.PrepareFilterExpression(MDDesignationEntity.FLD_NAME_DepartmentID, departmentID.ToString(), SQLMatchType.Equal);
            IList <MDDesignationEntity> childItemCategoryList = FCCMDDesignation.GetFacadeCreate().GetIL(null, null, String.Empty, fe, DatabaseOperationType.LoadWithFilterExpression);

            if (childItemCategoryList != null && childItemCategoryList.Count > 0)
            {
                foreach (MDDesignationEntity ent in childItemCategoryList)
                {
                    TreeNode childItemCategory = new TreeNode();

                    childItemCategory.Text         = ent.Name;
                    childItemCategory.Value        = ent.DesignationID.ToString();
                    childItemCategory.SelectAction = TreeNodeSelectAction.Select;

                    if (ShowCheckBoxesInAllNodes == true)
                    {
                        childItemCategory.ShowCheckBox = true;
                    }

                    LoadEmployee(childItemCategory);
                    parentCategory.ChildNodes.Add(childItemCategory);
                }
            }
        }
        private void BuildTree()
        {
            this.Nodes.Clear();

            departmentList  = FCCMDDepartment.GetFacadeCreate().GetILFC();
            designationList = FCCMDDesignation.GetFacadeCreate().GetILFC();

            BayTreeNodeValue rootNodeValue = new BayTreeNodeValue();

            rootNodeValue.Value = "0";
            rootNodeValue.Attributes["NodeType"] = CustomControlConstants.HRNodeType.RootNode;

            TreeNode rootNode = new TreeNode();

            rootNode.Text         = "Designation Tree";
            rootNode.Value        = rootNodeValue.GetValueString();
            rootNode.SelectAction = TreeNodeSelectAction.None;
            rootNode.Expanded     = true;



            LoadDepartments(rootNode);

            this.Nodes.Add(rootNode);
        }
Ejemplo n.º 4
0
        private void SaveMDDesignationEntity()
        {
            if (IsValid)
            {
                try
                {
                    MDDesignationEntity mDDesignationEntity = BuildMDDesignationEntity();

                    Int64 result = -1;

                    if (mDDesignationEntity.IsNew)
                    {
                        result = FCCMDDesignation.GetFacadeCreate().Add(mDDesignationEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(MDDesignationEntity.FLD_NAME_DesignationID, mDDesignationEntity.DesignationID.ToString(), SQLMatchType.Equal);
                        result = FCCMDDesignation.GetFacadeCreate().Update(mDDesignationEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _DesignationID       = 0;
                        _MDDesignationEntity = new MDDesignationEntity();
                        PrepareInitialView();

                        if (mDDesignationEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Designation Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Designation Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (mDDesignationEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Designation Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Designation Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
Ejemplo n.º 5
0
        protected void lvMDDesignation_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 DesignationID;

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

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

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(MDDesignationEntity.FLD_NAME_DesignationID, DesignationID.ToString(), SQLMatchType.Equal);

                        MDDesignationEntity mDDesignationEntity = new MDDesignationEntity();


                        result = FCCMDDesignation.GetFacadeCreate().Delete(mDDesignationEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _DesignationID       = 0;
                            _MDDesignationEntity = new MDDesignationEntity();
                            PrepareInitialView();


                            MiscUtil.ShowMessage(lblMessage, "Designation has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Designation.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
Ejemplo n.º 6
0
        private void DeleteDesignation()
        {
            Int64 DesignationID;

            Int64.TryParse(treeDesignation.SelectedValue, out DesignationID);

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

                    String fe = SqlExpressionBuilder.PrepareFilterExpression(MDDesignationEntity.FLD_NAME_DesignationID, DesignationID.ToString(), SQLMatchType.Equal);

                    MDDesignationEntity mDDesignationEntity = new MDDesignationEntity();


                    result = FCCMDDesignation.GetFacadeCreate().Delete(mDDesignationEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                    if (result == 0)
                    {
                        _DesignationID       = 0;
                        _MDDesignationEntity = new MDDesignationEntity();

                        // clearing cache
                        FCCMDDesignation.GetFacadeCreate().RemoveCache();

                        PrepareInitialView();

                        LoadTreeView();

                        MiscUtil.ShowMessage(lblMessage, "Designation has been successfully deleted.", true);
                    }
                    else
                    {
                        MiscUtil.ShowMessage(lblMessage, "Failed to delete Designation.", true);
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
        public IList <MDDesignationEntity> GetData()
        {
            IList <MDDesignationEntity> mDDesignationEntityList = new List <MDDesignationEntity>();

            try
            {
                mDDesignationEntityList = FCCMDDesignation.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(mDDesignationEntityList ?? new List <MDDesignationEntity>());
        }
Ejemplo n.º 8
0
        private void BuildTree()
        {
            this.Nodes.Clear();

            departmentList  = FCCMDDepartment.GetFacadeCreate().GetILFC();
            designationList = FCCMDDesignation.GetFacadeCreate().GetILFC();

            employeeList = FCCResourceEmployee_Custom.GetFacadeCreate().GetIL(1000000, 1, String.Empty, String.Empty);

            TreeNode rootNode = new TreeNode();

            rootNode.Text         = "Employee Tree";
            rootNode.Value        = "0";
            rootNode.SelectAction = TreeNodeSelectAction.Select;
            rootNode.Expanded     = true;

            LoadDepartments(rootNode);

            this.Nodes.Add(rootNode);
        }