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

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = MDVisaStatusEntity.FLD_NAME_VisaStatusID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                mDVisaStatusEntityList = FCCMDVisaStatus.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(mDVisaStatusEntityList ?? new List <MDVisaStatusEntity>());
        }
Пример #2
0
        private void SaveMDVisaStatusEntity()
        {
            if (IsValid)
            {
                try
                {
                    MDVisaStatusEntity mDVisaStatusEntity = BuildMDVisaStatusEntity();

                    Int64 result = -1;

                    if (mDVisaStatusEntity.IsNew)
                    {
                        result = FCCMDVisaStatus.GetFacadeCreate().Add(mDVisaStatusEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(MDVisaStatusEntity.FLD_NAME_VisaStatusID, mDVisaStatusEntity.VisaStatusID.ToString(), SQLMatchType.Equal);
                        result = FCCMDVisaStatus.GetFacadeCreate().Update(mDVisaStatusEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _VisaStatusID       = 0;
                        _MDVisaStatusEntity = new MDVisaStatusEntity();
                        PrepareInitialView();
                        BindMDVisaStatusList();

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

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(MDVisaStatusEntity.FLD_NAME_VisaStatusID, VisaStatusID.ToString(), SQLMatchType.Equal);

                        MDVisaStatusEntity mDVisaStatusEntity = new MDVisaStatusEntity();


                        result = FCCMDVisaStatus.GetFacadeCreate().Delete(mDVisaStatusEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _VisaStatusID       = 0;
                            _MDVisaStatusEntity = new MDVisaStatusEntity();
                            PrepareInitialView();
                            BindMDVisaStatusList();

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

            try
            {
                mDVisaStatusEntityList = FCCMDVisaStatus.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(mDVisaStatusEntityList ?? new List <MDVisaStatusEntity>());
        }