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

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = MDMaterialReceiveApprovalStatusEntity.FLD_NAME_MaterialReceiveApprovalStatusID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                mDMaterialReceiveApprovalStatusEntityList = FCCMDMaterialReceiveApprovalStatus.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(mDMaterialReceiveApprovalStatusEntityList ?? new List <MDMaterialReceiveApprovalStatusEntity>());
        }
示例#2
0
        private void SaveMDMaterialReceiveApprovalStatusEntity()
        {
            if (IsValid)
            {
                try
                {
                    MDMaterialReceiveApprovalStatusEntity mDMaterialReceiveApprovalStatusEntity = BuildMDMaterialReceiveApprovalStatusEntity();

                    Int64 result = -1;

                    if (mDMaterialReceiveApprovalStatusEntity.IsNew)
                    {
                        result = FCCMDMaterialReceiveApprovalStatus.GetFacadeCreate().Add(mDMaterialReceiveApprovalStatusEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(MDMaterialReceiveApprovalStatusEntity.FLD_NAME_MaterialReceiveApprovalStatusID, mDMaterialReceiveApprovalStatusEntity.MaterialReceiveApprovalStatusID.ToString(), SQLMatchType.Equal);
                        result = FCCMDMaterialReceiveApprovalStatus.GetFacadeCreate().Update(mDMaterialReceiveApprovalStatusEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _MaterialReceiveApprovalStatusID       = 0;
                        _MDMaterialReceiveApprovalStatusEntity = new MDMaterialReceiveApprovalStatusEntity();
                        PrepareInitialView();
                        BindMDMaterialReceiveApprovalStatusList();

                        if (mDMaterialReceiveApprovalStatusEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Material Receive Approval Status Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Material Receive Approval Status Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (mDMaterialReceiveApprovalStatusEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Material Receive Approval Status Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Material Receive Approval Status Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
示例#3
0
        protected void lvMDMaterialReceiveApprovalStatus_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 MaterialReceiveApprovalStatusID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(MDMaterialReceiveApprovalStatusEntity.FLD_NAME_MaterialReceiveApprovalStatusID, MaterialReceiveApprovalStatusID.ToString(), SQLMatchType.Equal);

                        MDMaterialReceiveApprovalStatusEntity mDMaterialReceiveApprovalStatusEntity = new MDMaterialReceiveApprovalStatusEntity();


                        result = FCCMDMaterialReceiveApprovalStatus.GetFacadeCreate().Delete(mDMaterialReceiveApprovalStatusEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _MaterialReceiveApprovalStatusID       = 0;
                            _MDMaterialReceiveApprovalStatusEntity = new MDMaterialReceiveApprovalStatusEntity();
                            PrepareInitialView();
                            BindMDMaterialReceiveApprovalStatusList();

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

            try
            {
                mDMaterialReceiveApprovalStatusEntityList = FCCMDMaterialReceiveApprovalStatus.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(mDMaterialReceiveApprovalStatusEntityList ?? new List <MDMaterialReceiveApprovalStatusEntity>());
        }