Example #1
0
        public IList <PRMSupplierItemMapHistoryEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression)
        {
            IList <PRMSupplierItemMapHistoryEntity> pRMSupplierItemMapHistoryEntityList = new List <PRMSupplierItemMapHistoryEntity>();

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = PRMSupplierItemMapHistoryEntity.FLD_NAME_SupplierItemMapHistoryID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                pRMSupplierItemMapHistoryEntityList = FCCPRMSupplierItemMapHistory.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(pRMSupplierItemMapHistoryEntityList ?? new List <PRMSupplierItemMapHistoryEntity>());
        }
        protected void lvPRMSupplierItemMapHistory_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 SupplierItemMapHistoryID;

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

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

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(PRMSupplierItemMapHistoryEntity.FLD_NAME_SupplierItemMapHistoryID, SupplierItemMapHistoryID.ToString(), SQLMatchType.Equal);

                        PRMSupplierItemMapHistoryEntity pRMSupplierItemMapHistoryEntity = new PRMSupplierItemMapHistoryEntity();


                        result = FCCPRMSupplierItemMapHistory.GetFacadeCreate().Delete(pRMSupplierItemMapHistoryEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _SupplierItemMapHistoryID        = 0;
                            _PRMSupplierItemMapHistoryEntity = new PRMSupplierItemMapHistoryEntity();
                            PrepareInitialView();
                            BindPRMSupplierItemMapHistoryList();

                            MiscUtil.ShowMessage(lblMessage, "Vendor Item Map History has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Vendor Item Map History.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
Example #3
0
        public IList <PRMSupplierItemMapHistoryEntity> GetData()
        {
            IList <PRMSupplierItemMapHistoryEntity> pRMSupplierItemMapHistoryEntityList = new List <PRMSupplierItemMapHistoryEntity>();

            try
            {
                pRMSupplierItemMapHistoryEntityList = FCCPRMSupplierItemMapHistory.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(pRMSupplierItemMapHistoryEntityList ?? new List <PRMSupplierItemMapHistoryEntity>());
        }