예제 #1
0
        public IList <MDMaritalStatusEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression)
        {
            IList <MDMaritalStatusEntity> mDMaritalStatusEntityList = new List <MDMaritalStatusEntity>();

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = MDMaritalStatusEntity.FLD_NAME_MaritalStatusID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                mDMaritalStatusEntityList = FCCMDMaritalStatus.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(mDMaritalStatusEntityList ?? new List <MDMaritalStatusEntity>());
        }
예제 #2
0
        private void SaveMDMaritalStatusEntity()
        {
            if (IsValid)
            {
                try
                {
                    MDMaritalStatusEntity mDMaritalStatusEntity = BuildMDMaritalStatusEntity();

                    Int64 result = -1;

                    if (mDMaritalStatusEntity.IsNew)
                    {
                        result = FCCMDMaritalStatus.GetFacadeCreate().Add(mDMaritalStatusEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(MDMaritalStatusEntity.FLD_NAME_MaritalStatusID, mDMaritalStatusEntity.MaritalStatusID.ToString(), SQLMatchType.Equal);
                        result = FCCMDMaritalStatus.GetFacadeCreate().Update(mDMaritalStatusEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _MaritalStatusID       = 0;
                        _MDMaritalStatusEntity = new MDMaritalStatusEntity();
                        PrepareInitialView();
                        BindMDMaritalStatusList();

                        if (mDMaritalStatusEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Marital Status Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Marital Status Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (mDMaritalStatusEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Marital Status Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Marital Status Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
예제 #3
0
        protected void lvMDMaritalStatus_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 MaritalStatusID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(MDMaritalStatusEntity.FLD_NAME_MaritalStatusID, MaritalStatusID.ToString(), SQLMatchType.Equal);

                        MDMaritalStatusEntity mDMaritalStatusEntity = new MDMaritalStatusEntity();


                        result = FCCMDMaritalStatus.GetFacadeCreate().Delete(mDMaritalStatusEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _MaritalStatusID       = 0;
                            _MDMaritalStatusEntity = new MDMaritalStatusEntity();
                            PrepareInitialView();
                            BindMDMaritalStatusList();

                            MiscUtil.ShowMessage(lblMessage, "Marital Status has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Marital Status.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
예제 #4
0
        public IList <MDMaritalStatusEntity> GetData()
        {
            IList <MDMaritalStatusEntity> mDMaritalStatusEntityList = new List <MDMaritalStatusEntity>();

            try
            {
                mDMaritalStatusEntityList = FCCMDMaritalStatus.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(mDMaritalStatusEntityList ?? new List <MDMaritalStatusEntity>());
        }