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

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = MDApprovalPanelStatusEntity.FLD_NAME_ApprovalPanelStatusID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                mDApprovalPanelStatusEntityList = FCCMDApprovalPanelStatus.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(mDApprovalPanelStatusEntityList ?? new List <MDApprovalPanelStatusEntity>());
        }
        private void SaveMDApprovalPanelStatusEntity()
        {
            if (IsValid)
            {
                try
                {
                    MDApprovalPanelStatusEntity mDApprovalPanelStatusEntity = BuildMDApprovalPanelStatusEntity();

                    Int64 result = -1;

                    if (mDApprovalPanelStatusEntity.IsNew)
                    {
                        result = FCCMDApprovalPanelStatus.GetFacadeCreate().Add(mDApprovalPanelStatusEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(MDApprovalPanelStatusEntity.FLD_NAME_ApprovalPanelStatusID, mDApprovalPanelStatusEntity.ApprovalPanelStatusID.ToString(), SQLMatchType.Equal);
                        result = FCCMDApprovalPanelStatus.GetFacadeCreate().Update(mDApprovalPanelStatusEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _ApprovalPanelStatusID       = 0;
                        _MDApprovalPanelStatusEntity = new MDApprovalPanelStatusEntity();
                        PrepareInitialView();
                        BindMDApprovalPanelStatusList();

                        if (mDApprovalPanelStatusEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Approval Panel Status Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Approval Panel Status Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (mDApprovalPanelStatusEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Approval Panel Status Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Approval Panel Status Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
        protected void lvMDApprovalPanelStatus_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 ApprovalPanelStatusID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(MDApprovalPanelStatusEntity.FLD_NAME_ApprovalPanelStatusID, ApprovalPanelStatusID.ToString(), SQLMatchType.Equal);

                        MDApprovalPanelStatusEntity mDApprovalPanelStatusEntity = new MDApprovalPanelStatusEntity();


                        result = FCCMDApprovalPanelStatus.GetFacadeCreate().Delete(mDApprovalPanelStatusEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _ApprovalPanelStatusID       = 0;
                            _MDApprovalPanelStatusEntity = new MDApprovalPanelStatusEntity();
                            PrepareInitialView();
                            BindMDApprovalPanelStatusList();

                            MiscUtil.ShowMessage(lblMessage, "Approval Panel Status has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Approval Panel Status.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
Ejemplo n.º 4
0
        public IList <MDApprovalPanelStatusEntity> GetData()
        {
            IList <MDApprovalPanelStatusEntity> mDApprovalPanelStatusEntityList = new List <MDApprovalPanelStatusEntity>();

            try
            {
                mDApprovalPanelStatusEntityList = FCCMDApprovalPanelStatus.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(mDApprovalPanelStatusEntityList ?? new List <MDApprovalPanelStatusEntity>());
        }