64 lines
2.1 KiB
C#
64 lines
2.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using Sarand.Core.Bus;
|
|
using Sarand.PatientMgr.Core.App;
|
|
using Sarand.PatientMgr.Core.Bus;
|
|
using Sarand.Core.Interfaces;
|
|
using Sarand.Core.Dbas.Base;
|
|
using Sarand.PatientMgr.Core.Mgr;
|
|
using Sarand.Core.Base;
|
|
using Sarand.Win.Dbas.Data;
|
|
using Sarand.Win.Dbas.Base;
|
|
|
|
namespace Sarand.PatientMgr.Win.Dbas.Bus
|
|
{
|
|
//=======================================================================
|
|
class SpmOperation_Dbas : SpmOperation
|
|
{
|
|
//-------------------------------------------------------------------
|
|
// Data members.
|
|
private readonly SpmUserContext userContext;
|
|
|
|
//-------------------------------------------------------------------
|
|
// Construction.
|
|
public SpmOperation_Dbas(SpmUserContext userContext, SysId departmentId, SysId institutionId, ushort flags) :
|
|
base(departmentId, institutionId)
|
|
{
|
|
this.userContext = userContext;
|
|
Flags = flags;
|
|
}
|
|
protected override void Dispose(bool disposing)
|
|
{
|
|
if (disposing)
|
|
{
|
|
}
|
|
base.Dispose(disposing);
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
// Properties.
|
|
|
|
//-------------------------------------------------------------------
|
|
// A s s o c i a t e d D a t a E l e m e n t s
|
|
//-------------------------------------------------------------------
|
|
public override bool HasProcedures()
|
|
{
|
|
return (GetProcedureCount(null) > 0);
|
|
}
|
|
|
|
public override long GetProcedureCount(String filter)
|
|
{
|
|
ClearErrorState();
|
|
if (SysId.IsValid(Id)) return 0;
|
|
ISacsDatabase db = SpmGlobals.Application.GetDatabase(userContext.SessionContext);
|
|
List<String> filters = new List<String>();
|
|
filters.Add(SpmDbDfn.GetColumnName(SpmDbDfn.ColumnIdx.SwmProcedure_OperationId) + "=" + Id.ToString());
|
|
//if (filter && strlen(filter)) filters.Add("(" + filter + ")");
|
|
return db.GetRowCount(SpmDbDfn.GetTableName(SpmDbDfn.TableIdx.SwmProcedure), filters.Concat(" AND ", "(", ")"));
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
}
|
|
//=======================================================================
|
|
}
|