Browse Source

...

master
yibo 8 years ago
parent
commit
7869ebf1f3
2 changed files with 16 additions and 19 deletions
  1. +1
    -1
      BO/BO.csproj
  2. +15
    -18
      BO/Utils/AfterLoginUtil.cs

+ 1
- 1
BO/BO.csproj View File

@ -17,7 +17,7 @@
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath> <OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>


+ 15
- 18
BO/Utils/AfterLoginUtil.cs View File

@ -18,17 +18,16 @@ namespace BO.Utils
public static class AfterLoginUtil public static class AfterLoginUtil
{ {
// static List<Tuple<string, string>> roleToAssemblies = new List<Tuple<string, string>>(){new Tuple<string,string>("排宰员",@"C:\BwpB3Project\src\B3ButcherManageClient\ButcherOrder\bin\Debug\ButcherOrder"),
//new Tuple<string,string>("过磅员",@"C:\BwpB3Project\src\B3ButcherManageClient\ButcherWeight\bin\Debug\ButcherWeight"),
// new Tuple<string,string>("验质员",@"C:\BwpB3Project\src\B3ButcherManageClient\QualityAndOrder\bin\Debug\QualityAndOrder"),
// new Tuple<string,string>("定级员",@"C:\BwpB3Project\src\B3ButcherManageClient\WeighAndGrading\bin\Debug\WeighAndGrading"),
// new Tuple<string,string>("窒晕员",@"C:\BwpB3Project\src\B3ButcherManageClient\OrderConfirm\bin\Debug\OrderConfirm"),
// new Tuple<string,string>("掉猪处理员",@"C:\BwpB3Project\src\B3ButcherManageClient\DropPigReOrder\bin\Debug\DropPigReOrder"),
// new Tuple<string,string>("配货员",@"D:\BWP\BWPB3\src\B3ButcherManageClient\Distribution\bin\Debug\Distribution")
//};
#if DEBUG
static List<Tuple<string, string>> roleToAssemblies = new List<Tuple<string, string>>(){new Tuple<string,string>("排宰员",@"C:\BwpB3Project\src\B3ButcherManageClient\ButcherOrder\bin\Debug\ButcherOrder"),
new Tuple<string,string>("过磅员",@"C:\BwpB3Project\src\B3ButcherManageClient\ButcherWeight\bin\Debug\ButcherWeight"),
new Tuple<string,string>("验质员",@"C:\BwpB3Project\src\B3ButcherManageClient\QualityAndOrder\bin\Debug\QualityAndOrder"),
new Tuple<string,string>("定级员",@"C:\BwpB3Project\src\B3ButcherManageClient\WeighAndGrading\bin\Debug\WeighAndGrading"),
new Tuple<string,string>("窒晕员",@"C:\BwpB3Project\src\B3ButcherManageClient\OrderConfirm\bin\Debug\OrderConfirm"),
new Tuple<string,string>("掉猪处理员",@"C:\BwpB3Project\src\B3ButcherManageClient\DropPigReOrder\bin\Debug\DropPigReOrder"),
new Tuple<string,string>("配货员",@"D:\BWP\BWPB3\src\B3ButcherManageClient\Distribution\bin\Debug\Distribution")
};
#else
static List<Tuple<string, string>> roleToAssemblies = new List<Tuple<string, string>>() static List<Tuple<string, string>> roleToAssemblies = new List<Tuple<string, string>>()
{ {
new Tuple<string,string>("排宰员",@"ButcherOrder"), new Tuple<string,string>("排宰员",@"ButcherOrder"),
@ -38,20 +37,18 @@ namespace BO.Utils
new Tuple<string,string>("窒晕员",@"OrderConfirm"), new Tuple<string,string>("窒晕员",@"OrderConfirm"),
new Tuple<string,string>("掉猪处理员",@"DropPigReOrder"), new Tuple<string,string>("掉猪处理员",@"DropPigReOrder"),
}; };
#endif
public static Form CreateForm(string role) public static Form CreateForm(string role)
{ {
var first = roleToAssemblies.FirstOrDefault(x => x.Item1 == role); var first = roleToAssemblies.FirstOrDefault(x => x.Item1 == role);
if (first == null) if (first == null)
throw new Exception("未注册的角色"); throw new Exception("未注册的角色");
//#if debug
//var filePath = string.Format("{0}.dll", first.Item2);
//#endif
//#if !debug
#if DEBUG
var filePath = string.Format("{0}.dll", first.Item2);
#else
var filePath = Path.Combine(Application.StartupPath, string.Format("{0}.dll", first.Item2)); var filePath = Path.Combine(Application.StartupPath, string.Format("{0}.dll", first.Item2));
//#endif
#endif
if (!File.Exists(filePath)) if (!File.Exists(filePath))
throw new Exception("相关模块不存在"); throw new Exception("相关模块不存在");
var formType = typeof(IAfterLogin); var formType = typeof(IAfterLogin);


Loading…
Cancel
Save