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

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = CMWorkAreaStatusEntity.FLD_NAME_WorkAreaStatusID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                cMWorkAreaStatusEntityList = FCCCMWorkAreaStatus.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(cMWorkAreaStatusEntityList ?? new List <CMWorkAreaStatusEntity>());
        }
Esempio n. 2
0
        private void SaveCMWorkAreaStatusEntity()
        {
            if (IsValid)
            {
                try
                {
                    CMWorkAreaStatusEntity cMWorkAreaStatusEntity = BuildCMWorkAreaStatusEntity();

                    Int64 result = -1;

                    if (cMWorkAreaStatusEntity.IsNew)
                    {
                        result = FCCCMWorkAreaStatus.GetFacadeCreate().Add(cMWorkAreaStatusEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(CMWorkAreaStatusEntity.FLD_NAME_WorkAreaStatusID, cMWorkAreaStatusEntity.WorkAreaStatusID.ToString(), SQLMatchType.Equal);
                        result = FCCCMWorkAreaStatus.GetFacadeCreate().Update(cMWorkAreaStatusEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _WorkAreaStatusID       = 0;
                        _CMWorkAreaStatusEntity = new CMWorkAreaStatusEntity();
                        PrepareInitialView();
                        BindCMWorkAreaStatusList();

                        if (cMWorkAreaStatusEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "C MWork Area Status Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "C MWork Area Status Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (cMWorkAreaStatusEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add C MWork Area Status Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update C MWork Area Status Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
Esempio n. 3
0
        protected void lvCMWorkAreaStatus_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 WorkAreaStatusID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(CMWorkAreaStatusEntity.FLD_NAME_WorkAreaStatusID, WorkAreaStatusID.ToString(), SQLMatchType.Equal);

                        CMWorkAreaStatusEntity cMWorkAreaStatusEntity = new CMWorkAreaStatusEntity();


                        result = FCCCMWorkAreaStatus.GetFacadeCreate().Delete(cMWorkAreaStatusEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _WorkAreaStatusID       = 0;
                            _CMWorkAreaStatusEntity = new CMWorkAreaStatusEntity();
                            PrepareInitialView();
                            BindCMWorkAreaStatusList();

                            MiscUtil.ShowMessage(lblMessage, "C MWork Area Status has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete C MWork Area Status.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
Esempio n. 4
0
        public IList <CMWorkAreaStatusEntity> GetData()
        {
            IList <CMWorkAreaStatusEntity> cMWorkAreaStatusEntityList = new List <CMWorkAreaStatusEntity>();

            try
            {
                cMWorkAreaStatusEntityList = FCCCMWorkAreaStatus.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(cMWorkAreaStatusEntityList ?? new List <CMWorkAreaStatusEntity>());
        }