Ejemplo n.º 1
0
        public IList <DMSReferenceLibraryEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression)
        {
            IList <DMSReferenceLibraryEntity> dMSReferenceLibraryEntityList = new List <DMSReferenceLibraryEntity>();

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = DMSReferenceLibraryEntity.FLD_NAME_ReferenceLibraryID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                dMSReferenceLibraryEntityList = FCCDMSReferenceLibrary.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(dMSReferenceLibraryEntityList ?? new List <DMSReferenceLibraryEntity>());
        }
        private void SaveDMSReferenceLibraryEntity()
        {
            if (IsValid)
            {
                try
                {
                    DMSReferenceLibraryEntity dMSReferenceLibraryEntity = BuildDMSReferenceLibraryEntity();

                    Int64 result = -1;

                    if (dMSReferenceLibraryEntity.IsNew)
                    {
                        result = FCCDMSReferenceLibrary.GetFacadeCreate().Add(dMSReferenceLibraryEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(DMSReferenceLibraryEntity.FLD_NAME_ReferenceLibraryID, dMSReferenceLibraryEntity.ReferenceLibraryID.ToString(), SQLMatchType.Equal);
                        result = FCCDMSReferenceLibrary.GetFacadeCreate().Update(dMSReferenceLibraryEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _ReferenceLibraryID        = 0;
                        _DMSReferenceLibraryEntity = new DMSReferenceLibraryEntity();
                        PrepareInitialView();
                        BindDMSReferenceLibraryList();

                        if (dMSReferenceLibraryEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Reference Library Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Reference Library Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (dMSReferenceLibraryEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Reference Library Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Reference Library Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
        protected void lvDMSReferenceLibrary_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 ReferenceLibraryID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(DMSReferenceLibraryEntity.FLD_NAME_ReferenceLibraryID, ReferenceLibraryID.ToString(), SQLMatchType.Equal);

                        DMSReferenceLibraryEntity dMSReferenceLibraryEntity = new DMSReferenceLibraryEntity();


                        result = FCCDMSReferenceLibrary.GetFacadeCreate().Delete(dMSReferenceLibraryEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _ReferenceLibraryID        = 0;
                            _DMSReferenceLibraryEntity = new DMSReferenceLibraryEntity();
                            PrepareInitialView();
                            BindDMSReferenceLibraryList();

                            MiscUtil.ShowMessage(lblMessage, "D MSReference Library has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete D MSReference Library.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
Ejemplo n.º 4
0
        public IList <DMSReferenceLibraryEntity> GetData()
        {
            IList <DMSReferenceLibraryEntity> dMSReferenceLibraryEntityList = new List <DMSReferenceLibraryEntity>();

            try
            {
                dMSReferenceLibraryEntityList = FCCDMSReferenceLibrary.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(dMSReferenceLibraryEntityList ?? new List <DMSReferenceLibraryEntity>());
        }