示例#1
0
        public IList <CMCriterionStatusRemarksEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression)
        {
            IList <CMCriterionStatusRemarksEntity> cMCriterionStatusRemarksEntityList = new List <CMCriterionStatusRemarksEntity>();

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = CMCriterionStatusRemarksEntity.FLD_NAME_CriterionStatusRemarksID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                cMCriterionStatusRemarksEntityList = FCCCMCriterionStatusRemarks.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(cMCriterionStatusRemarksEntityList ?? new List <CMCriterionStatusRemarksEntity>());
        }
        private void SaveCMCriterionStatusRemarksEntity()
        {
            if (IsValid)
            {
                try
                {
                    CMCriterionStatusRemarksEntity cMCriterionStatusRemarksEntity = BuildCMCriterionStatusRemarksEntity();

                    Int64 result = -1;

                    if (cMCriterionStatusRemarksEntity.IsNew)
                    {
                        result = FCCCMCriterionStatusRemarks.GetFacadeCreate().Add(cMCriterionStatusRemarksEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(CMCriterionStatusRemarksEntity.FLD_NAME_CriterionStatusRemarksID, cMCriterionStatusRemarksEntity.CriterionStatusRemarksID.ToString(), SQLMatchType.Equal);
                        result = FCCCMCriterionStatusRemarks.GetFacadeCreate().Update(cMCriterionStatusRemarksEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _CriterionStatusRemarksID       = 0;
                        _CMCriterionStatusRemarksEntity = new CMCriterionStatusRemarksEntity();
                        PrepareInitialView();
                        BindCMCriterionStatusRemarksList();

                        if (cMCriterionStatusRemarksEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Criterion Status Remarks Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Criterion Status Remarks Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (cMCriterionStatusRemarksEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Criterion Status Remarks Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Criterion Status Remarks Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
        protected void lvCMCriterionStatusRemarks_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 CriterionStatusRemarksID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(CMCriterionStatusRemarksEntity.FLD_NAME_CriterionStatusRemarksID, CriterionStatusRemarksID.ToString(), SQLMatchType.Equal);

                        CMCriterionStatusRemarksEntity cMCriterionStatusRemarksEntity = new CMCriterionStatusRemarksEntity();


                        result = FCCCMCriterionStatusRemarks.GetFacadeCreate().Delete(cMCriterionStatusRemarksEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _CriterionStatusRemarksID       = 0;
                            _CMCriterionStatusRemarksEntity = new CMCriterionStatusRemarksEntity();
                            PrepareInitialView();
                            BindCMCriterionStatusRemarksList();

                            MiscUtil.ShowMessage(lblMessage, "Criterion Status Remarks has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Criterion Status Remarks.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
示例#4
0
        public IList <CMCriterionStatusRemarksEntity> GetData()
        {
            IList <CMCriterionStatusRemarksEntity> cMCriterionStatusRemarksEntityList = new List <CMCriterionStatusRemarksEntity>();

            try
            {
                cMCriterionStatusRemarksEntityList = FCCCMCriterionStatusRemarks.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(cMCriterionStatusRemarksEntityList ?? new List <CMCriterionStatusRemarksEntity>());
        }