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

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = HREmployeeContactInfoEntity.FLD_NAME_EmployeeContactInfoID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                hREmployeeContactInfoEntityList = FCCHREmployeeContactInfo.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(hREmployeeContactInfoEntityList ?? new List <HREmployeeContactInfoEntity>());
        }
Ejemplo n.º 2
0
        private void SaveHREmployeeContactInfoEntity()
        {
            if (IsValid)
            {
                try
                {
                    HREmployeeContactInfoEntity hREmployeeContactInfoEntity = BuildHREmployeeContactInfoEntity();

                    Int64 result = -1;

                    if (hREmployeeContactInfoEntity.IsNew)
                    {
                        result = FCCHREmployeeContactInfo.GetFacadeCreate().Add(hREmployeeContactInfoEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(HREmployeeContactInfoEntity.FLD_NAME_EmployeeContactInfoID, hREmployeeContactInfoEntity.EmployeeContactInfoID.ToString(), SQLMatchType.Equal);
                        result = FCCHREmployeeContactInfo.GetFacadeCreate().Update(hREmployeeContactInfoEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _EmployeeContactInfoID       = 0;
                        _HREmployeeContactInfoEntity = new HREmployeeContactInfoEntity();
                        PrepareInitialView();
                        BindHREmployeeContactInfoList();

                        if (hREmployeeContactInfoEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Employee Contact Info Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Employee Contact Info Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (hREmployeeContactInfoEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Employee Contact Info Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Employee Contact Info Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
Ejemplo n.º 3
0
        protected void lvHREmployeeContactInfo_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 EmployeeContactInfoID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(HREmployeeContactInfoEntity.FLD_NAME_EmployeeContactInfoID, EmployeeContactInfoID.ToString(), SQLMatchType.Equal);

                        HREmployeeContactInfoEntity hREmployeeContactInfoEntity = new HREmployeeContactInfoEntity();


                        result = FCCHREmployeeContactInfo.GetFacadeCreate().Delete(hREmployeeContactInfoEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _EmployeeContactInfoID       = 0;
                            _HREmployeeContactInfoEntity = new HREmployeeContactInfoEntity();
                            PrepareInitialView();
                            BindHREmployeeContactInfoList();

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

            try
            {
                hREmployeeContactInfoEntityList = FCCHREmployeeContactInfo.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(hREmployeeContactInfoEntityList ?? new List <HREmployeeContactInfoEntity>());
        }