Esempio n. 1
0
        public IList <MDFloorUnitLocationCategoryEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression)
        {
            IList <MDFloorUnitLocationCategoryEntity> mDFloorUnitLocationCategoryEntityList = new List <MDFloorUnitLocationCategoryEntity>();

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = MDFloorUnitLocationCategoryEntity.FLD_NAME_FloorUnitLocationCategoryID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                mDFloorUnitLocationCategoryEntityList = FCCMDFloorUnitLocationCategory.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(mDFloorUnitLocationCategoryEntityList ?? new List <MDFloorUnitLocationCategoryEntity>());
        }
        private void SaveMDFloorUnitLocationCategoryEntity()
        {
            if (IsValid)
            {
                try
                {
                    MDFloorUnitLocationCategoryEntity mDFloorUnitLocationCategoryEntity = BuildMDFloorUnitLocationCategoryEntity();

                    Int64 result = -1;

                    if (mDFloorUnitLocationCategoryEntity.IsNew)
                    {
                        result = FCCMDFloorUnitLocationCategory.GetFacadeCreate().Add(mDFloorUnitLocationCategoryEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(MDFloorUnitLocationCategoryEntity.FLD_NAME_FloorUnitLocationCategoryID, mDFloorUnitLocationCategoryEntity.FloorUnitLocationCategoryID.ToString(), SQLMatchType.Equal);
                        result = FCCMDFloorUnitLocationCategory.GetFacadeCreate().Update(mDFloorUnitLocationCategoryEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _FloorUnitLocationCategoryID       = 0;
                        _MDFloorUnitLocationCategoryEntity = new MDFloorUnitLocationCategoryEntity();
                        PrepareInitialView();
                        BindMDFloorUnitLocationCategoryList();

                        if (mDFloorUnitLocationCategoryEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Floor Unit Location Category Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Floor Unit Location Category Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (mDFloorUnitLocationCategoryEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Floor Unit Location Category Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Floor Unit Location Category Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
        protected void lvMDFloorUnitLocationCategory_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 FloorUnitLocationCategoryID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(MDFloorUnitLocationCategoryEntity.FLD_NAME_FloorUnitLocationCategoryID, FloorUnitLocationCategoryID.ToString(), SQLMatchType.Equal);

                        MDFloorUnitLocationCategoryEntity mDFloorUnitLocationCategoryEntity = new MDFloorUnitLocationCategoryEntity();


                        result = FCCMDFloorUnitLocationCategory.GetFacadeCreate().Delete(mDFloorUnitLocationCategoryEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _FloorUnitLocationCategoryID       = 0;
                            _MDFloorUnitLocationCategoryEntity = new MDFloorUnitLocationCategoryEntity();
                            PrepareInitialView();
                            BindMDFloorUnitLocationCategoryList();

                            MiscUtil.ShowMessage(lblMessage, "Floor Unit Location Category has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Floor Unit Location Category.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
Esempio n. 4
0
        public IList <MDFloorUnitLocationCategoryEntity> GetData()
        {
            IList <MDFloorUnitLocationCategoryEntity> mDFloorUnitLocationCategoryEntityList = new List <MDFloorUnitLocationCategoryEntity>();

            try
            {
                mDFloorUnitLocationCategoryEntityList = FCCMDFloorUnitLocationCategory.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(mDFloorUnitLocationCategoryEntityList ?? new List <MDFloorUnitLocationCategoryEntity>());
        }