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

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = INVTRFStoreIssueNoteMapEntity.FLD_NAME_TRFStoreIssueNoteMapID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                iNVTRFStoreIssueNoteMapEntityList = FCCINVTRFStoreIssueNoteMap.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(iNVTRFStoreIssueNoteMapEntityList ?? new List <INVTRFStoreIssueNoteMapEntity>());
        }
        private void SaveINVTRFStoreIssueNoteMapEntity()
        {
            if (IsValid)
            {
                try
                {
                    INVTRFStoreIssueNoteMapEntity iNVTRFStoreIssueNoteMapEntity = BuildINVTRFStoreIssueNoteMapEntity();

                    Int64 result = -1;

                    if (iNVTRFStoreIssueNoteMapEntity.IsNew)
                    {
                        result = FCCINVTRFStoreIssueNoteMap.GetFacadeCreate().Add(iNVTRFStoreIssueNoteMapEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(INVTRFStoreIssueNoteMapEntity.FLD_NAME_TRFStoreIssueNoteMapID, iNVTRFStoreIssueNoteMapEntity.TRFStoreIssueNoteMapID.ToString(), SQLMatchType.Equal);
                        result = FCCINVTRFStoreIssueNoteMap.GetFacadeCreate().Update(iNVTRFStoreIssueNoteMapEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _TRFStoreIssueNoteMapID        = 0;
                        _INVTRFStoreIssueNoteMapEntity = new INVTRFStoreIssueNoteMapEntity();
                        PrepareInitialView();
                        BindINVTRFStoreIssueNoteMapList();

                        if (iNVTRFStoreIssueNoteMapEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "I NVTRFStore Issue Note Map Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "I NVTRFStore Issue Note Map Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (iNVTRFStoreIssueNoteMapEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add I NVTRFStore Issue Note Map Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update I NVTRFStore Issue Note Map Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
        protected void lvINVTRFStoreIssueNoteMap_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 TRFStoreIssueNoteMapID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(INVTRFStoreIssueNoteMapEntity.FLD_NAME_TRFStoreIssueNoteMapID, TRFStoreIssueNoteMapID.ToString(), SQLMatchType.Equal);

                        INVTRFStoreIssueNoteMapEntity iNVTRFStoreIssueNoteMapEntity = new INVTRFStoreIssueNoteMapEntity();


                        result = FCCINVTRFStoreIssueNoteMap.GetFacadeCreate().Delete(iNVTRFStoreIssueNoteMapEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _TRFStoreIssueNoteMapID        = 0;
                            _INVTRFStoreIssueNoteMapEntity = new INVTRFStoreIssueNoteMapEntity();
                            PrepareInitialView();
                            BindINVTRFStoreIssueNoteMapList();

                            MiscUtil.ShowMessage(lblMessage, "I NVTRFStore Issue Note Map has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete I NVTRFStore Issue Note Map.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
Esempio n. 4
0
        public IList <INVTRFStoreIssueNoteMapEntity> GetData()
        {
            IList <INVTRFStoreIssueNoteMapEntity> iNVTRFStoreIssueNoteMapEntityList = new List <INVTRFStoreIssueNoteMapEntity>();

            try
            {
                iNVTRFStoreIssueNoteMapEntityList = FCCINVTRFStoreIssueNoteMap.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(iNVTRFStoreIssueNoteMapEntityList ?? new List <INVTRFStoreIssueNoteMapEntity>());
        }