Exemplo n.º 1
0
        public IList <HREmployeeAddressInfoEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression)
        {
            IList <HREmployeeAddressInfoEntity> hREmployeeAddressInfoEntityList = new List <HREmployeeAddressInfoEntity>();

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = HREmployeeAddressInfoEntity.FLD_NAME_EmployeeAddressInfoID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                hREmployeeAddressInfoEntityList = FCCHREmployeeAddressInfo.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(hREmployeeAddressInfoEntityList ?? new List <HREmployeeAddressInfoEntity>());
        }
Exemplo n.º 2
0
        private void SaveHREmployeeAddressInfoEntity()
        {
            if (IsValid)
            {
                try
                {
                    HREmployeeAddressInfoEntity hREmployeeAddressInfoEntity = BuildHREmployeeAddressInfoEntity();

                    Int64 result = -1;

                    if (hREmployeeAddressInfoEntity.IsNew)
                    {
                        result = FCCHREmployeeAddressInfo.GetFacadeCreate().Add(hREmployeeAddressInfoEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(HREmployeeAddressInfoEntity.FLD_NAME_EmployeeAddressInfoID, hREmployeeAddressInfoEntity.EmployeeAddressInfoID.ToString(), SQLMatchType.Equal);
                        result = FCCHREmployeeAddressInfo.GetFacadeCreate().Update(hREmployeeAddressInfoEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _EmployeeAddressInfoID       = 0;
                        _HREmployeeAddressInfoEntity = new HREmployeeAddressInfoEntity();
                        PrepareInitialView();
                        BindHREmployeeAddressInfoList();

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

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(HREmployeeAddressInfoEntity.FLD_NAME_EmployeeAddressInfoID, EmployeeAddressInfoID.ToString(), SQLMatchType.Equal);

                        HREmployeeAddressInfoEntity hREmployeeAddressInfoEntity = new HREmployeeAddressInfoEntity();


                        result = FCCHREmployeeAddressInfo.GetFacadeCreate().Delete(hREmployeeAddressInfoEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _EmployeeAddressInfoID       = 0;
                            _HREmployeeAddressInfoEntity = new HREmployeeAddressInfoEntity();
                            PrepareInitialView();
                            BindHREmployeeAddressInfoList();

                            MiscUtil.ShowMessage(lblMessage, "Employee Address Info has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Employee Address Info.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
Exemplo n.º 4
0
        public IList <HREmployeeAddressInfoEntity> GetData()
        {
            IList <HREmployeeAddressInfoEntity> hREmployeeAddressInfoEntityList = new List <HREmployeeAddressInfoEntity>();

            try
            {
                hREmployeeAddressInfoEntityList = FCCHREmployeeAddressInfo.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(hREmployeeAddressInfoEntityList ?? new List <HREmployeeAddressInfoEntity>());
        }