Пример #1
0
        public IList <MDSalaryRateDurationEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression)
        {
            IList <MDSalaryRateDurationEntity> mDSalaryRateDurationEntityList = new List <MDSalaryRateDurationEntity>();

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = MDSalaryRateDurationEntity.FLD_NAME_SalaryRateDurationID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                mDSalaryRateDurationEntityList = FCCMDSalaryRateDuration.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(mDSalaryRateDurationEntityList ?? new List <MDSalaryRateDurationEntity>());
        }
Пример #2
0
        private void SaveMDSalaryRateDurationEntity()
        {
            if (IsValid)
            {
                try
                {
                    MDSalaryRateDurationEntity mDSalaryRateDurationEntity = BuildMDSalaryRateDurationEntity();

                    Int64 result = -1;

                    if (mDSalaryRateDurationEntity.IsNew)
                    {
                        result = FCCMDSalaryRateDuration.GetFacadeCreate().Add(mDSalaryRateDurationEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(MDSalaryRateDurationEntity.FLD_NAME_SalaryRateDurationID, mDSalaryRateDurationEntity.SalaryRateDurationID.ToString(), SQLMatchType.Equal);
                        result = FCCMDSalaryRateDuration.GetFacadeCreate().Update(mDSalaryRateDurationEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _SalaryRateDurationID       = 0;
                        _MDSalaryRateDurationEntity = new MDSalaryRateDurationEntity();
                        PrepareInitialView();
                        BindMDSalaryRateDurationList();

                        if (mDSalaryRateDurationEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Salary Rate Duration Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Salary Rate Duration Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (mDSalaryRateDurationEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Salary Rate Duration Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Salary Rate Duration Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
Пример #3
0
        protected void lvMDSalaryRateDuration_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 SalaryRateDurationID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(MDSalaryRateDurationEntity.FLD_NAME_SalaryRateDurationID, SalaryRateDurationID.ToString(), SQLMatchType.Equal);

                        MDSalaryRateDurationEntity mDSalaryRateDurationEntity = new MDSalaryRateDurationEntity();


                        result = FCCMDSalaryRateDuration.GetFacadeCreate().Delete(mDSalaryRateDurationEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _SalaryRateDurationID       = 0;
                            _MDSalaryRateDurationEntity = new MDSalaryRateDurationEntity();
                            PrepareInitialView();
                            BindMDSalaryRateDurationList();

                            MiscUtil.ShowMessage(lblMessage, "Salary Rate Duration has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Salary Rate Duration.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
Пример #4
0
        public IList <MDSalaryRateDurationEntity> GetData()
        {
            IList <MDSalaryRateDurationEntity> mDSalaryRateDurationEntityList = new List <MDSalaryRateDurationEntity>();

            try
            {
                mDSalaryRateDurationEntityList = FCCMDSalaryRateDuration.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(mDSalaryRateDurationEntityList ?? new List <MDSalaryRateDurationEntity>());
        }