Esempio n. 1
0
        public IList <HREmployeeLanguageMapEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression)
        {
            IList <HREmployeeLanguageMapEntity> hREmployeeLanguageMapEntityList = new List <HREmployeeLanguageMapEntity>();

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = HREmployeeLanguageMapEntity.FLD_NAME_EmployeeLanguageMapID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                hREmployeeLanguageMapEntityList = FCCHREmployeeLanguageMap.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(hREmployeeLanguageMapEntityList ?? new List <HREmployeeLanguageMapEntity>());
        }
Esempio n. 2
0
        private void SaveHREmployeeLanguageMapEntity()
        {
            if (IsValid)
            {
                try
                {
                    HREmployeeLanguageMapEntity hREmployeeLanguageMapEntity = BuildHREmployeeLanguageMapEntity();

                    Int64 result = -1;

                    if (hREmployeeLanguageMapEntity.IsNew)
                    {
                        result = FCCHREmployeeLanguageMap.GetFacadeCreate().Add(hREmployeeLanguageMapEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(HREmployeeLanguageMapEntity.FLD_NAME_EmployeeLanguageMapID, hREmployeeLanguageMapEntity.EmployeeLanguageMapID.ToString(), SQLMatchType.Equal);
                        result = FCCHREmployeeLanguageMap.GetFacadeCreate().Update(hREmployeeLanguageMapEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _EmployeeLanguageMapID       = 0;
                        _HREmployeeLanguageMapEntity = new HREmployeeLanguageMapEntity();
                        PrepareInitialView();
                        BindHREmployeeLanguageMapList();

                        if (hREmployeeLanguageMapEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Employee Language Map Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Employee Language Map Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (hREmployeeLanguageMapEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Employee Language Map Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Employee Language Map Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
Esempio n. 3
0
        protected void lvHREmployeeLanguageMap_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 EmployeeLanguageMapID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(HREmployeeLanguageMapEntity.FLD_NAME_EmployeeLanguageMapID, EmployeeLanguageMapID.ToString(), SQLMatchType.Equal);

                        HREmployeeLanguageMapEntity hREmployeeLanguageMapEntity = new HREmployeeLanguageMapEntity();


                        result = FCCHREmployeeLanguageMap.GetFacadeCreate().Delete(hREmployeeLanguageMapEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _EmployeeLanguageMapID       = 0;
                            _HREmployeeLanguageMapEntity = new HREmployeeLanguageMapEntity();
                            PrepareInitialView();
                            BindHREmployeeLanguageMapList();

                            MiscUtil.ShowMessage(lblMessage, "Employee Language Map has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Employee Language Map.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
Esempio n. 4
0
        public IList <HREmployeeLanguageMapEntity> GetData()
        {
            IList <HREmployeeLanguageMapEntity> hREmployeeLanguageMapEntityList = new List <HREmployeeLanguageMapEntity>();

            try
            {
                hREmployeeLanguageMapEntityList = FCCHREmployeeLanguageMap.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(hREmployeeLanguageMapEntityList ?? new List <HREmployeeLanguageMapEntity>());
        }