|
@@ -44,24 +44,51 @@ namespace SAGA.MBI
|
|
{
|
|
{
|
|
try
|
|
try
|
|
{
|
|
{
|
|
- var doc = ExternalDataWrapper.Current.Doc;
|
|
|
|
- using (Transaction trans = new Transaction(doc, "删除"))
|
|
|
|
|
|
+ int count = 0;
|
|
|
|
+ var tip = MessageShowBase.Question2("确定要删除所有楼层周长为零的空间?\r\n是:修正全部楼层\r\n否:修正当前楼层\r\n取消:取消修正。");
|
|
|
|
+ switch (tip)
|
|
{
|
|
{
|
|
- trans.Start();
|
|
|
|
- try
|
|
|
|
- {
|
|
|
|
- var spaces = doc.GetSpaces().Where(t => t.IsDeleteSpace());
|
|
|
|
- doc.Delete(spaces.Select(t => t.Id).ToList());
|
|
|
|
- trans.Commit();
|
|
|
|
- MessageShowBase.Infomation("删除成功");
|
|
|
|
- }
|
|
|
|
- catch (Exception)
|
|
|
|
- {
|
|
|
|
- trans.RollBack();
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
|
|
+ case DialogResult.Yes:
|
|
|
|
+ count=DelZeroSpace.OperateAll();
|
|
|
|
+ break;
|
|
|
|
+ case DialogResult.No:
|
|
|
|
+ count=DelZeroSpace.OperateCurFloor();
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ break;
|
|
}
|
|
}
|
|
|
|
+ if(tip== DialogResult.Yes||tip== DialogResult.No)
|
|
|
|
+ MessageShowBase.Infomation($"此次操作共删除{count}个空间");
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ catch (Exception e)
|
|
|
|
+ {
|
|
|
|
+ MessageShow.Show(e);
|
|
|
|
+ return Result.Cancelled;
|
|
|
|
+ }
|
|
|
|
+ return Result.Succeeded;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public override bool IsCommandAvailable(UIApplication applicationData, CategorySet selectedCategories)
|
|
|
|
+ {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 导出类别
|
|
|
|
+ /// </summary>
|
|
|
|
+ [Transaction(TransactionMode.Manual)]
|
|
|
|
+ [Regeneration(RegenerationOption.Manual)]
|
|
|
|
+ public class ExportCategoriesCommand : ExternalCommand
|
|
|
|
+ {
|
|
|
|
+ public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
|
|
|
|
+ {
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
|
|
|
|
+ var tip = MessageShow.Question("确定要导出所有的族类别?");
|
|
|
|
+ if (tip)
|
|
|
|
+ BllFactory<ExportAllCategory>.Instance.Operate();
|
|
}
|
|
}
|
|
catch (Exception e)
|
|
catch (Exception e)
|
|
{
|
|
{
|
|
@@ -70,6 +97,16 @@ namespace SAGA.MBI
|
|
}
|
|
}
|
|
return Result.Succeeded;
|
|
return Result.Succeeded;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// Onlys show the dialog when a document is open, as Dockable dialogs are only available
|
|
|
|
+ /// when a document is open.
|
|
|
|
+ /// </summary>
|
|
|
|
+ public bool IsCommandAvailable(UIApplication applicationData, CategorySet selectedCategories)
|
|
|
|
+ {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 报告设备所在空间
|
|
/// 报告设备所在空间
|
|
@@ -94,6 +131,44 @@ namespace SAGA.MBI
|
|
return Result.Succeeded;
|
|
return Result.Succeeded;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 导出所有的岗位
|
|
|
|
+ /// </summary>
|
|
|
|
+ [Transaction(TransactionMode.Manual)]
|
|
|
|
+ [Regeneration(RegenerationOption.Manual)]
|
|
|
|
+ public class ExportAllDutyCommand : ExternalCommand
|
|
|
|
+ {
|
|
|
|
+ public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
|
|
|
|
+ {
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ var tip = MessageShowBase.Question2("确定要导出所有岗位?\r\n是:全部楼层\r\n否:当前楼层\r\n取消:取消。");
|
|
|
|
+ switch (tip)
|
|
|
|
+ {
|
|
|
|
+ case DialogResult.Yes:
|
|
|
|
+ ExportAllDuty.OperateAll();
|
|
|
|
+ break;
|
|
|
|
+ case DialogResult.No:
|
|
|
|
+ ExportAllDuty.OperateCurFloor();
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ catch (Exception e)
|
|
|
|
+ {
|
|
|
|
+ MessageShow.Show(e);
|
|
|
|
+ return Result.Cancelled;
|
|
|
|
+ }
|
|
|
|
+ return Result.Succeeded;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public override bool IsCommandAvailable(UIApplication applicationData, CategorySet selectedCategories)
|
|
|
|
+ {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
@@ -119,16 +194,6 @@ namespace SAGA.MBI
|
|
}
|
|
}
|
|
return Result.Succeeded;
|
|
return Result.Succeeded;
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
- /// <summary>
|
|
|
|
- /// Onlys show the dialog when a document is open, as Dockable dialogs are only available
|
|
|
|
- /// when a document is open.
|
|
|
|
- /// </summary>
|
|
|
|
- public bool IsCommandAvailable(UIApplication applicationData, CategorySet selectedCategories)
|
|
|
|
- {
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
@@ -136,7 +201,7 @@ namespace SAGA.MBI
|
|
/// </summary>
|
|
/// </summary>
|
|
[Transaction(TransactionMode.Manual)]
|
|
[Transaction(TransactionMode.Manual)]
|
|
[Regeneration(RegenerationOption.Manual)]
|
|
[Regeneration(RegenerationOption.Manual)]
|
|
- public class AddEquipLocationCommand : ExternalCommand, IExternalCommandAvailability
|
|
|
|
|
|
+ public class AddEquipLocationCommand : ExternalCommand
|
|
{
|
|
{
|
|
public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
|
|
public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
|
|
{
|
|
{
|
|
@@ -168,7 +233,7 @@ namespace SAGA.MBI
|
|
/// Onlys show the dialog when a document is open, as Dockable dialogs are only available
|
|
/// Onlys show the dialog when a document is open, as Dockable dialogs are only available
|
|
/// when a document is open.
|
|
/// when a document is open.
|
|
/// </summary>
|
|
/// </summary>
|
|
- public bool IsCommandAvailable(UIApplication applicationData, CategorySet selectedCategories)
|
|
|
|
|
|
+ public override bool IsCommandAvailable(UIApplication applicationData, CategorySet selectedCategories)
|
|
{
|
|
{
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
@@ -178,7 +243,7 @@ namespace SAGA.MBI
|
|
/// </summary>
|
|
/// </summary>
|
|
[Transaction(TransactionMode.Manual)]
|
|
[Transaction(TransactionMode.Manual)]
|
|
[Regeneration(RegenerationOption.Manual)]
|
|
[Regeneration(RegenerationOption.Manual)]
|
|
- public class CheckEquipinFloorCommand : ExternalCommand, IExternalCommandAvailability
|
|
|
|
|
|
+ public class CheckEquipinFloorCommand : ExternalCommand
|
|
{
|
|
{
|
|
public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
|
|
public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
|
|
{
|
|
{
|
|
@@ -201,7 +266,7 @@ namespace SAGA.MBI
|
|
/// Onlys show the dialog when a document is open, as Dockable dialogs are only available
|
|
/// Onlys show the dialog when a document is open, as Dockable dialogs are only available
|
|
/// when a document is open.
|
|
/// when a document is open.
|
|
/// </summary>
|
|
/// </summary>
|
|
- public bool IsCommandAvailable(UIApplication applicationData, CategorySet selectedCategories)
|
|
|
|
|
|
+ public override bool IsCommandAvailable(UIApplication applicationData, CategorySet selectedCategories)
|
|
{
|
|
{
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
@@ -211,7 +276,7 @@ namespace SAGA.MBI
|
|
/// </summary>
|
|
/// </summary>
|
|
[Transaction(TransactionMode.Manual)]
|
|
[Transaction(TransactionMode.Manual)]
|
|
[Regeneration(RegenerationOption.Manual)]
|
|
[Regeneration(RegenerationOption.Manual)]
|
|
- public class UpdateEquipinSpaceCommand : ExternalCommand, IExternalCommandAvailability
|
|
|
|
|
|
+ public class UpdateEquipinSpaceCommand : ExternalCommand
|
|
{
|
|
{
|
|
public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
|
|
public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
|
|
{
|
|
{
|
|
@@ -243,45 +308,12 @@ namespace SAGA.MBI
|
|
/// Onlys show the dialog when a document is open, as Dockable dialogs are only available
|
|
/// Onlys show the dialog when a document is open, as Dockable dialogs are only available
|
|
/// when a document is open.
|
|
/// when a document is open.
|
|
/// </summary>
|
|
/// </summary>
|
|
- public bool IsCommandAvailable(UIApplication applicationData, CategorySet selectedCategories)
|
|
|
|
- {
|
|
|
|
- return true;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- /// <summary>
|
|
|
|
- /// 导出类别
|
|
|
|
- /// </summary>
|
|
|
|
- [Transaction(TransactionMode.Manual)]
|
|
|
|
- [Regeneration(RegenerationOption.Manual)]
|
|
|
|
- public class ExportCategoriesCommand : ExternalCommand
|
|
|
|
- {
|
|
|
|
- public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
|
|
|
|
- {
|
|
|
|
- try
|
|
|
|
- {
|
|
|
|
-
|
|
|
|
- var tip = MessageShow.Question("确定要导出所有的族类别?");
|
|
|
|
- if (tip)
|
|
|
|
- BllFactory<ExportAllCategory>.Instance.Operate();
|
|
|
|
- }
|
|
|
|
- catch (Exception e)
|
|
|
|
- {
|
|
|
|
- MessageShow.Show(e);
|
|
|
|
- return Result.Cancelled;
|
|
|
|
- }
|
|
|
|
- return Result.Succeeded;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- /// <summary>
|
|
|
|
- /// Onlys show the dialog when a document is open, as Dockable dialogs are only available
|
|
|
|
- /// when a document is open.
|
|
|
|
- /// </summary>
|
|
|
|
- public bool IsCommandAvailable(UIApplication applicationData, CategorySet selectedCategories)
|
|
|
|
|
|
+ public override bool IsCommandAvailable(UIApplication applicationData, CategorySet selectedCategories)
|
|
{
|
|
{
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
@@ -304,7 +336,7 @@ namespace SAGA.MBI
|
|
}
|
|
}
|
|
catch (Exception e)
|
|
catch (Exception e)
|
|
{
|
|
{
|
|
- DataCheckProgressBarClient.Stop();
|
|
|
|
|
|
+ CheckProgressBarClient.Stop();
|
|
MessageShow.Show(e);
|
|
MessageShow.Show(e);
|
|
return Result.Cancelled;
|
|
return Result.Cancelled;
|
|
}
|
|
}
|
|
@@ -342,7 +374,7 @@ namespace SAGA.MBI
|
|
}
|
|
}
|
|
catch (Exception e)
|
|
catch (Exception e)
|
|
{
|
|
{
|
|
- DataCheckProgressBarClient.Stop();
|
|
|
|
|
|
+ CheckProgressBarClient.Stop();
|
|
MessageShow.Show(e);
|
|
MessageShow.Show(e);
|
|
return Result.Cancelled;
|
|
return Result.Cancelled;
|
|
}
|
|
}
|