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

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = MDScheduleIdentityCategoryEntity.FLD_NAME_ScheduleIdentityCategoryID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                mDScheduleIdentityCategoryEntityList = FCCMDScheduleIdentityCategory.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(mDScheduleIdentityCategoryEntityList ?? new List <MDScheduleIdentityCategoryEntity>());
        }
Ejemplo n.º 2
0
        private void SaveMDScheduleIdentityCategoryEntity()
        {
            if (IsValid)
            {
                try
                {
                    MDScheduleIdentityCategoryEntity mDScheduleIdentityCategoryEntity = BuildMDScheduleIdentityCategoryEntity();

                    Int64 result = -1;

                    if (mDScheduleIdentityCategoryEntity.IsNew)
                    {
                        result = FCCMDScheduleIdentityCategory.GetFacadeCreate().Add(mDScheduleIdentityCategoryEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(MDScheduleIdentityCategoryEntity.FLD_NAME_ScheduleIdentityCategoryID, mDScheduleIdentityCategoryEntity.ScheduleIdentityCategoryID.ToString(), SQLMatchType.Equal);
                        result = FCCMDScheduleIdentityCategory.GetFacadeCreate().Update(mDScheduleIdentityCategoryEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _ScheduleIdentityCategoryID       = 0;
                        _MDScheduleIdentityCategoryEntity = new MDScheduleIdentityCategoryEntity();
                        PrepareInitialView();
                        BindMDScheduleIdentityCategoryList();

                        if (mDScheduleIdentityCategoryEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Schedule Identity Category Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Schedule Identity Category Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (mDScheduleIdentityCategoryEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Schedule Identity Category Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Schedule Identity Category Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
Ejemplo n.º 3
0
        protected void lvMDScheduleIdentityCategory_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 ScheduleIdentityCategoryID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(MDScheduleIdentityCategoryEntity.FLD_NAME_ScheduleIdentityCategoryID, ScheduleIdentityCategoryID.ToString(), SQLMatchType.Equal);

                        MDScheduleIdentityCategoryEntity mDScheduleIdentityCategoryEntity = new MDScheduleIdentityCategoryEntity();


                        result = FCCMDScheduleIdentityCategory.GetFacadeCreate().Delete(mDScheduleIdentityCategoryEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _ScheduleIdentityCategoryID       = 0;
                            _MDScheduleIdentityCategoryEntity = new MDScheduleIdentityCategoryEntity();
                            PrepareInitialView();
                            BindMDScheduleIdentityCategoryList();

                            MiscUtil.ShowMessage(lblMessage, "Schedule Identity Category has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Schedule Identity Category.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
        public IList <MDScheduleIdentityCategoryEntity> GetData()
        {
            IList <MDScheduleIdentityCategoryEntity> mDScheduleIdentityCategoryEntityList = new List <MDScheduleIdentityCategoryEntity>();

            try
            {
                mDScheduleIdentityCategoryEntityList = FCCMDScheduleIdentityCategory.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(mDScheduleIdentityCategoryEntityList ?? new List <MDScheduleIdentityCategoryEntity>());
        }