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

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = HRAdditonalInformationEntity.FLD_NAME_AdditonalInformationID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                hRAdditonalInformationEntityList = FCCHRAdditonalInformation.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(hRAdditonalInformationEntityList ?? new List <HRAdditonalInformationEntity>());
        }
        private void SaveHRAdditonalInformationEntity()
        {
            if (IsValid)
            {
                try
                {
                    HRAdditonalInformationEntity hRAdditonalInformationEntity = BuildHRAdditonalInformationEntity();

                    Int64 result = -1;

                    if (hRAdditonalInformationEntity.IsNew)
                    {
                        result = FCCHRAdditonalInformation.GetFacadeCreate().Add(hRAdditonalInformationEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(HRAdditonalInformationEntity.FLD_NAME_AdditonalInformationID, hRAdditonalInformationEntity.AdditonalInformationID.ToString(), SQLMatchType.Equal);
                        result = FCCHRAdditonalInformation.GetFacadeCreate().Update(hRAdditonalInformationEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _AdditonalInformationID       = 0;
                        _HRAdditonalInformationEntity = new HRAdditonalInformationEntity();
                        PrepareInitialView();
                        BindHRAdditonalInformationList();

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

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(HRAdditonalInformationEntity.FLD_NAME_AdditonalInformationID, AdditonalInformationID.ToString(), SQLMatchType.Equal);

                        HRAdditonalInformationEntity hRAdditonalInformationEntity = new HRAdditonalInformationEntity();


                        result = FCCHRAdditonalInformation.GetFacadeCreate().Delete(hRAdditonalInformationEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _AdditonalInformationID       = 0;
                            _HRAdditonalInformationEntity = new HRAdditonalInformationEntity();
                            PrepareInitialView();
                            BindHRAdditonalInformationList();

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

            try
            {
                hRAdditonalInformationEntityList = FCCHRAdditonalInformation.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(hRAdditonalInformationEntityList ?? new List <HRAdditonalInformationEntity>());
        }