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

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = MDEmployeeLanguageEntity.FLD_NAME_EmployeeLanguageID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                mDEmployeeLanguageEntityList = FCCMDEmployeeLanguage.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(mDEmployeeLanguageEntityList ?? new List <MDEmployeeLanguageEntity>());
        }
Пример #2
0
        private void SaveMDEmployeeLanguageEntity()
        {
            if (IsValid)
            {
                try
                {
                    MDEmployeeLanguageEntity mDEmployeeLanguageEntity = BuildMDEmployeeLanguageEntity();

                    Int64 result = -1;

                    if (mDEmployeeLanguageEntity.IsNew)
                    {
                        result = FCCMDEmployeeLanguage.GetFacadeCreate().Add(mDEmployeeLanguageEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(MDEmployeeLanguageEntity.FLD_NAME_EmployeeLanguageID, mDEmployeeLanguageEntity.EmployeeLanguageID.ToString(), SQLMatchType.Equal);
                        result = FCCMDEmployeeLanguage.GetFacadeCreate().Update(mDEmployeeLanguageEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _EmployeeLanguageID       = 0;
                        _MDEmployeeLanguageEntity = new MDEmployeeLanguageEntity();
                        PrepareInitialView();
                        BindMDEmployeeLanguageList();

                        if (mDEmployeeLanguageEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Employee Language Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Employee Language Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (mDEmployeeLanguageEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Employee Language Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Employee Language Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
Пример #3
0
        protected void lvMDEmployeeLanguage_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 EmployeeLanguageID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(MDEmployeeLanguageEntity.FLD_NAME_EmployeeLanguageID, EmployeeLanguageID.ToString(), SQLMatchType.Equal);

                        MDEmployeeLanguageEntity mDEmployeeLanguageEntity = new MDEmployeeLanguageEntity();


                        result = FCCMDEmployeeLanguage.GetFacadeCreate().Delete(mDEmployeeLanguageEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _EmployeeLanguageID       = 0;
                            _MDEmployeeLanguageEntity = new MDEmployeeLanguageEntity();
                            PrepareInitialView();
                            BindMDEmployeeLanguageList();

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

            try
            {
                mDEmployeeLanguageEntityList = FCCMDEmployeeLanguage.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(mDEmployeeLanguageEntityList ?? new List <MDEmployeeLanguageEntity>());
        }