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

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = MDProjectStatusEntity.FLD_NAME_ProjectStatusID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                mDProjectStatusEntityList = FCCMDProjectStatus.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(mDProjectStatusEntityList ?? new List <MDProjectStatusEntity>());
        }
Ejemplo n.º 2
0
        private void SaveMDProjectStatusEntity()
        {
            if (IsValid)
            {
                try
                {
                    MDProjectStatusEntity mDProjectStatusEntity = BuildMDProjectStatusEntity();

                    Int64 result = -1;

                    if (mDProjectStatusEntity.IsNew)
                    {
                        result = FCCMDProjectStatus.GetFacadeCreate().Add(mDProjectStatusEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(MDProjectStatusEntity.FLD_NAME_ProjectStatusID, mDProjectStatusEntity.ProjectStatusID.ToString(), SQLMatchType.Equal);
                        result = FCCMDProjectStatus.GetFacadeCreate().Update(mDProjectStatusEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _ProjectStatusID       = 0;
                        _MDProjectStatusEntity = new MDProjectStatusEntity();
                        PrepareInitialView();
                        BindMDProjectStatusList();

                        if (mDProjectStatusEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Project Status Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Project Status Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (mDProjectStatusEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Project Status Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Project Status Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
Ejemplo n.º 3
0
        protected void lvMDProjectStatus_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 ProjectStatusID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(MDProjectStatusEntity.FLD_NAME_ProjectStatusID, ProjectStatusID.ToString(), SQLMatchType.Equal);

                        MDProjectStatusEntity mDProjectStatusEntity = new MDProjectStatusEntity();


                        result = FCCMDProjectStatus.GetFacadeCreate().Delete(mDProjectStatusEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _ProjectStatusID       = 0;
                            _MDProjectStatusEntity = new MDProjectStatusEntity();
                            PrepareInitialView();
                            BindMDProjectStatusList();

                            MiscUtil.ShowMessage(lblMessage, "Project Status has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Project Status.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
        public IList <MDProjectStatusEntity> GetData()
        {
            IList <MDProjectStatusEntity> mDProjectStatusEntityList = new List <MDProjectStatusEntity>();

            try
            {
                mDProjectStatusEntityList = FCCMDProjectStatus.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(mDProjectStatusEntityList ?? new List <MDProjectStatusEntity>());
        }