Exemplo n.º 1
0
        public IList <APStatusEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression)
        {
            IList <APStatusEntity> aPStatusEntityList = new List <APStatusEntity>();

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = APStatusEntity.FLD_NAME_APStatusID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                aPStatusEntityList = FCCAPStatus.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(aPStatusEntityList ?? new List <APStatusEntity>());
        }
Exemplo n.º 2
0
        private void SaveAPStatusEntity()
        {
            if (IsValid)
            {
                try
                {
                    APStatusEntity aPStatusEntity = BuildAPStatusEntity();

                    Int64 result = -1;

                    if (aPStatusEntity.IsNew)
                    {
                        result = FCCAPStatus.GetFacadeCreate().Add(aPStatusEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(APStatusEntity.FLD_NAME_APStatusID, aPStatusEntity.APStatusID.ToString(), SQLMatchType.Equal);
                        result = FCCAPStatus.GetFacadeCreate().Update(aPStatusEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _APStatusID     = 0;
                        _APStatusEntity = new APStatusEntity();
                        PrepareInitialView();
                        BindAPStatusList();

                        if (aPStatusEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "A PStatus Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "A PStatus Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (aPStatusEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add A PStatus Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update A PStatus Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
Exemplo n.º 3
0
        protected void lvAPStatus_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 APStatusID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(APStatusEntity.FLD_NAME_APStatusID, APStatusID.ToString(), SQLMatchType.Equal);

                        APStatusEntity aPStatusEntity = new APStatusEntity();


                        result = FCCAPStatus.GetFacadeCreate().Delete(aPStatusEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _APStatusID     = 0;
                            _APStatusEntity = new APStatusEntity();
                            PrepareInitialView();
                            BindAPStatusList();

                            MiscUtil.ShowMessage(lblMessage, "A PStatus has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete A PStatus.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
Exemplo n.º 4
0
        public IList <APStatusEntity> GetData()
        {
            IList <APStatusEntity> aPStatusEntityList = new List <APStatusEntity>();

            try
            {
                aPStatusEntityList = FCCAPStatus.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(aPStatusEntityList ?? new List <APStatusEntity>());
        }