diff --git a/.gitignore b/.gitignore index 708eb27..9b9b2c1 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,6 @@ *.user obj bin +debug +release _ReSharper.B3ButcherManageClient diff --git a/B3ButcherManageClient.sln b/B3ButcherManageClient.sln index 094fd94..c503839 100644 --- a/B3ButcherManageClient.sln +++ b/B3ButcherManageClient.sln @@ -45,6 +45,16 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OffLineQualityAndOrder", "O EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OutHouseView", "OutHouseView\OutHouseView.csproj", "{B91C97B1-8E29-41B9-980A-CC477717D699}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ButcherManage.BO", "ButcherManage.BO\ButcherManage.BO.csproj", "{B1ECBE2F-06FB-4E4C-9487-1497E0808C04}" +EndProject +Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "ButcherManage.Install", "ButcherManage.Install\ButcherManage.Install.vdproj", "{4AD5CD8C-BECA-4C4A-B6D4-C911CAD647DA}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ButcherManage.Tools", "ButcherManage.Tools\ButcherManage.Tools.csproj", "{26433793-6DB6-41FA-A531-8C674B79CFA0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ButcherManage.Login", "ButcherManage.Login\ButcherManage.Login.csproj", "{AA93C97D-E13D-48C7-906F-92CEF2628547}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ButcherManage.Form", "ButcherManage.Form\ButcherManage.Form.csproj", "{97CECE9B-FDBA-483C-8BFE-CF118DF1A82B}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -133,6 +143,24 @@ Global {B91C97B1-8E29-41B9-980A-CC477717D699}.Debug|Any CPU.Build.0 = Debug|Any CPU {B91C97B1-8E29-41B9-980A-CC477717D699}.Release|Any CPU.ActiveCfg = Release|Any CPU {B91C97B1-8E29-41B9-980A-CC477717D699}.Release|Any CPU.Build.0 = Release|Any CPU + {B1ECBE2F-06FB-4E4C-9487-1497E0808C04}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B1ECBE2F-06FB-4E4C-9487-1497E0808C04}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B1ECBE2F-06FB-4E4C-9487-1497E0808C04}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B1ECBE2F-06FB-4E4C-9487-1497E0808C04}.Release|Any CPU.Build.0 = Release|Any CPU + {4AD5CD8C-BECA-4C4A-B6D4-C911CAD647DA}.Debug|Any CPU.ActiveCfg = Debug + {4AD5CD8C-BECA-4C4A-B6D4-C911CAD647DA}.Release|Any CPU.ActiveCfg = Release + {26433793-6DB6-41FA-A531-8C674B79CFA0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {26433793-6DB6-41FA-A531-8C674B79CFA0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {26433793-6DB6-41FA-A531-8C674B79CFA0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {26433793-6DB6-41FA-A531-8C674B79CFA0}.Release|Any CPU.Build.0 = Release|Any CPU + {AA93C97D-E13D-48C7-906F-92CEF2628547}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AA93C97D-E13D-48C7-906F-92CEF2628547}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AA93C97D-E13D-48C7-906F-92CEF2628547}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AA93C97D-E13D-48C7-906F-92CEF2628547}.Release|Any CPU.Build.0 = Release|Any CPU + {97CECE9B-FDBA-483C-8BFE-CF118DF1A82B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {97CECE9B-FDBA-483C-8BFE-CF118DF1A82B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {97CECE9B-FDBA-483C-8BFE-CF118DF1A82B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {97CECE9B-FDBA-483C-8BFE-CF118DF1A82B}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/ButcherManage.BO/Base/Base.cs b/ButcherManage.BO/Base/Base.cs new file mode 100644 index 0000000..073f535 --- /dev/null +++ b/ButcherManage.BO/Base/Base.cs @@ -0,0 +1,14 @@ +using Forks.EnterpriseServices.DomainObjects2; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace ButcherManage.BO +{ + [KeyField("ID", KeyGenType.identity)] + public abstract class Base + { + public long ID { get; set; } + } +} diff --git a/ButcherManage.BO/Base/BaseInfo.cs b/ButcherManage.BO/Base/BaseInfo.cs new file mode 100644 index 0000000..95dc6c1 --- /dev/null +++ b/ButcherManage.BO/Base/BaseInfo.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace ButcherManage.BO +{ + public abstract class BaseInfo + { + public long ID { get; set; } + + public string Name { get; set; } + } +} diff --git a/ButcherManage.BO/Base/ExtensionObj.cs b/ButcherManage.BO/Base/ExtensionObj.cs new file mode 100644 index 0000000..89b3b2f --- /dev/null +++ b/ButcherManage.BO/Base/ExtensionObj.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace ButcherManage.BO +{ + public class ExtensionObj + { + public long? LongExt1 { get; set; } + + public long? LongExt2 { get; set; } + + public decimal? DecimalExt1 { get; set; } + + public string StringExt1 { get; set; } + + public string StringExt2 { get; set; } + } +} diff --git a/ButcherManage.BO/BaseInfo/ProductBatch.cs b/ButcherManage.BO/BaseInfo/ProductBatch.cs new file mode 100644 index 0000000..f9526da --- /dev/null +++ b/ButcherManage.BO/BaseInfo/ProductBatch.cs @@ -0,0 +1,14 @@ +using Forks.EnterpriseServices.DomainObjects2; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace ButcherManage.BO +{ + [MapToTable("Butcher_ProductBatch")] + public class ProductBatch : BaseInfo + { + public DateTime? Date { get; set; } + } +} diff --git a/ButcherManage.BO/BaseInfo/Worker.cs b/ButcherManage.BO/BaseInfo/Worker.cs new file mode 100644 index 0000000..ccc36d4 --- /dev/null +++ b/ButcherManage.BO/BaseInfo/Worker.cs @@ -0,0 +1,25 @@ +using Forks.EnterpriseServices.DomainObjects2; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Text; + +namespace ButcherManage.BO +{ + [MapToTable("Butcher_Worker")] + public class Worker : BaseInfo + { + public string Code { get; set; } + + [DbColumn(AllowNull = false, DbType = SqlDbType.Binary, Length = 16)] + public byte[] Password { get; set; } + public string Role { get; set; } + + [NonDmoProperty] + public IEnumerable RoleList + { + get { return Role.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Select(x => short.Parse(x)); } + } + } +} diff --git a/ButcherManage.BO/Bill/PickOutConfirmDmo.cs b/ButcherManage.BO/Bill/PickOutConfirmDmo.cs new file mode 100644 index 0000000..b576f30 --- /dev/null +++ b/ButcherManage.BO/Bill/PickOutConfirmDmo.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace ButcherManage.BO +{ + public class PickOutConfirmDmo + { + public long ID { get; set; } + + public int Order { get; set; } + + public int PlanNumber { get; set; } + + public string LiveColonyHouse_Name { get; set; } + + public int? AlreadyNumber { get; set; } + + //0:未开始,1:开始,-1:结束 + public int ConfirmState { get; set; } + } +} diff --git a/ButcherManage.BO/Bill/PickOutConfirmLocal.cs b/ButcherManage.BO/Bill/PickOutConfirmLocal.cs new file mode 100644 index 0000000..5d0712d --- /dev/null +++ b/ButcherManage.BO/Bill/PickOutConfirmLocal.cs @@ -0,0 +1,18 @@ +using Forks.EnterpriseServices.DomainObjects2; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace ButcherManage.BO +{ + [MapToTable("Butcher_PickOutConfirmLocal")] + [KeyField("ID", KeyGenType.assigned)] + public class PickOutConfirmLocal + { + public long ID { get; set; } + public int AlreadyNumber { get; set; } + //0:未开始,1:开始,-1:结束 + public int ConfirmState { get; set; } + } +} diff --git a/ButcherManage.BO/Bill/PickOutRecord.cs b/ButcherManage.BO/Bill/PickOutRecord.cs new file mode 100644 index 0000000..16c7c0c --- /dev/null +++ b/ButcherManage.BO/Bill/PickOutRecord.cs @@ -0,0 +1,15 @@ +using Forks.EnterpriseServices.DomainObjects2; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace ButcherManage.BO +{ + [MapToTable("Butcher_PickOutRecord")] + public class PickOutRecord : Base + { + public long Order_ID { get; set; } + public int? Number { get; set; } + } +} diff --git a/ButcherManage.BO/ButcherManage.BO.csproj b/ButcherManage.BO/ButcherManage.BO.csproj new file mode 100644 index 0000000..8b98025 --- /dev/null +++ b/ButcherManage.BO/ButcherManage.BO.csproj @@ -0,0 +1,86 @@ + + + + + Debug + AnyCPU + {B1ECBE2F-06FB-4E4C-9487-1497E0808C04} + Library + Properties + ButcherManage.BO + ButcherManage.BO + v4.5 + 512 + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + false + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + false + + + + False + ..\..\..\tsref\release\Forks.EnterpriseServices.dll + + + False + ..\..\..\tsref\release\Forks.Utils.dll + + + False + ..\..\..\tsref\release\Newtonsoft.Json.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ButcherManage.BO/Enums/DriveType.cs b/ButcherManage.BO/Enums/DriveType.cs new file mode 100644 index 0000000..d244418 --- /dev/null +++ b/ButcherManage.BO/Enums/DriveType.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ButcherManage.BO.Enums +{ + public enum 设备类别 + { + 赶猪确认 = 103, + } +} diff --git a/ButcherManage.BO/LocalBL/PickOutConfirmBL.cs b/ButcherManage.BO/LocalBL/PickOutConfirmBL.cs new file mode 100644 index 0000000..9f1d074 --- /dev/null +++ b/ButcherManage.BO/LocalBL/PickOutConfirmBL.cs @@ -0,0 +1,104 @@ +using Forks.EnterpriseServices.DomainObjects2; +using Forks.EnterpriseServices.DomainObjects2.DQuery; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace ButcherManage.BO.LocalBL +{ + public static class PickOutConfirmBL + { + public static List GetDmoList(DateTime butcherDate) + { + var json = SimpleRest.Call("/MainSystem/B3ClientService/Rpcs/PickOutConfirmRpc/GetList", butcherDate); + var list = JsonConvert.DeserializeObject>(json); + FillDetailWithLocal(list); + return list; + } + + static void FillDetailWithLocal(List list) + { + var query = new DQueryDom(new JoinAlias(typeof(PickOutConfirmLocal))); + query.Columns.Add(DQSelectColumn.Field("ID")); + query.Columns.Add(DQSelectColumn.Field("AlreadyNumber")); + query.Columns.Add(DQSelectColumn.Field("ConfirmState")); + query.Where.Conditions.Add(DQCondition.InList(DQExpression.Field("ID"), list.Select(x => DQExpression.Value(x.ID)).ToArray())); + using (var session = DmoSession.New()) + { + using (var reader = session.ExecuteReader(query)) + { + while (reader.Read()) + { + var first = list.First(x => x.ID == (long)reader[0]); + first.AlreadyNumber = (int)reader[1]; + first.ConfirmState = (int)reader[2]; + } + } + } + } + + public static void ChangeState(long id, int state) + { + using (var session = DmoSession.New()) + { + Update(session, id, "ConfirmState", state); + session.Commit(); + } + } + + public static void SaveRecord(PickOutRecord record) + { + using (var session = DmoSession.New()) + { + if (record.ID == 0) + session.Insert(record); + else + session.Update(record); + UpdateAlreadyNumber(session, record.Order_ID); + session.Commit(); + } + } + + static void UpdateAlreadyNumber(IDmoSession session, long id) + { + var query = new DQueryDom(new JoinAlias(typeof(PickOutRecord))); + query.Columns.Add(DQSelectColumn.Sum("Number")); + query.Where.Conditions.Add(DQCondition.EQ("Order_ID", id)); + var num = query.EExecuteScalar(session); + Update(session, id, "AlreadyNumber", num); + } + + static void Update(IDmoSession session, long id, string file, object value) + where T : new() + { + var type = typeof(T); + var query = new DQueryDom(new JoinAlias(type)); + query.Where.Conditions.Add(DQCondition.EQ("ID", id)); + query.Columns.Add(DQSelectColumn.Create(DQExpression.Value(1), "c")); + if (query.EExecuteScalar(session) == null) + { + var entity = new T(); + type.GetProperty("ID").SetValue(entity, id); + type.GetProperty(file).SetValue(entity, value); + session.Insert(entity); + } + else + { + var update = new DQUpdateDom(type); + update.Where.Conditions.Add(DQCondition.EQ("ID", id)); + update.Columns.Add(new DQUpdateColumn(file, value)); + session.ExecuteNonQuery(update); + } + } + + public static List GetRecordList(long id) + { + var query = new DmoQuery(typeof(PickOutRecord)); + query.Where.Conditions.Add(DQCondition.EQ("Order_ID", id)); + query.OrderBy.Expressions.Add(DQOrderByExpression.Create("ID")); + return query.EExecuteList().Cast().ToList(); + } + } +} diff --git a/ButcherManage.BO/Properties/AssemblyInfo.cs b/ButcherManage.BO/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..656e582 --- /dev/null +++ b/ButcherManage.BO/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的常规信息通过以下 +// 特性集控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("ButcherManage.BO")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ButcherManage.BO")] +[assembly: AssemblyCopyright("Copyright © 2018")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 使此程序集中的类型 +// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, +// 则将该类型上的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("312215bc-b734-42cd-a529-6f3b28bfce7f")] + +// 程序集的版本信息由下面四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, +// 方法是按如下所示使用“*”: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/ButcherManage.BO/Utils/AppContext.cs b/ButcherManage.BO/Utils/AppContext.cs new file mode 100644 index 0000000..7c5cfaa --- /dev/null +++ b/ButcherManage.BO/Utils/AppContext.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace ButcherManage.BO.Utils +{ + public static class AppContext + { + static ServerUrlConfig _connectInfo = ServerUrlConfig.Init(); + public static ServerUrlConfig ConnectInfo { get { return _connectInfo; } } + + static Worker _worker = null; + public static Worker Worker + { + get + { + if (_worker == null) + _worker = LoginUtil.InitUserFromLocal(); + return _worker; + } + } + } + + public class ServerUrlConfig + { + public static ServerUrlConfig Init() + { + return XmlUtil.DeserializeFromFile(); + } + + public string ServerUrl { get; set; } + + public bool LocalOffline { get; set; } + + public string SqlConnection { get; set; } + + private string _traceBackUrl = "default"; + public string TraceBackUrl + { + get { return _traceBackUrl; } + set { _traceBackUrl = value; } + } + + public void Save() + { + XmlUtil.SerializerObjToFile(this); + } + } +} diff --git a/ButcherManage.BO/Utils/ClientRpc.cs b/ButcherManage.BO/Utils/ClientRpc.cs new file mode 100644 index 0000000..54ec31f --- /dev/null +++ b/ButcherManage.BO/Utils/ClientRpc.cs @@ -0,0 +1,141 @@ +using ButcherManage.BO.Utils; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net; +using System.Text; + +namespace ButcherManage.BO +{ + public static class SimpleRest { + static ClientRpc clientRpc; + public static T Call(string method, params object[] args) + { + InitClientRpc(); + return clientRpc.Call(method, args); + } + static void InitClientRpc() + { + if (clientRpc != null) + return; + if (string.IsNullOrEmpty(AppContext.ConnectInfo.ServerUrl)) + throw new Exception("请先配置服务器地址"); + clientRpc = new ClientRpc(AppContext.ConnectInfo.ServerUrl); + } + } + + public class ClientRpc + { + public ClientRpc(string url) + { + mUrl = url; + } + + class _Error + { + public int? code { get; set; } + public string message { get; set; } + } + class _ErrorResposne + { + public _Error error { get; set; } + } + + string mUrl; + + public string Url + { + get + { + return mUrl; + } + } + + public T Call(string method, params object[] args) + { + var resp = DoCall(method, args); + + if (resp.error != null) + { + throw new Exception(string.Format("{0}:{1}", resp.error.code, resp.error.message)); + } + + return resp.result; + } + + LRestClientReponse DoCall(string method, object[] args) + { + var request = (HttpWebRequest)WebRequest.Create(mUrl); + request.Method = "POST"; + request.ContentType = "application/json"; + var dic = new Dictionary(); + dic.Add("method", method); + dic.Add("id", 1); + dic.Add("params", args); + + var json = JsonConvert.SerializeObject(dic); + + var buffer = Encoding.UTF8.GetBytes(json); + + var requestStream = request.GetRequestStream(); + requestStream.Write(buffer, 0, buffer.Length); + + var responseJson = GetResponseJSON(request); + + try + { + var result = JsonConvert.DeserializeObject>(responseJson); + return result; + } + catch + { + try + { + var errorResponse = JsonConvert.DeserializeObject<_ErrorResposne>(responseJson); + if (errorResponse.error != null) + { + throw new Exception(errorResponse.error.message); + } + } + catch + { + throw new Exception("JSON反序列化失败:" + responseJson); + } + throw new Exception("JSON反序列化失败:" + responseJson); + } + + } + + public class LRestClientReponseError + { + public string code { get; set; } + public string message { get; set; } + + public override string ToString() + { + return string.Format("{0}:{1}", code, message); + } + } + + public class LRestClientReponse + { + public long id { get; set; } + public LRestClientReponseError error { get; set; } + public T result { get; set; } + } + + private static string GetResponseJSON(HttpWebRequest request) + { + var response = request.GetResponse(); + using (var stream = response.GetResponseStream()) + { + using (var reader = new StreamReader(stream, Encoding.UTF8)) + { + return reader.ReadToEnd(); + } + } + } + } +} diff --git a/ButcherManage.BO/Utils/DbUtil.cs b/ButcherManage.BO/Utils/DbUtil.cs new file mode 100644 index 0000000..92064e2 --- /dev/null +++ b/ButcherManage.BO/Utils/DbUtil.cs @@ -0,0 +1,49 @@ +using Forks.EnterpriseServices.DomainObjects2; +using Forks.Utils; +using Forks.Utils.Data; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; + +namespace ButcherManage.BO.Utils +{ + public static class DbUtil + { + public static void UpdateDatabase(string sqlConnection) + { + using (ISqlUtil sqlUtil = new SqlUtil(sqlConnection)) + { + var boTypes = GetTypes(); + Dmo.UpdateTables(sqlUtil, boTypes); + } + } + + static IEnumerable GetTypes() + { + var asm = Assembly.GetExecutingAssembly(); + foreach (var t in asm.GetExportedTypes()) + { + if (t.IsAbstract) + { + continue; + } + if (t.IsClass && IsMapTable(t)) + { + yield return t; + } + } + } + + static bool IsMapTable(Type t) + { + var attr = ReflectionUtil.GetAttribute(t); + if (attr == null) + { + return false; + } + return true; + } + } +} diff --git a/ButcherManage.BO/Utils/Extensions.cs b/ButcherManage.BO/Utils/Extensions.cs new file mode 100644 index 0000000..c6bdd84 --- /dev/null +++ b/ButcherManage.BO/Utils/Extensions.cs @@ -0,0 +1,319 @@ +using ButcherManage.BO.Utils; +using Forks.EnterpriseServices.DomainObjects2; +using Forks.EnterpriseServices.DomainObjects2.DQuery; +using Forks.Utils; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace ButcherManage.BO +{ + public static class DmoSession + { + public static IDmoSessionWithTransaction New() + { + return Dmo.NewSession(AppContext.ConnectInfo.SqlConnection); + } + } + + public static class Extensions + { + public static object EExecuteScalar(this DQueryDom query, IDmoSession session) + { + return session.ExecuteScalar(query); + } + + public static object EExecuteScalar(this DQueryDom query) + { + using (var session = DmoSession.New()) + { + return query.EExecuteScalar(session); + } + } + + public static T EExecuteScalar(this DQueryDom query, IDmoSession session) + { + return (T)query.EExecuteScalar(session); + } + + public static T EExecuteScalar(this DQueryDom query) + { + return (T)query.EExecuteScalar(); + } + + public static Tuple EExecuteScalar(this DQueryDom query, IDmoSession session) + { + var list = query.EExecuteList(session); + if (list.Count == 0) + { + return null; + } +#if DEBUG + if (list.Count > 1) + { + throw new Exception(string.Format("期望返回1条记录实际返回{0}条", list.Count)); + } +#endif + return list[0]; + } + + public static Tuple EExecuteScalar(this DQueryDom query) + { + using (var session = DmoSession.New()) + { + return query.EExecuteScalar(session); + } + } + + public static Tuple EExecuteScalar(this DQueryDom query, IDmoSession session) + { + var list = query.EExecuteList(session); + if (list.Count == 0) + { + return null; + } +#if DEBUG + if (list.Count > 1) + { + throw new Exception(string.Format("期望返回1条记录实际返回{0}条", list.Count)); + } +#endif + return list[0]; + } + + public static Tuple EExecuteScalar(this DQueryDom query) + { + using (var session = DmoSession.New()) + { + return query.EExecuteScalar(session); + } + } + + public static T EExecuteScalar(this DmoQuery query) where T : class + { + var result = query.EExecuteList(); + if (result.Count == 0) + { + return default(T); + } + if (result.Count > 1) + { + throw new Exception("ExecuteScalar返回多个数据"); + } + return (T)result[0]; + } + + public static List EExecuteList(this DQueryDom query, IDmoSession session) + { + var list = new List(); + using (var reader = session.ExecuteReader(query)) + { + while (reader.Read()) + { + list.Add((T)reader[0]); + } + } + return list; + } + + public static List EExecuteList(this DQueryDom query) + { + using (var session = DmoSession.New()) + { + return query.EExecuteList(session); + } + } + + public static List EExecuteDmoList(this DQueryDom query, IDmoSession session, params string[] fields) where TDmo : new() + { + var type = typeof(TDmo); + PCheck.IsTrue(query.From.RootSource.Alias.DmoSource == DmoInfo.Get(type)); + + var dmoInfo = DmoInfo.Get(type); + if (fields.Length == 0) + { + + fields = dmoInfo.Fields + .Select((item) => item.Name).ToArray(); + } +#if DEBUG + else + { + foreach (var filed in fields) + { + if (!dmoInfo.Fields.Contains(filed)) + { + throw new Exception(string.Format("对象{0}上不存在字段{1}的定义", type.Name, filed)); + } + } + } +#endif + + if (query.Columns.Count == 0) + { + foreach (var filed in fields) + { + query.Columns.Add(DQSelectColumn.Field(filed)); + } + } + else if (query.Columns.Count != fields.Length) + { + throw new Exception("查询字段数量不匹配"); + } + + var indexSetDic = fields.ToDictionary((item) => Array.IndexOf(fields, item), (item) => type.GetProperty(item).GetSetMethod()); + + var list = new List(); + using (var reader = session.ExecuteReader(query)) + { + while (reader.Read()) + { + var dmo = new TDmo(); + list.Add(dmo); + foreach (var pair in indexSetDic) + { + pair.Value.Invoke(dmo, new object[] { reader[pair.Key] }); + } + } + } + return list; + } + + public static List EExecuteDmoList(this DQueryDom query, params string[] fields) where TDmo : new() + { + using (var session = DmoSession.New()) + { + return query.EExecuteDmoList(session, fields); + } + } + + public static List> EExecuteList(this DQueryDom query, IDmoSession session) + { + var list = new List>(); + + using (var reader = session.ExecuteReader(query)) + { + while (reader.Read()) + { + var value = new Tuple( + (T1)reader[0], + (T2)reader[1]); + list.Add(value); + } + } + return list; + } + + public static List> EExecuteList(this DQueryDom query) + { + using (var session = DmoSession.New()) + { + return query.EExecuteList(session); + } + } + + public static List> EExecuteList(this DQueryDom query, IDmoSession session) + { + var list = new List>(); + using (var reader = session.ExecuteReader(query)) + { + while (reader.Read()) + { + var value = new Tuple( + (T1)reader[0], + (T2)reader[1], + (T3)reader[2]); + list.Add(value); + } + } + return list; + } + + public static List> EExecuteList(this DQueryDom query) + { + using (var session = DmoSession.New()) + { + return query.EExecuteList(session); + } + } + + public static List> EExecuteList(this DQueryDom query) + { + using (var session = DmoSession.New()) + { + return query.EExecuteList(session); + } + } + + public static List> EExecuteList(this DQueryDom query, IDmoSession session) + { + var list = new List>(); + using (var reader = session.ExecuteReader(query)) + { + while (reader.Read()) + { + var value = new Tuple( + (T1)reader[0], + (T2)reader[1], + (T3)reader[2], (T4)reader[3]); + list.Add(value); + } + } + return list; + } + + + public static List> EExecuteList(this DQueryDom query) + { + using (var session = DmoSession.New()) + { + return query.EExecuteList(session); + } + } + + public static List> EExecuteList(this DQueryDom query, IDmoSession session) + { + var list = new List>(); + using (var reader = session.ExecuteReader(query)) + { + while (reader.Read()) + { + var value = new Tuple( + (T1)reader[0], + (T2)reader[1], + (T3)reader[2], (T4)reader[3], (T5)reader[4]); + list.Add(value); + } + } + return list; + } + + public static IList EExecuteList(this DmoQuery query) + { + using (var session = DmoSession.New()) + { + return session.ExecuteList(query); + } + } + + public static void EExecute(this DQUpdateDom update) + { + using (var session = DmoSession.New()) + { + session.ExecuteNonQuery(update); + session.Commit(); + } + } + + public static void EExecute(this DQDeleteDom delete) + { + using (var session = DmoSession.New()) + { + session.ExecuteNonQuery(delete); + session.Commit(); + } + } + } +} diff --git a/ButcherManage.BO/Utils/FormUtil.cs b/ButcherManage.BO/Utils/FormUtil.cs new file mode 100644 index 0000000..2bcc2f2 --- /dev/null +++ b/ButcherManage.BO/Utils/FormUtil.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using System.IO; +using System.Reflection; + +namespace ButcherManage.BO.Utils +{ + public static class FormUtil + { + public static Form CreateFrom() + { + var dll = Path.Combine(Environment.CurrentDirectory, "ButcherManage.Form.dll"); + if (!File.Exists(dll)) + throw new Exception("缺少必要的程序集文件 ButcherManage.Form.dll"); + + var formType = typeof(IWithRoleForm); + Form form = null; + foreach (var type in Assembly.LoadFile(dll).GetTypes()) + { + if (formType.IsAssignableFrom(type)) + { + var instance = (IWithRoleForm)Activator.CreateInstance(type); + foreach (var item in instance.RoleName) + { + if (AppContext.Worker.RoleList.Contains(item)) + return instance.Generate(); + } + } + } + return form; + } + } + + public interface IWithRoleForm + { + List RoleName { get; } + + Form Generate(); + } +} diff --git a/ButcherManage.BO/Utils/LoginUtil.cs b/ButcherManage.BO/Utils/LoginUtil.cs new file mode 100644 index 0000000..26daaee --- /dev/null +++ b/ButcherManage.BO/Utils/LoginUtil.cs @@ -0,0 +1,126 @@ +using Forks.EnterpriseServices.DomainObjects2; +using Forks.EnterpriseServices.DomainObjects2.DQuery; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Security.Cryptography; +using System.Text; + +namespace ButcherManage.BO.Utils +{ + public static class LoginUtil + { + const string WORKPATH = "Config\\Worker.ldb"; + public static Worker InitUserFromLocal() + { + var work = new Worker(); + if (!AppContext.ConnectInfo.LocalOffline) + { + if (File.Exists(WORKPATH)) + work.Name = File.ReadAllText(WORKPATH); + } + else + { + using (var session = DmoSession.New()) + { + var query = new DmoQuery(typeof(Worker)); + var obj = session.ExecuteScalar(query); + if (obj != null) + work = (Worker)obj; + } + } + return work; + } + + public static string GetWorkerNameByCode(string code) + { + string method = "/MainSystem/B3ClientService/Rpcs/LoginRpc/GetWorkerNameByCode"; + var result = SimpleRest.Call(method, code); + int r; + if (int.TryParse(result, out r)) + { + if (r == 0) + throw new Exception("工号输入错误"); + throw new Exception("账号被停用"); + } + else + { + AppContext.Worker.Code = code; + return result; + } + } + + public static void Login(string userName, string pwd) + { + RpcLogin(userName, pwd); + + AppContext.Worker.Name = userName; + AppContext.Worker.Password = EncodePwd(pwd); + if (!AppContext.ConnectInfo.LocalOffline) + { + File.WriteAllText(WORKPATH, userName); + return; + } + using (var session = DmoSession.New()) + { + var table = DmoInfo.Get(typeof(Worker)).MappedDBObject; + var sql = string.Format(@"delete from [{0}]", table); + session.ExecuteSqlNonQuery(sql); + session.Insert(AppContext.Worker); + session.Commit(); + } + } + + static void RpcLogin(string name, string pwd) + { + const string loginMethod = "/MainSystem/B3ClientService/Rpcs/LoginRpc/Login"; + var r = SimpleRest.Call(loginMethod, name, pwd); + if (r == 0) + throw new Exception("用户名密码错误"); + else if (r == -1) + throw new Exception("账号被停用"); + AppContext.Worker.ID = r; + const string wpfUserMethod = "/MainSystem/B3ClientService/Rpcs/LoginRpc/GetWorkerBindDrive"; + AppContext.Worker.Role = SimpleRest.Call(wpfUserMethod, AppContext.Worker.ID); + } + + public static byte[] EncodePwd(string pwd) + { + using (MD5 md5 = MD5.Create()) + return md5.ComputeHash(Encoding.Unicode.GetBytes(pwd)); + } + + public static bool TestConnection(int? millisecondsTimeout = null) + { + var url = AppContext.ConnectInfo.ServerUrl; + if (string.IsNullOrEmpty(url)) + return false; + var uri = new Uri(url); + if (millisecondsTimeout == null) + { + millisecondsTimeout = 50; + } + return TestConnection(uri.Host, uri.Port, millisecondsTimeout.Value); + } + + public static bool TestConnection(string host, int port, int millisecondsTimeout) + { + var client = new System.Net.Sockets.TcpClient(); + try + { + var ar = client.BeginConnect(host, port, null, null); + ar.AsyncWaitHandle.WaitOne(millisecondsTimeout); + return client.Connected; + } + catch (Exception) + { + return false; + } + finally + { + client.Close(); + } + } + } +} diff --git a/ButcherManage.BO/Utils/XmlUtil.cs b/ButcherManage.BO/Utils/XmlUtil.cs new file mode 100644 index 0000000..7de6783 --- /dev/null +++ b/ButcherManage.BO/Utils/XmlUtil.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Xml.Serialization; + +namespace ButcherManage.BO.Utils +{ + public static class XmlUtil + { + static string config = "Config"; + public static void SerializerObjToFile(object obj, string fileName = "") + { + if (string.IsNullOrWhiteSpace(fileName)) + { + fileName = Path.Combine(config, obj.GetType().Name + ".xml"); + } + + var ser = new XmlSerializer(obj.GetType()); + using (var stream = File.Open(fileName, FileMode.Create)) + { + ser.Serialize(stream, obj); + } + } + + public static T DeserializeFromFile(string fileName = "") + where T : new() + { + if (string.IsNullOrWhiteSpace(fileName)) + { + fileName = Path.Combine(config, typeof(T).Name + ".xml"); + } + if (!File.Exists(fileName)) + { + return new T(); + } + using (var reader = new StreamReader(fileName)) + { + var xs = new XmlSerializer(typeof(T)); + object obj = xs.Deserialize(reader); + reader.Close(); + return (T)obj; + } + } + } +} diff --git a/ButcherManage.Form/ButcherManage.Form.csproj b/ButcherManage.Form/ButcherManage.Form.csproj new file mode 100644 index 0000000..eef9b22 --- /dev/null +++ b/ButcherManage.Form/ButcherManage.Form.csproj @@ -0,0 +1,94 @@ + + + + + Debug + AnyCPU + {97CECE9B-FDBA-483C-8BFE-CF118DF1A82B} + Library + Properties + ButcherManage + ButcherManage.Form + v4.5 + 512 + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + false + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + false + + + + + + + + + + + + + + + + + + + + + CalendarSelecter.xaml + + + Form + + + PickOutConfirm.cs + + + + + + PickOutConfirm.cs + + + + + {b1ecbe2f-06fb-4e4c-9487-1497e0808c04} + ButcherManage.BO + + + + + Designer + MSBuild:Compile + + + + + if $(Configuration)==Debug ( +xcopy "$(ProjectDir)bin\debug\*.*" "$(ProjectDir)..\ButcherManage.Login\bin\debug\" /y +) + + + \ No newline at end of file diff --git a/ButcherManage.Form/Dialogs/CalendarSelecter.xaml b/ButcherManage.Form/Dialogs/CalendarSelecter.xaml new file mode 100644 index 0000000..3e465a2 --- /dev/null +++ b/ButcherManage.Form/Dialogs/CalendarSelecter.xaml @@ -0,0 +1,730 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ButcherManage.Form/Dialogs/CalendarSelecter.xaml.cs b/ButcherManage.Form/Dialogs/CalendarSelecter.xaml.cs new file mode 100644 index 0000000..f1871a2 --- /dev/null +++ b/ButcherManage.Form/Dialogs/CalendarSelecter.xaml.cs @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace ButcherManage.Dialogs +{ + /// + /// CalendarSelecter.xaml 的交互逻辑 + /// + public partial class CalendarSelecter : Window, INotifyPropertyChanged + { + public CalendarSelecter() + { + InitializeComponent(); + } + + public void DragWindow(object sender, MouseButtonEventArgs args) + { + this.DragMove(); + } + + private DateTime _result; + public DateTime Result + { + get { return _result; } + private set { _result = value; OnPropertyChanged("Result"); } + } + + private void MC_SelectedDatesChanged(object sender, EventArgs e) + { + Result = MC.SelectedDate.Value; + DialogResult = true; + } + + public event PropertyChangedEventHandler PropertyChanged; + protected void OnPropertyChanged(string propertyName) + { + if (PropertyChanged != null) + PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + + private void imgToday_Initialized(object sender, EventArgs e) + { + var imagePanel = (sender as Image); + var path = System.IO.Path.Combine(Environment.CurrentDirectory, "Images", "today.png"); + imagePanel.Source = new BitmapImage(new Uri(path, UriKind.Absolute)); ; + } + } +} diff --git a/ButcherManage.Form/PickOutConfirm_/PickOutConfirm.Designer.cs b/ButcherManage.Form/PickOutConfirm_/PickOutConfirm.Designer.cs new file mode 100644 index 0000000..be9a308 --- /dev/null +++ b/ButcherManage.Form/PickOutConfirm_/PickOutConfirm.Designer.cs @@ -0,0 +1,543 @@ +namespace ButcherManage.PickOutConfirm_ +{ + partial class PickOutConfirm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle(); + this.panel1 = new System.Windows.Forms.Panel(); + this.orderGrid = new WinFormControl.UDataGridView(); + this.L_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.L_ConfirmState = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.L_Order = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.L_PlanNumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.L_LiveColonyHouse_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.L_AlreadyNumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.L_Start = new System.Windows.Forms.DataGridViewButtonColumn(); + this.L_End = new System.Windows.Forms.DataGridViewButtonColumn(); + this.panel2 = new System.Windows.Forms.Panel(); + this.zeroBtn = new WinFormControl.NButton(); + this.panel3 = new System.Windows.Forms.Panel(); + this.countLbl = new WinFormControl.ULabel(); + this.uLabel3 = new WinFormControl.ULabel(); + this.uLabel2 = new WinFormControl.ULabel(); + this.numberLbl = new WinFormControl.ULabel(); + this.recordGrid = new WinFormControl.UDataGridView(); + this.R_C1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.R_C2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.R_C3 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.R_C4 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.R_C5 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.numPad = new System.Windows.Forms.FlowLayoutPanel(); + this.colseBtn = new WinFormControl.NButton(); + this.uTimerLabel1 = new WinFormControl.UTimerLabel(); + this.datePicker = new System.Windows.Forms.TextBox(); + this.uLabel1 = new WinFormControl.ULabel(); + this.queryBtn = new WinFormControl.NButton(); + this.uLabel4 = new WinFormControl.ULabel(); + this.orderLbl = new WinFormControl.ULabel(); + this.panel1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.orderGrid)).BeginInit(); + this.panel2.SuspendLayout(); + this.panel3.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.recordGrid)).BeginInit(); + this.SuspendLayout(); + // + // panel1 + // + this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panel1.Controls.Add(this.orderGrid); + this.panel1.Location = new System.Drawing.Point(12, 65); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(559, 503); + this.panel1.TabIndex = 2; + // + // orderGrid + // + this.orderGrid.AllowUserToAddRows = false; + this.orderGrid.AllowUserToDeleteRows = false; + this.orderGrid.AllowUserToResizeColumns = false; + this.orderGrid.AllowUserToResizeRows = false; + dataGridViewCellStyle10.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); + this.orderGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle10; + this.orderGrid.BackgroundColor = System.Drawing.Color.White; + this.orderGrid.BorderStyle = System.Windows.Forms.BorderStyle.None; + dataGridViewCellStyle11.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle11.Font = new System.Drawing.Font("宋体", 12F); + dataGridViewCellStyle11.ForeColor = System.Drawing.Color.White; + dataGridViewCellStyle11.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.orderGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle11; + this.orderGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.orderGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.L_ID, + this.L_ConfirmState, + this.L_Order, + this.L_PlanNumber, + this.L_LiveColonyHouse_Name, + this.L_AlreadyNumber, + this.L_Start, + this.L_End}); + this.orderGrid.Dock = System.Windows.Forms.DockStyle.Fill; + this.orderGrid.Location = new System.Drawing.Point(0, 0); + this.orderGrid.MultiSelect = false; + this.orderGrid.Name = "orderGrid"; + this.orderGrid.ReadOnly = true; + dataGridViewCellStyle14.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle14.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle14.Font = new System.Drawing.Font("宋体", 12F); + dataGridViewCellStyle14.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle14.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle14.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle14.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.orderGrid.RowHeadersDefaultCellStyle = dataGridViewCellStyle14; + this.orderGrid.RowHeadersVisible = false; + dataGridViewCellStyle15.Font = new System.Drawing.Font("宋体", 15F); + dataGridViewCellStyle15.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); + this.orderGrid.RowsDefaultCellStyle = dataGridViewCellStyle15; + this.orderGrid.RowTemplate.Height = 80; + this.orderGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.orderGrid.Size = new System.Drawing.Size(557, 501); + this.orderGrid.TabIndex = 2; + this.orderGrid.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.orderGrid_CellClick); + this.orderGrid.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.orderGrid_CellContentClick); + this.orderGrid.RowPrePaint += new System.Windows.Forms.DataGridViewRowPrePaintEventHandler(this.orderGrid_RowPrePaint); + // + // L_ID + // + this.L_ID.DataPropertyName = "ID"; + this.L_ID.HeaderText = "ID"; + this.L_ID.Name = "L_ID"; + this.L_ID.ReadOnly = true; + this.L_ID.Visible = false; + // + // L_ConfirmState + // + this.L_ConfirmState.DataPropertyName = "ConfirmState"; + this.L_ConfirmState.HeaderText = "ConfirmState"; + this.L_ConfirmState.Name = "L_ConfirmState"; + this.L_ConfirmState.ReadOnly = true; + this.L_ConfirmState.Visible = false; + // + // L_Order + // + this.L_Order.DataPropertyName = "Order"; + this.L_Order.HeaderText = "顺序"; + this.L_Order.Name = "L_Order"; + this.L_Order.ReadOnly = true; + // + // L_PlanNumber + // + this.L_PlanNumber.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; + this.L_PlanNumber.DataPropertyName = "PlanNumber"; + this.L_PlanNumber.HeaderText = "排宰头数"; + this.L_PlanNumber.Name = "L_PlanNumber"; + this.L_PlanNumber.ReadOnly = true; + // + // L_LiveColonyHouse_Name + // + this.L_LiveColonyHouse_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.L_LiveColonyHouse_Name.DataPropertyName = "LiveColonyHouse_Name"; + this.L_LiveColonyHouse_Name.HeaderText = "圈舍"; + this.L_LiveColonyHouse_Name.MinimumWidth = 200; + this.L_LiveColonyHouse_Name.Name = "L_LiveColonyHouse_Name"; + this.L_LiveColonyHouse_Name.ReadOnly = true; + // + // L_AlreadyNumber + // + this.L_AlreadyNumber.DataPropertyName = "AlreadyNumber"; + this.L_AlreadyNumber.HeaderText = "确认头数"; + this.L_AlreadyNumber.Name = "L_AlreadyNumber"; + this.L_AlreadyNumber.ReadOnly = true; + // + // L_Start + // + dataGridViewCellStyle12.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle12.Padding = new System.Windows.Forms.Padding(5, 10, 5, 10); + this.L_Start.DefaultCellStyle = dataGridViewCellStyle12; + this.L_Start.HeaderText = "开始"; + this.L_Start.Name = "L_Start"; + this.L_Start.ReadOnly = true; + this.L_Start.Text = "开始"; + this.L_Start.UseColumnTextForButtonValue = true; + this.L_Start.Width = 140; + // + // L_End + // + dataGridViewCellStyle13.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle13.Padding = new System.Windows.Forms.Padding(5, 10, 5, 10); + this.L_End.DefaultCellStyle = dataGridViewCellStyle13; + this.L_End.HeaderText = "结束"; + this.L_End.Name = "L_End"; + this.L_End.ReadOnly = true; + this.L_End.Text = "结束"; + this.L_End.UseColumnTextForButtonValue = true; + this.L_End.Width = 140; + // + // panel2 + // + this.panel2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Right))); + this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panel2.Controls.Add(this.zeroBtn); + this.panel2.Controls.Add(this.panel3); + this.panel2.Controls.Add(this.recordGrid); + this.panel2.Controls.Add(this.numPad); + this.panel2.Location = new System.Drawing.Point(589, 65); + this.panel2.Name = "panel2"; + this.panel2.Size = new System.Drawing.Size(421, 503); + this.panel2.TabIndex = 3; + // + // zeroBtn + // + this.zeroBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.zeroBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(136)))), ((int)(((byte)(255))))); + this.zeroBtn.ClickColor = System.Drawing.Color.YellowGreen; + this.zeroBtn.Font = new System.Drawing.Font("宋体", 15F); + this.zeroBtn.ForeColor = System.Drawing.Color.White; + this.zeroBtn.Location = new System.Drawing.Point(17, 157); + this.zeroBtn.Name = "zeroBtn"; + this.zeroBtn.PlaySound = true; + this.zeroBtn.Size = new System.Drawing.Size(100, 60); + this.zeroBtn.SoundType = WinFormControl.SoundType.Click; + this.zeroBtn.TabIndex = 7; + this.zeroBtn.Text = "0"; + this.zeroBtn.ToColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(136)))), ((int)(((byte)(255))))); + this.zeroBtn.UseVisualStyleBackColor = false; + this.zeroBtn.Click += new System.EventHandler(this.NumberBtnClick); + // + // panel3 + // + this.panel3.Anchor = System.Windows.Forms.AnchorStyles.Bottom; + this.panel3.Controls.Add(this.countLbl); + this.panel3.Controls.Add(this.uLabel3); + this.panel3.Controls.Add(this.uLabel2); + this.panel3.Controls.Add(this.numberLbl); + this.panel3.Location = new System.Drawing.Point(157, 158); + this.panel3.Name = "panel3"; + this.panel3.Size = new System.Drawing.Size(239, 38); + this.panel3.TabIndex = 6; + // + // countLbl + // + this.countLbl.AutoSize = true; + this.countLbl.BackColor = System.Drawing.Color.Transparent; + this.countLbl.Font = new System.Drawing.Font("宋体", 15F); + this.countLbl.ForeColor = System.Drawing.Color.Red; + this.countLbl.Location = new System.Drawing.Point(14, 9); + this.countLbl.Name = "countLbl"; + this.countLbl.Size = new System.Drawing.Size(19, 20); + this.countLbl.TabIndex = 2; + this.countLbl.Text = "0"; + // + // uLabel3 + // + this.uLabel3.AutoSize = true; + this.uLabel3.BackColor = System.Drawing.Color.Transparent; + this.uLabel3.Font = new System.Drawing.Font("宋体", 15F); + this.uLabel3.ForeColor = System.Drawing.Color.Red; + this.uLabel3.Location = new System.Drawing.Point(200, 9); + this.uLabel3.Name = "uLabel3"; + this.uLabel3.Size = new System.Drawing.Size(29, 20); + this.uLabel3.TabIndex = 5; + this.uLabel3.Text = "头"; + // + // uLabel2 + // + this.uLabel2.AutoSize = true; + this.uLabel2.BackColor = System.Drawing.Color.Transparent; + this.uLabel2.Font = new System.Drawing.Font("宋体", 15F); + this.uLabel2.ForeColor = System.Drawing.Color.Red; + this.uLabel2.Location = new System.Drawing.Point(55, 9); + this.uLabel2.Name = "uLabel2"; + this.uLabel2.Size = new System.Drawing.Size(29, 20); + this.uLabel2.TabIndex = 3; + this.uLabel2.Text = "次"; + // + // numberLbl + // + this.numberLbl.AutoSize = true; + this.numberLbl.BackColor = System.Drawing.Color.Transparent; + this.numberLbl.Font = new System.Drawing.Font("宋体", 15F); + this.numberLbl.ForeColor = System.Drawing.Color.Red; + this.numberLbl.Location = new System.Drawing.Point(159, 9); + this.numberLbl.Name = "numberLbl"; + this.numberLbl.Size = new System.Drawing.Size(19, 20); + this.numberLbl.TabIndex = 4; + this.numberLbl.Text = "0"; + // + // recordGrid + // + this.recordGrid.AllowUserToAddRows = false; + this.recordGrid.AllowUserToDeleteRows = false; + this.recordGrid.AllowUserToResizeColumns = false; + this.recordGrid.AllowUserToResizeRows = false; + dataGridViewCellStyle16.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); + this.recordGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle16; + this.recordGrid.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom))); + this.recordGrid.BackgroundColor = System.Drawing.Color.White; + this.recordGrid.BorderStyle = System.Windows.Forms.BorderStyle.None; + dataGridViewCellStyle17.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle17.Font = new System.Drawing.Font("宋体", 12F); + dataGridViewCellStyle17.ForeColor = System.Drawing.Color.White; + dataGridViewCellStyle17.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.recordGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle17; + this.recordGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.recordGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.R_C1, + this.R_C2, + this.R_C3, + this.R_C4, + this.R_C5}); + this.recordGrid.Location = new System.Drawing.Point(-1, -1); + this.recordGrid.MultiSelect = false; + this.recordGrid.Name = "recordGrid"; + this.recordGrid.ReadOnly = true; + this.recordGrid.RowHeadersVisible = false; + dataGridViewCellStyle18.Font = new System.Drawing.Font("宋体", 15F); + dataGridViewCellStyle18.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); + this.recordGrid.RowsDefaultCellStyle = dataGridViewCellStyle18; + this.recordGrid.RowTemplate.Height = 50; + this.recordGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect; + this.recordGrid.Size = new System.Drawing.Size(421, 153); + this.recordGrid.TabIndex = 1; + // + // R_C1 + // + this.R_C1.DataPropertyName = "Number1"; + this.R_C1.HeaderText = "列1"; + this.R_C1.Name = "R_C1"; + this.R_C1.ReadOnly = true; + this.R_C1.Width = 80; + // + // R_C2 + // + this.R_C2.DataPropertyName = "Number2"; + this.R_C2.HeaderText = "列2"; + this.R_C2.Name = "R_C2"; + this.R_C2.ReadOnly = true; + this.R_C2.Width = 80; + // + // R_C3 + // + this.R_C3.DataPropertyName = "Number3"; + this.R_C3.HeaderText = "列3"; + this.R_C3.Name = "R_C3"; + this.R_C3.ReadOnly = true; + this.R_C3.Width = 80; + // + // R_C4 + // + this.R_C4.DataPropertyName = "Number4"; + this.R_C4.HeaderText = "列4"; + this.R_C4.Name = "R_C4"; + this.R_C4.ReadOnly = true; + this.R_C4.Width = 80; + // + // R_C5 + // + this.R_C5.DataPropertyName = "Number5"; + this.R_C5.HeaderText = "列5"; + this.R_C5.Name = "R_C5"; + this.R_C5.ReadOnly = true; + this.R_C5.Width = 80; + // + // numPad + // + this.numPad.Anchor = System.Windows.Forms.AnchorStyles.Bottom; + this.numPad.Location = new System.Drawing.Point(-1, 220); + this.numPad.Name = "numPad"; + this.numPad.Size = new System.Drawing.Size(421, 278); + this.numPad.TabIndex = 0; + // + // colseBtn + // + this.colseBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.colseBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(136)))), ((int)(((byte)(255))))); + this.colseBtn.ClickColor = System.Drawing.Color.YellowGreen; + this.colseBtn.Font = new System.Drawing.Font("宋体", 12F); + this.colseBtn.ForeColor = System.Drawing.Color.White; + this.colseBtn.Location = new System.Drawing.Point(897, 9); + this.colseBtn.Name = "colseBtn"; + this.colseBtn.PlaySound = false; + this.colseBtn.Size = new System.Drawing.Size(113, 45); + this.colseBtn.SoundType = WinFormControl.SoundType.Click; + this.colseBtn.TabIndex = 4; + this.colseBtn.Text = "关 闭"; + this.colseBtn.ToColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(136)))), ((int)(((byte)(255))))); + this.colseBtn.UseVisualStyleBackColor = false; + this.colseBtn.Click += new System.EventHandler(this.colseBtn_Click); + // + // uTimerLabel1 + // + this.uTimerLabel1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.uTimerLabel1.AutoSize = true; + this.uTimerLabel1.BackColor = System.Drawing.Color.Transparent; + this.uTimerLabel1.Font = new System.Drawing.Font("黑体", 13F); + this.uTimerLabel1.Format = "M月d日 H:mm:ss"; + this.uTimerLabel1.Location = new System.Drawing.Point(727, 22); + this.uTimerLabel1.Name = "uTimerLabel1"; + this.uTimerLabel1.Size = new System.Drawing.Size(152, 18); + this.uTimerLabel1.TabIndex = 0; + this.uTimerLabel1.Text = "6月11日 15:37:03"; + // + // datePicker + // + this.datePicker.Font = new System.Drawing.Font("宋体", 15F); + this.datePicker.Location = new System.Drawing.Point(121, 24); + this.datePicker.Name = "datePicker"; + this.datePicker.ReadOnly = true; + this.datePicker.Size = new System.Drawing.Size(156, 30); + this.datePicker.TabIndex = 5; + this.datePicker.MouseDown += new System.Windows.Forms.MouseEventHandler(this.datePicker_MouseDown); + // + // uLabel1 + // + this.uLabel1.AutoSize = true; + this.uLabel1.BackColor = System.Drawing.Color.Transparent; + this.uLabel1.Font = new System.Drawing.Font("宋体", 15F); + this.uLabel1.Location = new System.Drawing.Point(12, 29); + this.uLabel1.Name = "uLabel1"; + this.uLabel1.Size = new System.Drawing.Size(109, 20); + this.uLabel1.TabIndex = 6; + this.uLabel1.Text = "宰杀日期:"; + // + // queryBtn + // + this.queryBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(136)))), ((int)(((byte)(255))))); + this.queryBtn.ClickColor = System.Drawing.Color.YellowGreen; + this.queryBtn.Font = new System.Drawing.Font("宋体", 12F); + this.queryBtn.ForeColor = System.Drawing.Color.White; + this.queryBtn.Location = new System.Drawing.Point(283, 14); + this.queryBtn.Name = "queryBtn"; + this.queryBtn.PlaySound = false; + this.queryBtn.Size = new System.Drawing.Size(113, 45); + this.queryBtn.SoundType = WinFormControl.SoundType.Click; + this.queryBtn.TabIndex = 7; + this.queryBtn.Text = "查 询"; + this.queryBtn.ToColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(136)))), ((int)(((byte)(255))))); + this.queryBtn.UseVisualStyleBackColor = false; + this.queryBtn.Click += new System.EventHandler(this.queryBtn_Click); + // + // uLabel4 + // + this.uLabel4.AutoSize = true; + this.uLabel4.BackColor = System.Drawing.Color.Transparent; + this.uLabel4.Font = new System.Drawing.Font("宋体", 15F); + this.uLabel4.ForeColor = System.Drawing.SystemColors.ControlText; + this.uLabel4.Location = new System.Drawing.Point(413, 27); + this.uLabel4.Name = "uLabel4"; + this.uLabel4.Size = new System.Drawing.Size(109, 20); + this.uLabel4.TabIndex = 8; + this.uLabel4.Text = "作业顺序:"; + // + // orderLbl + // + this.orderLbl.AutoSize = true; + this.orderLbl.BackColor = System.Drawing.Color.Transparent; + this.orderLbl.Font = new System.Drawing.Font("宋体", 23F); + this.orderLbl.ForeColor = System.Drawing.Color.Red; + this.orderLbl.Location = new System.Drawing.Point(516, 19); + this.orderLbl.Name = "orderLbl"; + this.orderLbl.Size = new System.Drawing.Size(30, 31); + this.orderLbl.TabIndex = 9; + this.orderLbl.Text = "0"; + // + // PickOutConfirm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.White; + this.ClientSize = new System.Drawing.Size(1022, 591); + this.Controls.Add(this.orderLbl); + this.Controls.Add(this.uLabel4); + this.Controls.Add(this.queryBtn); + this.Controls.Add(this.datePicker); + this.Controls.Add(this.colseBtn); + this.Controls.Add(this.panel2); + this.Controls.Add(this.panel1); + this.Controls.Add(this.uTimerLabel1); + this.Controls.Add(this.uLabel1); + this.Name = "PickOutConfirm"; + this.Text = "赶猪确认"; + this.WindowState = System.Windows.Forms.FormWindowState.Maximized; + this.panel1.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.orderGrid)).EndInit(); + this.panel2.ResumeLayout(false); + this.panel3.ResumeLayout(false); + this.panel3.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.recordGrid)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private WinFormControl.UTimerLabel uTimerLabel1; + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.Panel panel2; + private WinFormControl.NButton colseBtn; + private System.Windows.Forms.FlowLayoutPanel numPad; + private WinFormControl.UDataGridView orderGrid; + private WinFormControl.UDataGridView recordGrid; + private WinFormControl.ULabel uLabel2; + private WinFormControl.ULabel countLbl; + private WinFormControl.ULabel uLabel3; + private WinFormControl.ULabel numberLbl; + private System.Windows.Forms.Panel panel3; + private WinFormControl.NButton zeroBtn; + private System.Windows.Forms.DataGridViewTextBoxColumn R_C1; + private System.Windows.Forms.DataGridViewTextBoxColumn R_C2; + private System.Windows.Forms.DataGridViewTextBoxColumn R_C3; + private System.Windows.Forms.DataGridViewTextBoxColumn R_C4; + private System.Windows.Forms.DataGridViewTextBoxColumn R_C5; + private System.Windows.Forms.TextBox datePicker; + private WinFormControl.ULabel uLabel1; + private WinFormControl.NButton queryBtn; + private System.Windows.Forms.DataGridViewTextBoxColumn L_ID; + private System.Windows.Forms.DataGridViewTextBoxColumn L_ConfirmState; + private System.Windows.Forms.DataGridViewTextBoxColumn L_Order; + private System.Windows.Forms.DataGridViewTextBoxColumn L_PlanNumber; + private System.Windows.Forms.DataGridViewTextBoxColumn L_LiveColonyHouse_Name; + private System.Windows.Forms.DataGridViewTextBoxColumn L_AlreadyNumber; + private System.Windows.Forms.DataGridViewButtonColumn L_Start; + private System.Windows.Forms.DataGridViewButtonColumn L_End; + private WinFormControl.ULabel uLabel4; + private WinFormControl.ULabel orderLbl; + } +} \ No newline at end of file diff --git a/ButcherManage.Form/PickOutConfirm_/PickOutConfirm.cs b/ButcherManage.Form/PickOutConfirm_/PickOutConfirm.cs new file mode 100644 index 0000000..5c7a1d4 --- /dev/null +++ b/ButcherManage.Form/PickOutConfirm_/PickOutConfirm.cs @@ -0,0 +1,276 @@ +using ButcherManage.BO; +using ButcherManage.BO.Enums; +using ButcherManage.BO.LocalBL; +using ButcherManage.BO.Utils; +using ButcherManage.Dialogs; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading; +using System.Windows.Forms; +using WinFormControl; + +namespace ButcherManage.PickOutConfirm_ +{ + public partial class PickOutConfirm : Form, IWithRoleForm + { + #region IWithRoleForm + public List RoleName + { + get { return new List { (short)设备类别.赶猪确认 }; } + } + + public Form Generate() + { + return this; + } + #endregion + + IList list; + List records; + long lastID = 0; + DateTime date = DateTime.Today; + bool start = false; + long startID = 0; + + public PickOutConfirm() + { + InitializeComponent(); + this.FormClosing += (sender, e) => + { + if (start) + { + e.Cancel = MessageBox.Show("有开始状态的作业,确定退出?", "请确认", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) != DialogResult.OK; + } + }; + } + + protected override void OnLoad(EventArgs e) + { + base.OnLoad(e); + datePicker.Text = date.ToString("yyyy-MM-dd"); + BindGrid(); + FillNumberPad(); + if (list.Any()) + { + var tag = list.FirstOrDefault(x => x.ConfirmState == 1); + if (tag != null) + { + start = list.First().ConfirmState == 1; + startID = list.First().ID; + lastID = startID; + orderLbl.Text = tag.Order.ToString(); + } + RefreshRecordGrid(list.First().ID); + } + } + + void RefreshRecordGrid(long id) + { + lastID = id; + records = PickOutConfirmBL.GetRecordList(lastID); + var row = records.Count % 5; + if (records.Count % 5 == 0) + { + records.Add(new PickOutRecord() { Order_ID = lastID }); + row = 0; + } + BindRecorGrid(); + BindLabel(); + recordGrid.Rows[records.Count / 5].Cells[row].Selected = true; + } + + void BindLabel() + { + countLbl.Text = records.Where(x => x.Number > 0).Count().ToString(); + numberLbl.Text = records.Sum(x => x.Number).ToString(); + } + + private void BindGrid() + { + list = PickOutConfirmBL.GetDmoList(date).OrderBy(x => x.Order).OrderByDescending(x => x.ConfirmState).ToList(); + orderGrid.DataSource = list; + + foreach (DataGridViewRow row in orderGrid.Rows) + { + var v = (int)row.Cells["L_ConfirmState"].Value; + if (v == 1) + { + row.Cells[6] = new DataGridViewTextBoxCell(); + } + else if (v == -1 || list.Any(x => x.ConfirmState == 1)) + { + row.Cells[6] = new DataGridViewTextBoxCell(); + row.Cells[7] = new DataGridViewTextBoxCell(); + } + } + orderGrid.Refresh(); + } + + private void FillNumberPad() + { + for (var i = 1; i < 10; i++) + CreateBtn(i.ToString()); + } + + void CreateBtn(string content) + { + var btn = new NButton() { Width = 100, Height = 60, Text = content, Font = new Font("宋体", 15), Margin = new Padding(18, 10, 18, 20), PlaySound = true }; + btn.Click += NumberBtnClick; + numPad.Controls.Add(btn); + } + + private void NumberBtnClick(object sender, EventArgs e) + { + if (!start) + { + NMessageBox.ShowDialog("请先开始"); + return; + } + else if (lastID != startID) + { + NMessageBox.ShowDialog("当前作业与选择的记录不一致"); + return; + } + var number = int.Parse((sender as NButton).Text); + var cell = recordGrid.CurrentCell; + if (cell.Value == null && number == 0) + return; + var idx = cell.RowIndex * 5 + cell.ColumnIndex; + var detail = new PickOutRecord(); + if (idx > records.Count - 1) + { + if (cell.RowIndex != records.Count / 5 || cell.ColumnIndex != records.Count % 5) + cell = recordGrid.Rows[records.Count / 5].Cells[records.Count % 5]; + detail.Order_ID = lastID; + detail.Number = number; + records.Add(detail); + } + else + { + detail = records[idx]; + detail.Number = number; + } + PickOutConfirmBL.SaveRecord(detail); + cell.Value = number; + var row = records.Count % 5; + if (records[records.Count - 1].Number == null) + row -= 1; + if (records.Count % 5 == 0) + { + records.Add(new PickOutRecord() { Order_ID = lastID }); + row = 0; + BindRecorGrid(); + } + recordGrid.Rows[records.Count / 5].Cells[row].Selected = true; + BindLabel(); + orderGrid.CurrentRow.Cells["L_AlreadyNumber"].Value = records.Sum(x => x.Number ?? 0); + } + + void BindRecorGrid() + { + recordGrid.DataSource = Expand.Build(records); + recordGrid.Refresh(); + } + + private void colseBtn_Click(object sender, EventArgs e) + { + Close(); + } + + private void orderGrid_CellClick(object sender, DataGridViewCellEventArgs e) + { + var id = (long)orderGrid.CurrentRow.Cells[0].Value; + if (id == lastID) + return; + RefreshRecordGrid(id); + } + + private void orderGrid_CellContentClick(object sender, DataGridViewCellEventArgs e) + { + if (e.ColumnIndex < 6 || e.RowIndex == -1) + return; + if (e.ColumnIndex == 6)//开始 + { + PickOutConfirmBL.ChangeState(lastID, 1); + start = true; + startID = lastID; + orderLbl.Text = orderGrid.CurrentRow.Cells["L_Order"].Value.ToString(); + } + else//结束 + { + PickOutConfirmBL.ChangeState(lastID, -1); + start = false; + startID = 0; + orderLbl.Text = "0"; + } + BindGrid(); + } + + private void datePicker_MouseDown(object sender, MouseEventArgs e) + { + var cs = new CalendarSelecter(); + if (cs.ShowDialog() == true) + { + date = cs.Result; + datePicker.Text = date.ToString("yyyy-MM-dd"); + } + } + + private void queryBtn_Click(object sender, EventArgs e) + { + if (start) + { + NMessageBox.ShowDialog("有开始状态的作业,请结束后再尝试"); + return; + } + BindGrid(); + } + + private void orderGrid_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e) + { + DataGridViewRow dgrSingle = orderGrid.Rows[e.RowIndex]; + var v = (int)dgrSingle.Cells["L_ConfirmState"].Value; + if (v == 1) + dgrSingle.DefaultCellStyle.BackColor = Color.LightBlue; + else if (v == -1) + dgrSingle.DefaultCellStyle.BackColor = Color.YellowGreen; + } + } + + class Expand + { + public int? Number1 { get; set; } + + public int? Number2 { get; set; } + + public int? Number3 { get; set; } + + public int? Number4 { get; set; } + + public int? Number5 { get; set; } + + public static List Build(List list) + { + var result = new List(); + var t = typeof(Expand); + for (var i = 0; i < list.Count; ) + { + var entity = new Expand(); + result.Add(entity); + for (var j = 1; j <= 5; j++) + { + t.GetProperty(string.Format("Number{0}", j)).SetValue(entity, list[i].Number); + i++; + if (i == list.Count) + break; + } + } + return result; + } + } +} diff --git a/ButcherManage.Form/PickOutConfirm_/PickOutConfirm.resx b/ButcherManage.Form/PickOutConfirm_/PickOutConfirm.resx new file mode 100644 index 0000000..9e81854 --- /dev/null +++ b/ButcherManage.Form/PickOutConfirm_/PickOutConfirm.resx @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + \ No newline at end of file diff --git a/ButcherManage.Form/Properties/AssemblyInfo.cs b/ButcherManage.Form/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..a42a74e --- /dev/null +++ b/ButcherManage.Form/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的常规信息通过以下 +// 特性集控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("ButcherManage.Form")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ButcherManage.Form")] +[assembly: AssemblyCopyright("Copyright © 2018")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 使此程序集中的类型 +// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, +// 则将该类型上的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("7d0ed13b-6e5f-48d9-9e0d-93ae40bfadb7")] + +// 程序集的版本信息由下面四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, +// 方法是按如下所示使用“*”: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/ButcherManage.Install/ButcherManage.Install.vdproj b/ButcherManage.Install/ButcherManage.Install.vdproj new file mode 100644 index 0000000..c40a088 --- /dev/null +++ b/ButcherManage.Install/ButcherManage.Install.vdproj @@ -0,0 +1,1571 @@ +"DeployProject" +{ +"VSVersion" = "3:800" +"ProjectType" = "8:{978C614F-708E-4E1A-B201-565925725DBA}" +"IsWebType" = "8:FALSE" +"ProjectName" = "8:ButcherManage.Install" +"LanguageId" = "3:2052" +"CodePage" = "3:936" +"UILanguageId" = "3:2052" +"SccProjectName" = "8:" +"SccLocalPath" = "8:" +"SccAuxPath" = "8:" +"SccProvider" = "8:" + "Hierarchy" + { + "Entry" + { + "MsmKey" = "8:_016589AB0E7540EABFB6B761F909557A" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_2A3E85F8471A4F88807B2908CC15C3C1" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_2BF5AE3EC26D4C389A9F4B4CC9C312FF" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_312DACC8EE84ACAE70D28F41B8C0D16B" + "OwnerKey" = "8:_2A3E85F8471A4F88807B2908CC15C3C1" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_5A1C6AEF5FE125A666A14760B70B82C8" + "OwnerKey" = "8:_EDF750E896A39C8DD89E2B6D8E7203D9" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_5A1C6AEF5FE125A666A14760B70B82C8" + "OwnerKey" = "8:_312DACC8EE84ACAE70D28F41B8C0D16B" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_5A1C6AEF5FE125A666A14760B70B82C8" + "OwnerKey" = "8:_C7A4AFBFFDED3AC89C6FDE5275B1A673" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_5A1C6AEF5FE125A666A14760B70B82C8" + "OwnerKey" = "8:_74E061C838A5494DBDCB63B3378853D9" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_69ED0D1617334217BD38E4759E2708F9" + "OwnerKey" = "8:_AE8C35C8F09B5BC188C1210834642255" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_69ED0D1617334217BD38E4759E2708F9" + "OwnerKey" = "8:_74E061C838A5494DBDCB63B3378853D9" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_6F83ED3DCABA42580834E9042F5B7A86" + "OwnerKey" = "8:_AE8C35C8F09B5BC188C1210834642255" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_6F83ED3DCABA42580834E9042F5B7A86" + "OwnerKey" = "8:_74E061C838A5494DBDCB63B3378853D9" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_6F83ED3DCABA42580834E9042F5B7A86" + "OwnerKey" = "8:_8E1E8DA4D3CF0C7441173FC590AC80B3" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_74E061C838A5494DBDCB63B3378853D9" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_85793BACF768A05C98AD960E6E7EA78F" + "OwnerKey" = "8:_2A3E85F8471A4F88807B2908CC15C3C1" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_8E1E8DA4D3CF0C7441173FC590AC80B3" + "OwnerKey" = "8:_AE8C35C8F09B5BC188C1210834642255" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_8E1E8DA4D3CF0C7441173FC590AC80B3" + "OwnerKey" = "8:_74E061C838A5494DBDCB63B3378853D9" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_A811531E892E4EA89D3F2AB473AA0955" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_AE8C35C8F09B5BC188C1210834642255" + "OwnerKey" = "8:_EDF750E896A39C8DD89E2B6D8E7203D9" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_AE8C35C8F09B5BC188C1210834642255" + "OwnerKey" = "8:_312DACC8EE84ACAE70D28F41B8C0D16B" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_AE8C35C8F09B5BC188C1210834642255" + "OwnerKey" = "8:_C7A4AFBFFDED3AC89C6FDE5275B1A673" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_AE8C35C8F09B5BC188C1210834642255" + "OwnerKey" = "8:_74E061C838A5494DBDCB63B3378853D9" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_C39EA631A14848A7AB3D5D10BE915F1F" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_C7A4AFBFFDED3AC89C6FDE5275B1A673" + "OwnerKey" = "8:_2BF5AE3EC26D4C389A9F4B4CC9C312FF" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_EDF750E896A39C8DD89E2B6D8E7203D9" + "OwnerKey" = "8:_74E061C838A5494DBDCB63B3378853D9" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_F1C7F0916944A2448DCC3C56D0908B51" + "OwnerKey" = "8:_AE8C35C8F09B5BC188C1210834642255" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_F1C7F0916944A2448DCC3C56D0908B51" + "OwnerKey" = "8:_312DACC8EE84ACAE70D28F41B8C0D16B" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_F1C7F0916944A2448DCC3C56D0908B51" + "OwnerKey" = "8:_C7A4AFBFFDED3AC89C6FDE5275B1A673" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_F1C7F0916944A2448DCC3C56D0908B51" + "OwnerKey" = "8:_74E061C838A5494DBDCB63B3378853D9" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_F1C7F0916944A2448DCC3C56D0908B51" + "OwnerKey" = "8:_EDF750E896A39C8DD89E2B6D8E7203D9" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_F212E01AE6240FD28AC5668014EBFAF3" + "OwnerKey" = "8:_74E061C838A5494DBDCB63B3378853D9" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_FF6E3C56B18B460A1EA89B2CA0193DED" + "OwnerKey" = "8:_2BF5AE3EC26D4C389A9F4B4CC9C312FF" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_69ED0D1617334217BD38E4759E2708F9" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_2A3E85F8471A4F88807B2908CC15C3C1" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_85793BACF768A05C98AD960E6E7EA78F" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_312DACC8EE84ACAE70D28F41B8C0D16B" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_2BF5AE3EC26D4C389A9F4B4CC9C312FF" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_FF6E3C56B18B460A1EA89B2CA0193DED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_C7A4AFBFFDED3AC89C6FDE5275B1A673" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_74E061C838A5494DBDCB63B3378853D9" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_F212E01AE6240FD28AC5668014EBFAF3" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_EDF750E896A39C8DD89E2B6D8E7203D9" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_5A1C6AEF5FE125A666A14760B70B82C8" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_AE8C35C8F09B5BC188C1210834642255" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_8E1E8DA4D3CF0C7441173FC590AC80B3" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_6F83ED3DCABA42580834E9042F5B7A86" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_UNDEFINED" + "OwnerKey" = "8:_F1C7F0916944A2448DCC3C56D0908B51" + "MsmSig" = "8:_UNDEFINED" + } + } + "Configurations" + { + "Debug" + { + "DisplayName" = "8:Debug" + "IsDebugOnly" = "11:TRUE" + "IsReleaseOnly" = "11:FALSE" + "OutputFilename" = "8:Debug\\ButcherManage.Install.msi" + "PackageFilesAs" = "3:2" + "PackageFileSize" = "3:-2147483648" + "CabType" = "3:1" + "Compression" = "3:2" + "SignOutput" = "11:FALSE" + "CertificateFile" = "8:" + "PrivateKeyFile" = "8:" + "TimeStampServer" = "8:" + "InstallerBootstrapper" = "3:2" + "BootstrapperCfg:{63ACBE69-63AA-4F98-B2B6-99F9E24495F2}" + { + "Enabled" = "11:TRUE" + "PromptEnabled" = "11:TRUE" + "PrerequisitesLocation" = "2:1" + "Url" = "8:" + "ComponentsUrl" = "8:" + } + } + "Release" + { + "DisplayName" = "8:Release" + "IsDebugOnly" = "11:FALSE" + "IsReleaseOnly" = "11:TRUE" + "OutputFilename" = "8:Release\\ButcherManage.Install.msi" + "PackageFilesAs" = "3:2" + "PackageFileSize" = "3:-2147483648" + "CabType" = "3:1" + "Compression" = "3:2" + "SignOutput" = "11:FALSE" + "CertificateFile" = "8:" + "PrivateKeyFile" = "8:" + "TimeStampServer" = "8:" + "InstallerBootstrapper" = "3:2" + "BootstrapperCfg:{63ACBE69-63AA-4F98-B2B6-99F9E24495F2}" + { + "Enabled" = "11:TRUE" + "PromptEnabled" = "11:TRUE" + "PrerequisitesLocation" = "2:1" + "Url" = "8:" + "ComponentsUrl" = "8:" + } + } + } + "Deployable" + { + "CustomAction" + { + } + "DefaultFeature" + { + "Name" = "8:DefaultFeature" + "Title" = "8:" + "Description" = "8:" + } + "ExternalPersistence" + { + "LaunchCondition" + { + "{A06ECF26-33A3-4562-8140-9B0E340D4F24}:_F0CE441F1E1D48558C0FD21FF69D9D6F" + { + "Name" = "8:.NET Framework" + "Message" = "8:[VSDNETMSG]" + "FrameworkVersion" = "8:.NETFramework,Version=v4.5" + "AllowLaterVersions" = "11:FALSE" + "InstallUrl" = "8:http://go.microsoft.com/fwlink/?LinkId=395269" + } + } + } + "File" + { + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_016589AB0E7540EABFB6B761F909557A" + { + "SourcePath" = "8:C:\\Users\\Administrator\\Pictures\\app.ico" + "TargetName" = "8:app.ico" + "Tag" = "8:" + "Folder" = "8:_4D4F2E4AC2FD4315BE224043E0B1A0E1" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_2A3E85F8471A4F88807B2908CC15C3C1" + { + "AssemblyRegister" = "3:1" + "AssemblyIsInGAC" = "11:FALSE" + "AssemblyAsmDisplayName" = "8:ButcherManage.Tools, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" + "ScatterAssemblies" + { + "_2A3E85F8471A4F88807B2908CC15C3C1" + { + "Name" = "8:ButcherManage.Tools.exe" + "Attributes" = "3:512" + } + } + "SourcePath" = "8:..\\ButcherManage.Tools\\bin\\Release\\ButcherManage.Tools.exe" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_4D4F2E4AC2FD4315BE224043E0B1A0E1" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_2BF5AE3EC26D4C389A9F4B4CC9C312FF" + { + "AssemblyRegister" = "3:1" + "AssemblyIsInGAC" = "11:FALSE" + "AssemblyAsmDisplayName" = "8:ButcherManage.Form, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" + "ScatterAssemblies" + { + "_2BF5AE3EC26D4C389A9F4B4CC9C312FF" + { + "Name" = "8:ButcherManage.Form.dll" + "Attributes" = "3:512" + } + } + "SourcePath" = "8:..\\ButcherManage.Form\\bin\\Release\\ButcherManage.Form.dll" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_4D4F2E4AC2FD4315BE224043E0B1A0E1" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_312DACC8EE84ACAE70D28F41B8C0D16B" + { + "AssemblyRegister" = "3:1" + "AssemblyIsInGAC" = "11:FALSE" + "AssemblyAsmDisplayName" = "8:ButcherManage.BO, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" + "ScatterAssemblies" + { + "_312DACC8EE84ACAE70D28F41B8C0D16B" + { + "Name" = "8:ButcherManage.BO.DLL" + "Attributes" = "3:512" + } + } + "SourcePath" = "8:ButcherManage.BO.DLL" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_4D4F2E4AC2FD4315BE224043E0B1A0E1" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_5A1C6AEF5FE125A666A14760B70B82C8" + { + "AssemblyRegister" = "3:1" + "AssemblyIsInGAC" = "11:FALSE" + "AssemblyAsmDisplayName" = "8:Newtonsoft.Json, Version=4.0.3.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL" + "ScatterAssemblies" + { + "_5A1C6AEF5FE125A666A14760B70B82C8" + { + "Name" = "8:Newtonsoft.Json.dll" + "Attributes" = "3:512" + } + } + "SourcePath" = "8:Newtonsoft.Json.dll" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_4D4F2E4AC2FD4315BE224043E0B1A0E1" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_69ED0D1617334217BD38E4759E2708F9" + { + "AssemblyRegister" = "3:1" + "AssemblyIsInGAC" = "11:FALSE" + "AssemblyAsmDisplayName" = "8:Forks.Json, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7254430f49d10aae, processorArchitecture=MSIL" + "ScatterAssemblies" + { + "_69ED0D1617334217BD38E4759E2708F9" + { + "Name" = "8:Forks.Json.dll" + "Attributes" = "3:512" + } + } + "SourcePath" = "8:Forks.Json.dll" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_4D4F2E4AC2FD4315BE224043E0B1A0E1" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_6F83ED3DCABA42580834E9042F5B7A86" + { + "AssemblyRegister" = "3:1" + "AssemblyIsInGAC" = "11:FALSE" + "AssemblyAsmDisplayName" = "8:MongoDB.Bson, Version=1.4.0.4468, Culture=neutral, PublicKeyToken=f686731cfb9cc103, processorArchitecture=MSIL" + "ScatterAssemblies" + { + "_6F83ED3DCABA42580834E9042F5B7A86" + { + "Name" = "8:MongoDB.Bson.dll" + "Attributes" = "3:512" + } + } + "SourcePath" = "8:MongoDB.Bson.dll" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_4D4F2E4AC2FD4315BE224043E0B1A0E1" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_85793BACF768A05C98AD960E6E7EA78F" + { + "AssemblyRegister" = "3:1" + "AssemblyIsInGAC" = "11:FALSE" + "AssemblyAsmDisplayName" = "8:WinFormControl, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" + "ScatterAssemblies" + { + "_85793BACF768A05C98AD960E6E7EA78F" + { + "Name" = "8:WinFormControl.DLL" + "Attributes" = "3:512" + } + } + "SourcePath" = "8:WinFormControl.DLL" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_4D4F2E4AC2FD4315BE224043E0B1A0E1" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_8E1E8DA4D3CF0C7441173FC590AC80B3" + { + "AssemblyRegister" = "3:1" + "AssemblyIsInGAC" = "11:FALSE" + "AssemblyAsmDisplayName" = "8:MongoDB.Driver, Version=1.4.0.4468, Culture=neutral, PublicKeyToken=f686731cfb9cc103, processorArchitecture=MSIL" + "ScatterAssemblies" + { + "_8E1E8DA4D3CF0C7441173FC590AC80B3" + { + "Name" = "8:MongoDB.Driver.dll" + "Attributes" = "3:512" + } + } + "SourcePath" = "8:MongoDB.Driver.dll" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_4D4F2E4AC2FD4315BE224043E0B1A0E1" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_A811531E892E4EA89D3F2AB473AA0955" + { + "SourcePath" = "8:..\\ButcherManage.Login\\bin\\Debug\\Config\\ServerUrlConfig.xml" + "TargetName" = "8:ServerUrlConfig.xml" + "Tag" = "8:" + "Folder" = "8:_489D4BDF56F64B5B91C664C240BC829A" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_AE8C35C8F09B5BC188C1210834642255" + { + "AssemblyRegister" = "3:1" + "AssemblyIsInGAC" = "11:FALSE" + "AssemblyAsmDisplayName" = "8:Forks.EnterpriseServices, Version=3.1.0.0, Culture=neutral, PublicKeyToken=7254430f49d10aae, processorArchitecture=MSIL" + "ScatterAssemblies" + { + "_AE8C35C8F09B5BC188C1210834642255" + { + "Name" = "8:Forks.EnterpriseServices.dll" + "Attributes" = "3:512" + } + } + "SourcePath" = "8:Forks.EnterpriseServices.dll" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_4D4F2E4AC2FD4315BE224043E0B1A0E1" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_C39EA631A14848A7AB3D5D10BE915F1F" + { + "SourcePath" = "8:..\\ButcherManage.Login\\bin\\Debug\\Config\\DbSelectList.xml" + "TargetName" = "8:DbSelectList.xml" + "Tag" = "8:" + "Folder" = "8:_489D4BDF56F64B5B91C664C240BC829A" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_C7A4AFBFFDED3AC89C6FDE5275B1A673" + { + "AssemblyRegister" = "3:1" + "AssemblyIsInGAC" = "11:FALSE" + "AssemblyAsmDisplayName" = "8:ButcherManage.BO, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" + "ScatterAssemblies" + { + "_C7A4AFBFFDED3AC89C6FDE5275B1A673" + { + "Name" = "8:ButcherManage.BO.DLL" + "Attributes" = "3:512" + } + } + "SourcePath" = "8:ButcherManage.BO.DLL" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_4D4F2E4AC2FD4315BE224043E0B1A0E1" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_EDF750E896A39C8DD89E2B6D8E7203D9" + { + "AssemblyRegister" = "3:1" + "AssemblyIsInGAC" = "11:FALSE" + "AssemblyAsmDisplayName" = "8:ButcherManage.BO, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" + "ScatterAssemblies" + { + "_EDF750E896A39C8DD89E2B6D8E7203D9" + { + "Name" = "8:ButcherManage.BO.dll" + "Attributes" = "3:512" + } + } + "SourcePath" = "8:ButcherManage.BO.dll" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_4D4F2E4AC2FD4315BE224043E0B1A0E1" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_F1C7F0916944A2448DCC3C56D0908B51" + { + "AssemblyRegister" = "3:1" + "AssemblyIsInGAC" = "11:FALSE" + "AssemblyAsmDisplayName" = "8:Forks.Utils, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7254430f49d10aae, processorArchitecture=MSIL" + "ScatterAssemblies" + { + "_F1C7F0916944A2448DCC3C56D0908B51" + { + "Name" = "8:Forks.Utils.dll" + "Attributes" = "3:512" + } + } + "SourcePath" = "8:Forks.Utils.dll" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_4D4F2E4AC2FD4315BE224043E0B1A0E1" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_F212E01AE6240FD28AC5668014EBFAF3" + { + "AssemblyRegister" = "3:1" + "AssemblyIsInGAC" = "11:FALSE" + "AssemblyAsmDisplayName" = "8:WinFormControl, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" + "ScatterAssemblies" + { + "_F212E01AE6240FD28AC5668014EBFAF3" + { + "Name" = "8:WinFormControl.dll" + "Attributes" = "3:512" + } + } + "SourcePath" = "8:WinFormControl.dll" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_4D4F2E4AC2FD4315BE224043E0B1A0E1" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_FF6E3C56B18B460A1EA89B2CA0193DED" + { + "AssemblyRegister" = "3:1" + "AssemblyIsInGAC" = "11:FALSE" + "AssemblyAsmDisplayName" = "8:WinFormControl, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" + "ScatterAssemblies" + { + "_FF6E3C56B18B460A1EA89B2CA0193DED" + { + "Name" = "8:WinFormControl.DLL" + "Attributes" = "3:512" + } + } + "SourcePath" = "8:WinFormControl.DLL" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_4D4F2E4AC2FD4315BE224043E0B1A0E1" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + } + "FileType" + { + } + "Folder" + { + "{1525181F-901A-416C-8A58-119130FE478E}:_1C26A8AFB09E41928FFDDBA6628AA680" + { + "Name" = "8:#1919" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:ProgramMenuFolder" + "Folders" + { + "{9EF0B969-E518-4E46-987F-47570745A589}:_EB313B451E8A4610A7504811DA894FF1" + { + "Name" = "8:青花瓷屠宰场管理" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:_80D2293499774CC68E537143E83C2503" + "Folders" + { + } + } + } + } + "{3C67513D-01DD-4637-8A68-80971EB9504F}:_4D4F2E4AC2FD4315BE224043E0B1A0E1" + { + "DefaultLocation" = "8:[ProgramFilesFolder]\\BWP\\ButcherManageSolution" + "Name" = "8:#1925" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:TARGETDIR" + "Folders" + { + "{9EF0B969-E518-4E46-987F-47570745A589}:_489D4BDF56F64B5B91C664C240BC829A" + { + "Name" = "8:Config" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:_F3E1640FB1AD49098F6410B972135D24" + "Folders" + { + } + } + "{9EF0B969-E518-4E46-987F-47570745A589}:_54D45B3ABA31488BB93FCC0DE2C4549C" + { + "Name" = "8:Sounds" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:_4C41F00F2E8E4B4F92969EFEC9CC8AE2" + "Folders" + { + } + } + "{9EF0B969-E518-4E46-987F-47570745A589}:_77EADBE0B9E04134BCE2F673C0FF0C33" + { + "Name" = "8:images" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:_05A0BB729FC84486856A2EB6DE281031" + "Folders" + { + } + } + "{9EF0B969-E518-4E46-987F-47570745A589}:_B50B71D959A0456FBC0C5877EB9474C4" + { + "Name" = "8:PrintTemplate" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:_B561D8CF39E34D5DAB4253EFD47A9707" + "Folders" + { + } + } + "{9EF0B969-E518-4E46-987F-47570745A589}:_BFAAE8AF79D9493995330DE7D6C9CD2F" + { + "Name" = "8:TempImg" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:_E728A413B21041EAA57DA038CBC0FD69" + "Folders" + { + } + } + } + } + "{1525181F-901A-416C-8A58-119130FE478E}:_D8874926DCD84954AB3898B7FAC78954" + { + "Name" = "8:#1916" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:DesktopFolder" + "Folders" + { + } + } + } + "LaunchCondition" + { + } + "Locator" + { + } + "MsiBootstrapper" + { + "LangId" = "3:2052" + "RequiresElevation" = "11:FALSE" + } + "Product" + { + "Name" = "8:Microsoft Visual Studio" + "ProductName" = "8:青花瓷屠宰场管理" + "ProductCode" = "8:{797DF02B-53CC-4040-BB58-8C07D8A948DE}" + "PackageCode" = "8:{024BA567-DFCC-4E04-9883-E1781D794A38}" + "UpgradeCode" = "8:{305D5204-187C-42B4-B273-882F99FFC6AF}" + "AspNetVersion" = "8:4.0.30319.0" + "RestartWWWService" = "11:FALSE" + "RemovePreviousVersions" = "11:TRUE" + "DetectNewerInstalledVersion" = "11:TRUE" + "InstallAllUsers" = "11:TRUE" + "ProductVersion" = "8:1.0.0" + "Manufacturer" = "8:青花瓷软件(北京)有限公司" + "ARPHELPTELEPHONE" = "8:010-62701591" + "ARPHELPLINK" = "8:http://www.bwpsoft.com" + "Title" = "8:青花瓷屠宰车间管理" + "Subject" = "8:自动化" + "ARPCONTACT" = "8:青花瓷软件(北京)有限公司" + "Keywords" = "8:青花瓷" + "ARPCOMMENTS" = "8:青花瓷屠宰场管理系统" + "ARPURLINFOABOUT" = "8:http://www.bwpsoft.com" + "ARPPRODUCTICON" = "8:" + "ARPIconIndex" = "3:0" + "SearchPath" = "8:" + "UseSystemSearchPath" = "11:TRUE" + "TargetPlatform" = "3:0" + "PreBuildEvent" = "8:" + "PostBuildEvent" = "8:" + "RunPostBuildEvent" = "3:0" + } + "Registry" + { + "HKLM" + { + "Keys" + { + "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_E50CCD86967648E4B5479DCCBD916218" + { + "Name" = "8:Software" + "Condition" = "8:" + "AlwaysCreate" = "11:FALSE" + "DeleteAtUninstall" = "11:FALSE" + "Transitive" = "11:FALSE" + "Keys" + { + "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_1EC682FC48D14F87BEFC0721DF4D2AAF" + { + "Name" = "8:[Manufacturer]" + "Condition" = "8:" + "AlwaysCreate" = "11:FALSE" + "DeleteAtUninstall" = "11:FALSE" + "Transitive" = "11:FALSE" + "Keys" + { + } + "Values" + { + } + } + } + "Values" + { + } + } + } + } + "HKCU" + { + "Keys" + { + "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_026E50E60CAD4A8C93BADDF6CA9D265F" + { + "Name" = "8:Software" + "Condition" = "8:" + "AlwaysCreate" = "11:FALSE" + "DeleteAtUninstall" = "11:FALSE" + "Transitive" = "11:FALSE" + "Keys" + { + "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_C0A91F83E8A044B2AF81AEC352AE44D1" + { + "Name" = "8:[Manufacturer]" + "Condition" = "8:" + "AlwaysCreate" = "11:FALSE" + "DeleteAtUninstall" = "11:FALSE" + "Transitive" = "11:FALSE" + "Keys" + { + } + "Values" + { + } + } + } + "Values" + { + } + } + } + } + "HKCR" + { + "Keys" + { + } + } + "HKU" + { + "Keys" + { + } + } + "HKPU" + { + "Keys" + { + } + } + } + "Sequences" + { + } + "Shortcut" + { + "{970C0BB2-C7D0-45D7-ABFA-7EC378858BC0}:_76411369735E4FD999B621CF42E16981" + { + "Name" = "8:青花瓷屠宰场管理" + "Arguments" = "8:" + "Description" = "8:" + "ShowCmd" = "3:1" + "IconIndex" = "3:0" + "Transitive" = "11:FALSE" + "Target" = "8:_74E061C838A5494DBDCB63B3378853D9" + "Folder" = "8:_D8874926DCD84954AB3898B7FAC78954" + "WorkingFolder" = "8:_4D4F2E4AC2FD4315BE224043E0B1A0E1" + "Icon" = "8:_016589AB0E7540EABFB6B761F909557A" + "Feature" = "8:" + } + "{970C0BB2-C7D0-45D7-ABFA-7EC378858BC0}:_B679D04A1A9146B892887E60B737D225" + { + "Name" = "8:青花瓷屠宰场管理" + "Arguments" = "8:" + "Description" = "8:" + "ShowCmd" = "3:1" + "IconIndex" = "3:0" + "Transitive" = "11:FALSE" + "Target" = "8:_74E061C838A5494DBDCB63B3378853D9" + "Folder" = "8:_EB313B451E8A4610A7504811DA894FF1" + "WorkingFolder" = "8:_4D4F2E4AC2FD4315BE224043E0B1A0E1" + "Icon" = "8:_016589AB0E7540EABFB6B761F909557A" + "Feature" = "8:" + } + } + "UserInterface" + { + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_0C8E2E5AFBC74CD4A9D7F0C38FD312F4" + { + "Name" = "8:#1902" + "Sequence" = "3:1" + "Attributes" = "3:3" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_532322875CD940488E55A2E0B5049929" + { + "Sequence" = "3:100" + "DisplayName" = "8:已完成" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdFinishedDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "UpdateText" + { + "Name" = "8:UpdateText" + "DisplayName" = "8:#1058" + "Description" = "8:#1158" + "Type" = "3:15" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:1" + "Value" = "8:#1258" + "DefaultValue" = "8:#1258" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_337EB8957F9B4C3DA21BCB64ADA9D6CC" + { + "Name" = "8:#1900" + "Sequence" = "3:1" + "Attributes" = "3:1" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_4A6B59D3DE024740AAA135E956A2C0AB" + { + "Sequence" = "3:100" + "DisplayName" = "8:欢迎使用" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdWelcomeDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "CopyrightWarning" + { + "Name" = "8:CopyrightWarning" + "DisplayName" = "8:#1002" + "Description" = "8:#1102" + "Type" = "3:3" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:1" + "Value" = "8:#1202" + "DefaultValue" = "8:#1202" + "UsePlugInResources" = "11:TRUE" + } + "Welcome" + { + "Name" = "8:Welcome" + "DisplayName" = "8:#1003" + "Description" = "8:#1103" + "Type" = "3:3" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:1" + "Value" = "8:#1203" + "DefaultValue" = "8:#1203" + "UsePlugInResources" = "11:TRUE" + } + } + } + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_4A9353F5DC164E2685060715B242BC9A" + { + "Sequence" = "3:200" + "DisplayName" = "8:安装文件夹" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdFolderDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "InstallAllUsersVisible" + { + "Name" = "8:InstallAllUsersVisible" + "DisplayName" = "8:#1059" + "Description" = "8:#1159" + "Type" = "3:5" + "ContextData" = "8:1;True=1;False=0" + "Attributes" = "3:0" + "Setting" = "3:0" + "Value" = "3:1" + "DefaultValue" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_DF8B7DCF5C914054977559418B4CF2BF" + { + "Sequence" = "3:300" + "DisplayName" = "8:确认安装" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdConfirmDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{2479F3F5-0309-486D-8047-8187E2CE5BA0}:_34FE303913B84E8AA9824741C8B1076E" + { + "UseDynamicProperties" = "11:FALSE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdUserInterface.wim" + } + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_3E0BAA97C3D344B684A2A6ED5D8A37EA" + { + "Name" = "8:#1900" + "Sequence" = "3:2" + "Attributes" = "3:1" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_78701088E2F449A490EC3DF2A1B4A3B7" + { + "Sequence" = "3:200" + "DisplayName" = "8:安装文件夹" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminFolderDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_AA1EE928AC98423CAC0392896691854E" + { + "Sequence" = "3:100" + "DisplayName" = "8:欢迎使用" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminWelcomeDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "CopyrightWarning" + { + "Name" = "8:CopyrightWarning" + "DisplayName" = "8:#1002" + "Description" = "8:#1102" + "Type" = "3:3" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:1" + "Value" = "8:#1202" + "DefaultValue" = "8:#1202" + "UsePlugInResources" = "11:TRUE" + } + "Welcome" + { + "Name" = "8:Welcome" + "DisplayName" = "8:#1003" + "Description" = "8:#1103" + "Type" = "3:3" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:1" + "Value" = "8:#1203" + "DefaultValue" = "8:#1203" + "UsePlugInResources" = "11:TRUE" + } + } + } + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_CDCD10DA8D5449979890B25C4062389F" + { + "Sequence" = "3:300" + "DisplayName" = "8:确认安装" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminConfirmDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_73DB5FEB813B42B39A21C319988614B1" + { + "Name" = "8:#1901" + "Sequence" = "3:2" + "Attributes" = "3:2" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_CAB1B08CA44442C2BD27FFC25E7D6F6B" + { + "Sequence" = "3:100" + "DisplayName" = "8:进度" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminProgressDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "ShowProgress" + { + "Name" = "8:ShowProgress" + "DisplayName" = "8:#1009" + "Description" = "8:#1109" + "Type" = "3:5" + "ContextData" = "8:1;True=1;False=0" + "Attributes" = "3:0" + "Setting" = "3:0" + "Value" = "3:1" + "DefaultValue" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{2479F3F5-0309-486D-8047-8187E2CE5BA0}:_93BDED221CE04549ABE8941686C01EAE" + { + "UseDynamicProperties" = "11:FALSE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdBasicDialogs.wim" + } + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_958EF73A01B740BAB563D6920F2986A0" + { + "Name" = "8:#1901" + "Sequence" = "3:1" + "Attributes" = "3:2" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_CD7FDD4B6F3145B193280524AC2CB202" + { + "Sequence" = "3:100" + "DisplayName" = "8:进度" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdProgressDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "ShowProgress" + { + "Name" = "8:ShowProgress" + "DisplayName" = "8:#1009" + "Description" = "8:#1109" + "Type" = "3:5" + "ContextData" = "8:1;True=1;False=0" + "Attributes" = "3:0" + "Setting" = "3:0" + "Value" = "3:1" + "DefaultValue" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_B605DA29B8FD4995B1446AB6F5BA9A70" + { + "Name" = "8:#1902" + "Sequence" = "3:2" + "Attributes" = "3:3" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_DAAF3255DD9E493085064150AF86AF6D" + { + "Sequence" = "3:100" + "DisplayName" = "8:已完成" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminFinishedDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + } + "MergeModule" + { + } + "ProjectOutput" + { + "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_74E061C838A5494DBDCB63B3378853D9" + { + "SourcePath" = "8:..\\ButcherManage.Login\\obj\\Release\\ButcherManage.Login.exe" + "TargetName" = "8:" + "Tag" = "8:" + "Folder" = "8:_4D4F2E4AC2FD4315BE224043E0B1A0E1" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + "ProjectOutputGroupRegister" = "3:1" + "OutputConfiguration" = "8:" + "OutputGroupCanonicalName" = "8:Built" + "OutputProjectGuid" = "8:{AA93C97D-E13D-48C7-906F-92CEF2628547}" + "ShowKeyOutput" = "11:TRUE" + "ExcludeFilters" + { + } + } + } + } +} diff --git a/ButcherManage.Login/App.xaml b/ButcherManage.Login/App.xaml new file mode 100644 index 0000000..3d5e0a1 --- /dev/null +++ b/ButcherManage.Login/App.xaml @@ -0,0 +1,49 @@ + + + + + + + diff --git a/ButcherManage.Login/App.xaml.cs b/ButcherManage.Login/App.xaml.cs new file mode 100644 index 0000000..aac5029 --- /dev/null +++ b/ButcherManage.Login/App.xaml.cs @@ -0,0 +1,95 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using System.Windows; +using WinFormControl; + +namespace ButcherManage.Login +{ + /// + /// App.xaml 的交互逻辑 + /// + public partial class App : Application + { + public EventWaitHandle ProgramStarted { get; set; } + + readonly string[] FOLDERS = new string[] { "Config", "PrintTemplate", "Log", "TempImg" }; + + protected override void OnStartup(StartupEventArgs e) + { + bool createNew; + ProgramStarted = new EventWaitHandle(false, EventResetMode.AutoReset, "ButcherFactorySolution", out createNew); + + if (!createNew) + { + NMessageBox.ShowDialog(@"系统已经在运行中,如果要重新启动,请从进程中关闭..."); + App.Current.Shutdown(); + } + + System.Windows.Forms.Application.EnableVisualStyles(); + System.Windows.Forms.Application.SetUnhandledExceptionMode(System.Windows.Forms.UnhandledExceptionMode.CatchException); + System.Windows.Forms.Application.ThreadException += Application_ThreadException; + + RegisterEvents(); + base.OnStartup(e); + foreach (var folder in FOLDERS) + { + if (!System.IO.Directory.Exists(folder)) + System.IO.Directory.CreateDirectory(folder); + } + var tempImages = new System.IO.DirectoryInfo("TempImg").GetFiles(); + foreach (var f in tempImages) + f.Delete(); + } + + /// + /// 在发生未处理异常时处理的方法 + /// + /// + /// + private static void Application_ThreadException(object sender, ThreadExceptionEventArgs e) + { + var ex = e.Exception; + var err = String.Empty; + if (ex != null) + { + //LogUtil.WriteError(ex); + err = ex.Message; + } + SoundPalyUtil.PlaySound(SoundType.Error); + NMessageBox.ShowDialog("错误:" + ex.Message + " \n详细信息:" + ex.StackTrace); + // UMessageBox.Show("错误:" + err); + } + + private void RegisterEvents() + { + DispatcherUnhandledException += App_DispatcherUnhandledException; + + TaskScheduler.UnobservedTaskException += (sender, args) => + { + SoundPalyUtil.PlaySound(SoundType.Error); + + NMessageBox.ShowDialog("错误:" + args.Exception.Message + " \n详细信息:" + args.Exception.StackTrace); + args.SetObserved(); + }; + + AppDomain.CurrentDomain.UnhandledException += (sender, args) => + { + SoundPalyUtil.PlaySound(SoundType.Error); + NMessageBox.ShowDialog("Unhandled exception." + args.ExceptionObject); + }; + } + + + void App_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e) + { + SoundPalyUtil.PlaySound(SoundType.Error); + NMessageBox.ShowDialog("错误:" + e.Exception.Message + " \n详细信息:" + e.Exception.StackTrace); + e.Handled = true; + } + } +} diff --git a/ButcherManage.Login/ButcherManage.Login.csproj b/ButcherManage.Login/ButcherManage.Login.csproj new file mode 100644 index 0000000..4178001 --- /dev/null +++ b/ButcherManage.Login/ButcherManage.Login.csproj @@ -0,0 +1,119 @@ + + + + + Debug + AnyCPU + {AA93C97D-E13D-48C7-906F-92CEF2628547} + WinExe + Properties + ButcherManage.Login + ButcherManage.Login + v4.5 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + false + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + false + + + + + + + + + + + + 4.0 + + + + + + False + ..\..\..\tsref\Debug\WinFormControl.dll + + + + + MSBuild:Compile + Designer + + + App.xaml + Code + + + + + Login.xaml + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + + + + Designer + MSBuild:Compile + + + + + {b1ecbe2f-06fb-4e4c-9487-1497e0808c04} + ButcherManage.BO + + + + + \ No newline at end of file diff --git a/ButcherManage.Login/Images/login.png b/ButcherManage.Login/Images/login.png new file mode 100644 index 0000000..aefc251 Binary files /dev/null and b/ButcherManage.Login/Images/login.png differ diff --git a/ButcherManage.Login/Login.xaml b/ButcherManage.Login/Login.xaml new file mode 100644 index 0000000..cbedfe7 --- /dev/null +++ b/ButcherManage.Login/Login.xaml @@ -0,0 +1,38 @@ + + + + + + + + +