Program.cs 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. using OASystem.Domain.Entities.PersonnelModule;
  2. using SqlSugar;
  3. var db = new SqlSugarClient(new ConnectionConfig()
  4. {
  5. ConnectionString = "server=132.232.92.186;uid=sa;pwd=Yjx@158291;database=OA2023DB;",
  6. DbType = DbType.SqlServer,
  7. IsAutoCloseConnection = true,
  8. InitKeyType = InitKeyType.Attribute
  9. });
  10. #region Aop
  11. //db.Aop.OnLogExecuting = (sql, pars) =>
  12. //{
  13. // Console.WriteLine(sql + "" + Db.Utilities.SerializeObject
  14. // (pars.ToDictionary(it => it.ParameterName, it => it.Value)));
  15. // Console.WriteLine();
  16. //};
  17. #endregion
  18. #region 对话框
  19. Console.WriteLine("是否确定同步数据库表结构?(同名数据表将会被备份,生产环境慎用,回车确认)");
  20. var str = Console.ReadKey();
  21. if (str.Key == ConsoleKey.Enter)
  22. {
  23. Console.WriteLine("同步中,请稍后...");
  24. }
  25. else
  26. {
  27. Console.WriteLine("\r\n输入错误,已退出...");
  28. return;
  29. }
  30. #endregion
  31. //同步数据表结构
  32. db.DbMaintenance.CreateDatabase();
  33. db.CodeFirst.SetStringDefaultLength(50).BackupTable().InitTables(new Type[]
  34. {
  35. //typeof(Sys_PageFunctionPermission)
  36. //,typeof(Sys_SystemMenuAndFunction)
  37. //,typeof(Sys_SystemMenuPermission)
  38. //,typeof(Sys_JobPostAuthority)
  39. //,typeof(Sys_UserAuthority)
  40. //typeof(Crm_CustomerCert),
  41. //typeof(Crm_CustomerCompany),
  42. //typeof(Crm_CustomerFile),
  43. //typeof(Crm_DeleClient)
  44. //typeof(Crm_VisaCustomerCompany),
  45. //typeof(Crm_VisaCustomerFamily),
  46. //typeof(Crm_VisaCustomerSchool)
  47. //typeof(Grp_AirInquiry),
  48. //typeof(Grp_AirPrice),
  49. //typeof(Grp_CreditCardPayment),
  50. //typeof(Grp_DeleFile),
  51. //typeof(Grp_DelegationInfo),
  52. //typeof(Grp_DelegationJoinCustomer),
  53. //typeof(Grp_DeleMeetingNeeds),
  54. //typeof(Grp_HotelReservations),
  55. //typeof(Grp_VisaProgress),
  56. //typeof(Grp_DeleClientNeeds),
  57. //typeof(Res_AirCompany),
  58. //typeof(Res_AirTicketAgent),
  59. //typeof(Res_HotelData),
  60. //typeof(Res_ThreeCode)
  61. //typeof(Res_ScenicSpotInfo),
  62. //typeof(Res_CarGuides),
  63. //typeof(Res_CarInfo),
  64. //typeof(Res_GuidesInfo)
  65. //typeof(Res_CarData),
  66. //typeof(Res_LocalGuideData)
  67. //typeof(Grp_ScheduleInfo),
  68. //typeof(Grp_ScheduleDetailInfo),
  69. //typeof(Grp_SchedulePersonInfo)
  70. //typeof(Sys_Message),
  71. //typeof(Sys_MessageReadAuth)
  72. //typeof(Crm_DeleClient)
  73. //typeof(Crm_NewClientData)
  74. //typeof(Crm_ClientDataAndUser),
  75. //typeof(Crm_ClientDataAndBusiness),
  76. //typeof(Res_ItemDetailInfo),
  77. //typeof(Res_ItemVendor)
  78. //typeof(Res_ItemTypeInfo)
  79. //typeof(Bus_ConfItemInfo)
  80. //typeof(Bus_ConfItemListInfo)
  81. //typeof(Res_CountryFeeCost)
  82. //typeof(Res_MemoInfo),
  83. //typeof(Fin_DailyFeePayment), // 财务 - 日付申请
  84. //typeof(Fin_DailyFeePaymentContent),// 财务 - 日付申请详细类
  85. //typeof(Grp_GroupsTaskAssignment),
  86. //typeof(Grp_AirTicketReservations),
  87. //typeof(Grp_GroupCostParameter),
  88. //typeof(Grp_TeamRate), // 团组汇率
  89. //typeof(Fin_ForeignReceivables), // 对外收款账单
  90. //typeof(Fin_ProceedsReceived), // 已收款项
  91. //typeof(Fin_OtherPrice), // 其他款项
  92. //typeof(Res_OfficialActivities) //公务出访
  93. //typeof(Res_AskData),//请示数据库
  94. //typeof(Grp_DelegationEnData),
  95. //typeof(Grp_EnterExitCost),
  96. //typeof(Grp_DayAndCost),
  97. //typeof(Grp_NationalTravelFee),
  98. //typeof(Air_TicketBlackCode),
  99. //typeof(Pm_WageSheet) //人事模块 工资表单
  100. //typeof(Grp_VisaProgressCustomer),
  101. //typeof(Grp_VisaProgressCustomerPicture)
  102. //typeof(Grp_CheckBoxs) //成本选中
  103. //typeof(Grp_GroupCost) //成本数据信息
  104. //typeof(Grp_CostTypeHotelNumber)//分段房间数量
  105. //typeof(Grp_VisaInfo)
  106. //typeof(Grp_CarTouristGuideGroundReservations),
  107. //typeof(Grp_CarTouristGuideGroundReservationsContent),//
  108. //typeof(Fin_PaymentRefundAndOtherMoney),
  109. //typeof(Grp_InsuranceCost),
  110. //typeof(Grp_TourClientList), //接团客户名单
  111. //typeof(Dis_Intercontinental), //洲
  112. //typeof(Dis_Country), //国家
  113. //typeof(Dis_City), //城市
  114. //typeof(Fin_GroupExtraCost), //超支费用
  115. //typeof(Pm_TaskAllocation), //任务分配
  116. //typeof(Pm_TaskRelevanceUser), //任务分配关联人员(完成者)
  117. //typeof(Pm_TaskJobRelevancy), //任务分配关联人员(完成者)
  118. //typeof(Crm_TableOperationRecord), //表操作记录
  119. //typeof(Grp_InvertedList), //倒推表
  120. //typeof(Grp_InvertedListVisaCountry), //倒推表签证国家
  121. //typeof(Grp_VisaFeeInfo), //签证费用info
  122. //typeof(Grp_HotelInquiry), //酒店询价
  123. //typeof(Grp_HotelReservationsContent), //酒店费用子表
  124. //typeof(Grp_VisitingClients), //拜访团组客户
  125. //typeof(Grp_ApprovalTravelDetails), //公务出访表
  126. //typeof(Sys_Countries), //洲
  127. //typeof(Sys_Continent), //国家
  128. //typeof(Sys_Cities), //城市
  129. //typeof(Grp_GroupModelFile),//团组文件
  130. //typeof(Grp_VisaCommission),//签证费用录入
  131. typeof(Pm_GoodsReceive),//物品领用表
  132. typeof(Pm_GoodsStorage),//物品入库表
  133. //typeof(Pm_GoodsInfo),//物品详细表
  134. });
  135. Console.WriteLine("数据库结构同步完成!");