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

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = BDOperatorContactPersonEntity.FLD_NAME_OperatorContactPersonID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                bDOperatorContactPersonEntityList = FCCBDOperatorContactPerson.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(bDOperatorContactPersonEntityList ?? new List <BDOperatorContactPersonEntity>());
        }
Пример #2
0
        private void SaveBDOperatorContactPersonEntity()
        {
            if (IsValid)
            {
                try
                {
                    BDOperatorContactPersonEntity bDOperatorContactPersonEntity = BuildBDOperatorContactPersonEntity();

                    Int64 result = -1;

                    if (bDOperatorContactPersonEntity.IsNew)
                    {
                        result = FCCBDOperatorContactPerson.GetFacadeCreate().Add(bDOperatorContactPersonEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(BDOperatorContactPersonEntity.FLD_NAME_OperatorContactPersonID, bDOperatorContactPersonEntity.OperatorContactPersonID.ToString(), SQLMatchType.Equal);
                        result = FCCBDOperatorContactPerson.GetFacadeCreate().Update(bDOperatorContactPersonEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _OperatorContactPersonID       = 0;
                        _BDOperatorContactPersonEntity = new BDOperatorContactPersonEntity();
                        PrepareInitialView();
                        BindBDOperatorContactPersonList();

                        if (bDOperatorContactPersonEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Operator Contact Person Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Operator Contact Person Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (bDOperatorContactPersonEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Operator Contact Person Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Operator Contact Person Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
Пример #3
0
        protected void lvBDOperatorContactPerson_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 OperatorContactPersonID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(BDOperatorContactPersonEntity.FLD_NAME_OperatorContactPersonID, OperatorContactPersonID.ToString(), SQLMatchType.Equal);

                        BDOperatorContactPersonEntity bDOperatorContactPersonEntity = new BDOperatorContactPersonEntity();


                        result = FCCBDOperatorContactPerson.GetFacadeCreate().Delete(bDOperatorContactPersonEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _OperatorContactPersonID       = 0;
                            _BDOperatorContactPersonEntity = new BDOperatorContactPersonEntity();
                            PrepareInitialView();
                            BindBDOperatorContactPersonList();

                            MiscUtil.ShowMessage(lblMessage, "Operator Contact Person has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Operator Contact Person.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
        public IList <BDOperatorContactPersonEntity> GetData()
        {
            IList <BDOperatorContactPersonEntity> bDOperatorContactPersonEntityList = new List <BDOperatorContactPersonEntity>();

            try
            {
                bDOperatorContactPersonEntityList = FCCBDOperatorContactPerson.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(bDOperatorContactPersonEntityList ?? new List <BDOperatorContactPersonEntity>());
        }