public IList <PRMSupplierAddressInfoEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression)
        {
            IList <PRMSupplierAddressInfoEntity> pRMSupplierAddressInfoEntityList = new List <PRMSupplierAddressInfoEntity>();

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = PRMSupplierAddressInfoEntity.FLD_NAME_SupplierAddressInfoID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                pRMSupplierAddressInfoEntityList = FCCPRMSupplierAddressInfo.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(pRMSupplierAddressInfoEntityList ?? new List <PRMSupplierAddressInfoEntity>());
        }
Ejemplo n.º 2
0
        private void SavePRMSupplierAddressInfoEntity()
        {
            if (IsValid)
            {
                try
                {
                    PRMSupplierAddressInfoEntity pRMSupplierAddressInfoEntity = BuildPRMSupplierAddressInfoEntity();

                    Int64 result = -1;

                    if (pRMSupplierAddressInfoEntity.IsNew)
                    {
                        result = FCCPRMSupplierAddressInfo.GetFacadeCreate().Add(pRMSupplierAddressInfoEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(PRMSupplierAddressInfoEntity.FLD_NAME_SupplierAddressInfoID, pRMSupplierAddressInfoEntity.SupplierAddressInfoID.ToString(), SQLMatchType.Equal);
                        result = FCCPRMSupplierAddressInfo.GetFacadeCreate().Update(pRMSupplierAddressInfoEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _SupplierAddressInfoID        = 0;
                        _PRMSupplierAddressInfoEntity = new PRMSupplierAddressInfoEntity();
                        PrepareInitialView();
                        BindPRMSupplierAddressInfoList();

                        if (pRMSupplierAddressInfoEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Vendor Address Info Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Vendor Address Info Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (pRMSupplierAddressInfoEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Vendor Address Info Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Vendor Address Info Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
Ejemplo n.º 3
0
        protected void lvPRMSupplierAddressInfo_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 SupplierAddressInfoID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(PRMSupplierAddressInfoEntity.FLD_NAME_SupplierAddressInfoID, SupplierAddressInfoID.ToString(), SQLMatchType.Equal);

                        PRMSupplierAddressInfoEntity pRMSupplierAddressInfoEntity = new PRMSupplierAddressInfoEntity();


                        result = FCCPRMSupplierAddressInfo.GetFacadeCreate().Delete(pRMSupplierAddressInfoEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _SupplierAddressInfoID        = 0;
                            _PRMSupplierAddressInfoEntity = new PRMSupplierAddressInfoEntity();
                            PrepareInitialView();
                            BindPRMSupplierAddressInfoList();

                            MiscUtil.ShowMessage(lblMessage, "Vendor Address Info has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Vendor Address Info.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
        public IList <PRMSupplierAddressInfoEntity> GetData()
        {
            IList <PRMSupplierAddressInfoEntity> pRMSupplierAddressInfoEntityList = new List <PRMSupplierAddressInfoEntity>();

            try
            {
                pRMSupplierAddressInfoEntityList = FCCPRMSupplierAddressInfo.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(pRMSupplierAddressInfoEntityList ?? new List <PRMSupplierAddressInfoEntity>());
        }