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

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = HREmployeePassportInformationEntity.FLD_NAME_EmployeePassportInformationID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                hREmployeePassportInformationEntityList = FCCHREmployeePassportInformation.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(hREmployeePassportInformationEntityList ?? new List <HREmployeePassportInformationEntity>());
        }
Exemplo n.º 2
0
        private void SaveHREmployeePassportInformationEntity()
        {
            if (IsValid)
            {
                try
                {
                    HREmployeePassportInformationEntity hREmployeePassportInformationEntity = BuildHREmployeePassportInformationEntity();

                    Int64 result = -1;

                    if (hREmployeePassportInformationEntity.IsNew)
                    {
                        result = FCCHREmployeePassportInformation.GetFacadeCreate().Add(hREmployeePassportInformationEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(HREmployeePassportInformationEntity.FLD_NAME_EmployeePassportInformationID, hREmployeePassportInformationEntity.EmployeePassportInformationID.ToString(), SQLMatchType.Equal);
                        result = FCCHREmployeePassportInformation.GetFacadeCreate().Update(hREmployeePassportInformationEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _EmployeePassportInformationID       = 0;
                        _HREmployeePassportInformationEntity = new HREmployeePassportInformationEntity();
                        PrepareInitialView();
                        BindHREmployeePassportInformationList();

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

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(HREmployeePassportInformationEntity.FLD_NAME_EmployeePassportInformationID, EmployeePassportInformationID.ToString(), SQLMatchType.Equal);

                        HREmployeePassportInformationEntity hREmployeePassportInformationEntity = new HREmployeePassportInformationEntity();


                        result = FCCHREmployeePassportInformation.GetFacadeCreate().Delete(hREmployeePassportInformationEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _EmployeePassportInformationID       = 0;
                            _HREmployeePassportInformationEntity = new HREmployeePassportInformationEntity();
                            PrepareInitialView();
                            BindHREmployeePassportInformationList();

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

            try
            {
                hREmployeePassportInformationEntityList = FCCHREmployeePassportInformation.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(hREmployeePassportInformationEntityList ?? new List <HREmployeePassportInformationEntity>());
        }