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

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = CMBillFloorDetailEntity.FLD_NAME_BillFloorDetailID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                cMBillFloorDetailEntityList = FCCCMBillFloorDetail.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(cMBillFloorDetailEntityList ?? new List <CMBillFloorDetailEntity>());
        }
Exemplo n.º 2
0
        private void SaveCMBillFloorDetailEntity()
        {
            if (IsValid)
            {
                try
                {
                    CMBillFloorDetailEntity cMBillFloorDetailEntity = BuildCMBillFloorDetailEntity();

                    Int64 result = -1;

                    if (cMBillFloorDetailEntity.IsNew)
                    {
                        result = FCCCMBillFloorDetail.GetFacadeCreate().Add(cMBillFloorDetailEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(CMBillFloorDetailEntity.FLD_NAME_BillFloorDetailID, cMBillFloorDetailEntity.BillFloorDetailID.ToString(), SQLMatchType.Equal);
                        result = FCCCMBillFloorDetail.GetFacadeCreate().Update(cMBillFloorDetailEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _BillFloorDetailID       = 0;
                        _CMBillFloorDetailEntity = new CMBillFloorDetailEntity();
                        PrepareInitialView();
                        BindCMBillFloorDetailList();

                        if (cMBillFloorDetailEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "C MBill Floor Detail Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "C MBill Floor Detail Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (cMBillFloorDetailEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add C MBill Floor Detail Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update C MBill Floor Detail Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
Exemplo n.º 3
0
        protected void lvCMBillFloorDetail_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 BillFloorDetailID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(CMBillFloorDetailEntity.FLD_NAME_BillFloorDetailID, BillFloorDetailID.ToString(), SQLMatchType.Equal);

                        CMBillFloorDetailEntity cMBillFloorDetailEntity = new CMBillFloorDetailEntity();


                        result = FCCCMBillFloorDetail.GetFacadeCreate().Delete(cMBillFloorDetailEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _BillFloorDetailID       = 0;
                            _CMBillFloorDetailEntity = new CMBillFloorDetailEntity();
                            PrepareInitialView();
                            BindCMBillFloorDetailList();

                            MiscUtil.ShowMessage(lblMessage, "C MBill Floor Detail has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete C MBill Floor Detail.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
Exemplo n.º 4
0
        public IList <CMBillFloorDetailEntity> GetData()
        {
            IList <CMBillFloorDetailEntity> cMBillFloorDetailEntityList = new List <CMBillFloorDetailEntity>();

            try
            {
                cMBillFloorDetailEntityList = FCCCMBillFloorDetail.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(cMBillFloorDetailEntityList ?? new List <CMBillFloorDetailEntity>());
        }