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

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = PRMSupplierBrandMapEntity.FLD_NAME_SupplierBrandMapID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                pRMSupplierBrandMapEntityList = FCCPRMSupplierBrandMap.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(pRMSupplierBrandMapEntityList ?? new List <PRMSupplierBrandMapEntity>());
        }
Esempio n. 2
0
        private void SavePRMSupplierBrandMapEntity()
        {
            if (IsValid)
            {
                try
                {
                    PRMSupplierBrandMapEntity pRMSupplierBrandMapEntity = BuildPRMSupplierBrandMapEntity();

                    Int64 result = -1;

                    if (pRMSupplierBrandMapEntity.IsNew)
                    {
                        result = FCCPRMSupplierBrandMap.GetFacadeCreate().Add(pRMSupplierBrandMapEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(PRMSupplierBrandMapEntity.FLD_NAME_SupplierBrandMapID, pRMSupplierBrandMapEntity.SupplierBrandMapID.ToString(), SQLMatchType.Equal);
                        result = FCCPRMSupplierBrandMap.GetFacadeCreate().Update(pRMSupplierBrandMapEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _SupplierBrandMapID        = 0;
                        _PRMSupplierBrandMapEntity = new PRMSupplierBrandMapEntity();
                        PrepareInitialView();
                        BindPRMSupplierBrandMapList();

                        if (pRMSupplierBrandMapEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Vendor Brand Map Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Vendor Brand Map Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (pRMSupplierBrandMapEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Vendor Brand Map Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Vendor Brand Map Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
Esempio n. 3
0
        protected void lvPRMSupplierBrandMap_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 SupplierBrandMapID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(PRMSupplierBrandMapEntity.FLD_NAME_SupplierBrandMapID, SupplierBrandMapID.ToString(), SQLMatchType.Equal);

                        PRMSupplierBrandMapEntity pRMSupplierBrandMapEntity = new PRMSupplierBrandMapEntity();


                        result = FCCPRMSupplierBrandMap.GetFacadeCreate().Delete(pRMSupplierBrandMapEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _SupplierBrandMapID        = 0;
                            _PRMSupplierBrandMapEntity = new PRMSupplierBrandMapEntity();
                            PrepareInitialView();
                            BindPRMSupplierBrandMapList();

                            MiscUtil.ShowMessage(lblMessage, "Vendor Brand Map has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Vendor Brand Map.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
Esempio n. 4
0
        public IList <PRMSupplierBrandMapEntity> GetData()
        {
            IList <PRMSupplierBrandMapEntity> pRMSupplierBrandMapEntityList = new List <PRMSupplierBrandMapEntity>();

            try
            {
                pRMSupplierBrandMapEntityList = FCCPRMSupplierBrandMap.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(pRMSupplierBrandMapEntityList ?? new List <PRMSupplierBrandMapEntity>());
        }