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

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = HREmployeeVisaInfomationEntity.FLD_NAME_EmployeeVisaInfomationID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                hREmployeeVisaInfomationEntityList = FCCHREmployeeVisaInfomation.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(hREmployeeVisaInfomationEntityList ?? new List <HREmployeeVisaInfomationEntity>());
        }
Example #2
0
        private void SaveHREmployeeVisaInfomationEntity()
        {
            if (IsValid)
            {
                try
                {
                    HREmployeeVisaInfomationEntity hREmployeeVisaInfomationEntity = BuildHREmployeeVisaInfomationEntity();

                    Int64 result = -1;

                    if (hREmployeeVisaInfomationEntity.IsNew)
                    {
                        result = FCCHREmployeeVisaInfomation.GetFacadeCreate().Add(hREmployeeVisaInfomationEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(HREmployeeVisaInfomationEntity.FLD_NAME_EmployeeVisaInfomationID, hREmployeeVisaInfomationEntity.EmployeeVisaInfomationID.ToString(), SQLMatchType.Equal);
                        result = FCCHREmployeeVisaInfomation.GetFacadeCreate().Update(hREmployeeVisaInfomationEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _EmployeeVisaInfomationID       = 0;
                        _HREmployeeVisaInfomationEntity = new HREmployeeVisaInfomationEntity();
                        PrepareInitialView();
                        BindHREmployeeVisaInfomationList();

                        if (hREmployeeVisaInfomationEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Employee Visa Infomation Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Employee Visa Infomation Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (hREmployeeVisaInfomationEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Employee Visa Infomation Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Employee Visa Infomation Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
Example #3
0
        protected void lvHREmployeeVisaInfomation_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 EmployeeVisaInfomationID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(HREmployeeVisaInfomationEntity.FLD_NAME_EmployeeVisaInfomationID, EmployeeVisaInfomationID.ToString(), SQLMatchType.Equal);

                        HREmployeeVisaInfomationEntity hREmployeeVisaInfomationEntity = new HREmployeeVisaInfomationEntity();


                        result = FCCHREmployeeVisaInfomation.GetFacadeCreate().Delete(hREmployeeVisaInfomationEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _EmployeeVisaInfomationID       = 0;
                            _HREmployeeVisaInfomationEntity = new HREmployeeVisaInfomationEntity();
                            PrepareInitialView();
                            BindHREmployeeVisaInfomationList();

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

            try
            {
                hREmployeeVisaInfomationEntityList = FCCHREmployeeVisaInfomation.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(hREmployeeVisaInfomationEntityList ?? new List <HREmployeeVisaInfomationEntity>());
        }