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

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = APPanelEntity.FLD_NAME_APPanelID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                aPPanelEntityList = FCCAPPanel.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(aPPanelEntityList ?? new List <APPanelEntity>());
        }
Ejemplo n.º 2
0
        private void SaveAPPanelEntity()
        {
            if (IsValid)
            {
                try
                {
                    APPanelEntity aPPanelEntity = BuildAPPanelEntity();

                    Int64 result = -1;

                    if (aPPanelEntity.IsNew)
                    {
                        result = FCCAPPanel.GetFacadeCreate().Add(aPPanelEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(APPanelEntity.FLD_NAME_APPanelID, aPPanelEntity.APPanelID.ToString(), SQLMatchType.Equal);
                        result = FCCAPPanel.GetFacadeCreate().Update(aPPanelEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _APPanelID     = 0;
                        _APPanelEntity = new APPanelEntity();
                        PrepareInitialView();
                        BindAPPanelList();

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

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(APPanelEntity.FLD_NAME_APPanelID, APPanelID.ToString(), SQLMatchType.Equal);

                        APPanelEntity aPPanelEntity = new APPanelEntity();


                        result = FCCAPPanel.GetFacadeCreate().Delete(aPPanelEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _APPanelID     = 0;
                            _APPanelEntity = new APPanelEntity();
                            PrepareInitialView();
                            BindAPPanelList();

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

            try
            {
                aPPanelEntityList = FCCAPPanel.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(aPPanelEntityList ?? new List <APPanelEntity>());
        }