Пример #1
0
        public IList <MDSchedulePriorityEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression)
        {
            IList <MDSchedulePriorityEntity> mDSchedulePriorityEntityList = new List <MDSchedulePriorityEntity>();

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = MDSchedulePriorityEntity.FLD_NAME_SchedulePriorityID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                mDSchedulePriorityEntityList = FCCMDSchedulePriority.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(mDSchedulePriorityEntityList ?? new List <MDSchedulePriorityEntity>());
        }
Пример #2
0
        private void SaveMDSchedulePriorityEntity()
        {
            if (IsValid)
            {
                try
                {
                    MDSchedulePriorityEntity mDSchedulePriorityEntity = BuildMDSchedulePriorityEntity();

                    Int64 result = -1;

                    if (mDSchedulePriorityEntity.IsNew)
                    {
                        result = FCCMDSchedulePriority.GetFacadeCreate().Add(mDSchedulePriorityEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(MDSchedulePriorityEntity.FLD_NAME_SchedulePriorityID, mDSchedulePriorityEntity.SchedulePriorityID.ToString(), SQLMatchType.Equal);
                        result = FCCMDSchedulePriority.GetFacadeCreate().Update(mDSchedulePriorityEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _SchedulePriorityID       = 0;
                        _MDSchedulePriorityEntity = new MDSchedulePriorityEntity();
                        PrepareInitialView();
                        BindMDSchedulePriorityList();

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

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(MDSchedulePriorityEntity.FLD_NAME_SchedulePriorityID, SchedulePriorityID.ToString(), SQLMatchType.Equal);

                        MDSchedulePriorityEntity mDSchedulePriorityEntity = new MDSchedulePriorityEntity();


                        result = FCCMDSchedulePriority.GetFacadeCreate().Delete(mDSchedulePriorityEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _SchedulePriorityID       = 0;
                            _MDSchedulePriorityEntity = new MDSchedulePriorityEntity();
                            PrepareInitialView();
                            BindMDSchedulePriorityList();

                            MiscUtil.ShowMessage(lblMessage, "Schedule Priority has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Schedule Priority.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
Пример #4
0
        public IList <MDSchedulePriorityEntity> GetData()
        {
            IList <MDSchedulePriorityEntity> mDSchedulePriorityEntityList = new List <MDSchedulePriorityEntity>();

            try
            {
                mDSchedulePriorityEntityList = FCCMDSchedulePriority.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(mDSchedulePriorityEntityList ?? new List <MDSchedulePriorityEntity>());
        }