diff --git a/WinformDevFramework.Core/Configuration/AppSettingsConstVars.cs b/WinformDevFramework.Core/Configuration/AppSettingsConstVars.cs index 5b88990d988aa2809cd0ce85293e9bc0ec80f806..58541f72c612cdd7ce021d3754911bc0f556aa18 100644 --- a/WinformDevFramework.Core/Configuration/AppSettingsConstVars.cs +++ b/WinformDevFramework.Core/Configuration/AppSettingsConstVars.cs @@ -20,10 +20,14 @@ namespace WinformDevFramework.Core.Configuration /// 获取数据库类型 /// public static readonly string DbDbType = AppSettingsHelper.GetContent("ConnectionStrings", "DbType"); + /// /// 自动更新开关 /// - public static readonly bool AtuoUpdate = Boolean.Parse((ReadOnlySpan)AppSettingsHelper.GetContent("Update", "AtuoUpdate")); + public static readonly bool AtuoUpdate = + bool.Parse(AppSettingsHelper.GetContent("Update", "AtuoUpdate").ToLower().Equals("true") + ? "true" + : "false"); /// /// 版本号 diff --git a/WinformDevFramework.IRepository/Basic/IW_CustomerRepository.cs b/WinformDevFramework.IRepository/Basic/IW_CustomerRepository.cs new file mode 100644 index 0000000000000000000000000000000000000000..bb43f17975f1a2a824c36983b671173ec2794854 --- /dev/null +++ b/WinformDevFramework.IRepository/Basic/IW_CustomerRepository.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WinformDevFramework.Models.DBModels; +namespace WinformDevFramework.IRepository +{ + public interface Iw_CustomerRepository:IBaseRepository + { + } +} \ No newline at end of file diff --git a/WinformDevFramework.IRepository/Basic/IW_SettlementAccountRepository.cs b/WinformDevFramework.IRepository/Basic/IW_SettlementAccountRepository.cs new file mode 100644 index 0000000000000000000000000000000000000000..578137ad0f93b38e6ab5d6aaf10d3ad2858169b8 --- /dev/null +++ b/WinformDevFramework.IRepository/Basic/IW_SettlementAccountRepository.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WinformDevFramework.Models.DBModels; +namespace WinformDevFramework.IRepository +{ + public interface Iw_SettlementAccountRepository:IBaseRepository + { + } +} \ No newline at end of file diff --git a/WinformDevFramework.IRepository/Basic/IW_SupplierRepository.cs b/WinformDevFramework.IRepository/Basic/IW_SupplierRepository.cs new file mode 100644 index 0000000000000000000000000000000000000000..0799b75c05609afbb9dc891be89e6bbe5a2a0f6a --- /dev/null +++ b/WinformDevFramework.IRepository/Basic/IW_SupplierRepository.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WinformDevFramework.Models.DBModels; +namespace WinformDevFramework.IRepository +{ + public interface Iw_SupplierRepository:IBaseRepository + { + } +} \ No newline at end of file diff --git a/WinformDevFramework.IRepository/Basic/IW_WarehoursesRepository.cs b/WinformDevFramework.IRepository/Basic/IW_WarehoursesRepository.cs new file mode 100644 index 0000000000000000000000000000000000000000..f7d9b7cf82c470d5ce8fd8aaa2cb2b8d316915b9 --- /dev/null +++ b/WinformDevFramework.IRepository/Basic/IW_WarehoursesRepository.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WinformDevFramework.Models.DBModels; +namespace WinformDevFramework.IRepository +{ + public interface Iw_WarehoursesRepository:IBaseRepository + { + } +} \ No newline at end of file diff --git a/WinformDevFramework.IServices/Basic/IW_CustomerServices.cs b/WinformDevFramework.IServices/Basic/IW_CustomerServices.cs new file mode 100644 index 0000000000000000000000000000000000000000..9487aa3ba284b1639faf13cfc6ca9ac4c0d1d748 --- /dev/null +++ b/WinformDevFramework.IServices/Basic/IW_CustomerServices.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WinformDevFramework.Models; +using WinformDevFramework.Models.DBModels; + +namespace WinformDevFramework.IServices +{ + public interface Iw_CustomerServices: IBaseServices + { + + } +} \ No newline at end of file diff --git a/WinformDevFramework.IServices/Basic/IW_SettlementAccountServices.cs b/WinformDevFramework.IServices/Basic/IW_SettlementAccountServices.cs new file mode 100644 index 0000000000000000000000000000000000000000..7b26c75eb7c08cabe7d7b4a57cc68f3ddd9cc56a --- /dev/null +++ b/WinformDevFramework.IServices/Basic/IW_SettlementAccountServices.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WinformDevFramework.Models; +using WinformDevFramework.Models.DBModels; + +namespace WinformDevFramework.IServices +{ + public interface Iw_SettlementAccountServices: IBaseServices + { + + } +} \ No newline at end of file diff --git a/WinformDevFramework.IServices/Basic/IW_SupplierServices.cs b/WinformDevFramework.IServices/Basic/IW_SupplierServices.cs new file mode 100644 index 0000000000000000000000000000000000000000..80bcea910c193ef1b71105287646cbda06275aa6 --- /dev/null +++ b/WinformDevFramework.IServices/Basic/IW_SupplierServices.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WinformDevFramework.Models; +using WinformDevFramework.Models.DBModels; + +namespace WinformDevFramework.IServices +{ + public interface Iw_SupplierServices: IBaseServices + { + + } +} \ No newline at end of file diff --git a/WinformDevFramework.IServices/Basic/IW_WarehoursesServices.cs b/WinformDevFramework.IServices/Basic/IW_WarehoursesServices.cs new file mode 100644 index 0000000000000000000000000000000000000000..7506653afd1b100c636859ec4ba311b97723ad51 --- /dev/null +++ b/WinformDevFramework.IServices/Basic/IW_WarehoursesServices.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WinformDevFramework.Models; +using WinformDevFramework.Models.DBModels; + +namespace WinformDevFramework.IServices +{ + public interface Iw_WarehoursesServices: IBaseServices + { + + } +} \ No newline at end of file diff --git a/WinformDevFramework.Models/DBModels/w_Customer.cs b/WinformDevFramework.Models/DBModels/w_Customer.cs new file mode 100644 index 0000000000000000000000000000000000000000..cb0449e0b603270e09c28b3ffec1a3fb212add7d --- /dev/null +++ b/WinformDevFramework.Models/DBModels/w_Customer.cs @@ -0,0 +1,139 @@ +using System; +using System.Linq; +using System.Text; +using SqlSugar; + +namespace WinformDevFramework +{ + /// + ///客户 + /// + [SugarTable("w_Customer")] + public partial class w_Customer + { + public w_Customer(){ + + + } + /// + /// Desc: + /// Default: + /// Nullable:False + /// + [SugarColumn(IsPrimaryKey=true,IsIdentity=true)] + public int ID {get;set;} + + /// + /// Desc:名称 + /// Default: + /// Nullable:True + /// + public string SupplierName {get;set;} + + /// + /// Desc:联系人 + /// Default: + /// Nullable:True + /// + public string ContactPerson {get;set;} + + /// + /// Desc:手机号码 + /// Default: + /// Nullable:True + /// + public string PhoneNumber {get;set;} + + /// + /// Desc:邮箱 + /// Default: + /// Nullable:True + /// + public string Email {get;set;} + + /// + /// Desc:期初应收 + /// Default: + /// Nullable:True + /// + public decimal? BeginCollect {get;set;} + + /// + /// Desc:期末应收 + /// Default: + /// Nullable:True + /// + public decimal? EndPayCollect {get;set;} + + /// + /// Desc:税率 + /// Default: + /// Nullable:True + /// + public decimal? TaxtRate {get;set;} + + /// + /// Desc:排序 + /// Default: + /// Nullable:True + /// + public int? SortOrder {get;set;} + + /// + /// Desc:状态 + /// Default: + /// Nullable:True + /// + public bool? Status {get;set;} + + /// + /// Desc:备注 + /// Default: + /// Nullable:True + /// + public string Remark {get;set;} + + /// + /// Desc:传真 + /// Default: + /// Nullable:True + /// + public string Faxing {get;set;} + + /// + /// Desc:地址 + /// Default: + /// Nullable:True + /// + public string Address {get;set;} + + /// + /// Desc:开户行 + /// Default: + /// Nullable:True + /// + public string Bank {get;set;} + + /// + /// Desc:纳税人识别号 + /// Default: + /// Nullable:True + /// + public string TaxpayerNumber {get;set;} + + /// + /// Desc:银行账号 + /// Default: + /// Nullable:True + /// + public string BankAccount {get;set;} + + /// + /// Desc:固定电话 + /// Default: + /// Nullable:True + /// + public string LandlinePhone {get;set;} + + } +} diff --git a/WinformDevFramework.Models/DBModels/w_SettlementAccount.cs b/WinformDevFramework.Models/DBModels/w_SettlementAccount.cs new file mode 100644 index 0000000000000000000000000000000000000000..a21e8232fac4a2c788a5d096f8fc4991735715ba --- /dev/null +++ b/WinformDevFramework.Models/DBModels/w_SettlementAccount.cs @@ -0,0 +1,69 @@ +using System; +using System.Linq; +using System.Text; +using SqlSugar; + +namespace WinformDevFramework +{ + /// + ///结算账户 + /// + [SugarTable("w_SettlementAccount")] + public partial class w_SettlementAccount + { + public w_SettlementAccount(){ + + + } + /// + /// Desc: + /// Default: + /// Nullable:False + /// + [SugarColumn(IsPrimaryKey=true,IsIdentity=true)] + public int ID {get;set;} + + /// + /// Desc:编号 + /// Default: + /// Nullable:True + /// + public string Code {get;set;} + + /// + /// Desc:名称 + /// Default: + /// Nullable:True + /// + public string Name {get;set;} + + /// + /// Desc:期初金额 + /// Default: + /// Nullable:True + /// + public decimal? BeginAmount {get;set;} + + /// + /// Desc:当前余额 + /// Default: + /// Nullable:True + /// + public decimal? NowAmount {get;set;} + + /// + /// Desc:排序 + /// Default: + /// Nullable:True + /// + public int? SortOrder {get;set;} + + /// + /// Desc:备注 + /// Default: + /// Nullable:True + /// + public string Remark {get;set;} + + } +} diff --git a/WinformDevFramework.Models/DBModels/w_Supplier.cs b/WinformDevFramework.Models/DBModels/w_Supplier.cs new file mode 100644 index 0000000000000000000000000000000000000000..9fe96a9443463db50db373f6a819b1f880720cd4 --- /dev/null +++ b/WinformDevFramework.Models/DBModels/w_Supplier.cs @@ -0,0 +1,139 @@ +using System; +using System.Linq; +using System.Text; +using SqlSugar; + +namespace WinformDevFramework +{ + /// + ///供应商 + /// + [SugarTable("w_Supplier")] + public partial class w_Supplier + { + public w_Supplier(){ + + + } + /// + /// Desc: + /// Default: + /// Nullable:False + /// + [SugarColumn(IsPrimaryKey=true,IsIdentity=true)] + public int ID {get;set;} + + /// + /// Desc:名称 + /// Default: + /// Nullable:True + /// + public string SupplierName {get;set;} + + /// + /// Desc:联系人 + /// Default: + /// Nullable:True + /// + public string ContactPerson {get;set;} + + /// + /// Desc:手机号码 + /// Default: + /// Nullable:True + /// + public string PhoneNumber {get;set;} + + /// + /// Desc:邮箱 + /// Default: + /// Nullable:True + /// + public string Email {get;set;} + + /// + /// Desc:期初应付 + /// Default: + /// Nullable:True + /// + public decimal? BeginPay {get;set;} + + /// + /// Desc:期末应付 + /// Default: + /// Nullable:True + /// + public decimal? EndPay {get;set;} + + /// + /// Desc:税率 + /// Default: + /// Nullable:True + /// + public decimal? TaxtRate {get;set;} + + /// + /// Desc:排序 + /// Default: + /// Nullable:True + /// + public int? SortOrder {get;set;} + + /// + /// Desc:状态 + /// Default: + /// Nullable:True + /// + public bool? Status {get;set;} + + /// + /// Desc:备注 + /// Default: + /// Nullable:True + /// + public string Remark {get;set;} + + /// + /// Desc:传真 + /// Default: + /// Nullable:True + /// + public string Faxing {get;set;} + + /// + /// Desc:地址 + /// Default: + /// Nullable:True + /// + public string Address {get;set;} + + /// + /// Desc:开户行 + /// Default: + /// Nullable:True + /// + public string Bank {get;set;} + + /// + /// Desc:纳税人识别号 + /// Default: + /// Nullable:True + /// + public string TaxpayerNumber {get;set;} + + /// + /// Desc:银行账号 + /// Default: + /// Nullable:True + /// + public string BankAccount {get;set;} + + /// + /// Desc:固定电话 + /// Default: + /// Nullable:True + /// + public string LandlinePhone {get;set;} + + } +} diff --git a/WinformDevFramework.Models/DBModels/w_Warehourses.cs b/WinformDevFramework.Models/DBModels/w_Warehourses.cs new file mode 100644 index 0000000000000000000000000000000000000000..5f90b6709ccbf7606730ba2be1e5a4dba65a3d7f --- /dev/null +++ b/WinformDevFramework.Models/DBModels/w_Warehourses.cs @@ -0,0 +1,69 @@ +using System; +using System.Linq; +using System.Text; +using SqlSugar; + +namespace WinformDevFramework +{ + /// + ///仓库 + /// + [SugarTable("w_Warehourses")] + public partial class w_Warehourses + { + public w_Warehourses(){ + + + } + /// + /// Desc: + /// Default: + /// Nullable:False + /// + [SugarColumn(IsPrimaryKey=true,IsIdentity=true)] + public int ID {get;set;} + + /// + /// Desc:仓库名称 + /// Default: + /// Nullable:True + /// + public string WarehousesName {get;set;} + + /// + /// Desc:地址 + /// Default: + /// Nullable:True + /// + public string Address {get;set;} + + /// + /// Desc:仓储费 + /// Default: + /// Nullable:True + /// + public decimal? StorageFee {get;set;} + + /// + /// Desc:负责人ID + /// Default: + /// Nullable:True + /// + public int? ChargePersonID {get;set;} + + /// + /// Desc:排序 + /// Default: + /// Nullable:True + /// + public int? SortOrder {get;set;} + + /// + /// Desc:备注 + /// Default: + /// Nullable:True + /// + public string Remark {get;set;} + + } +} diff --git a/WinformDevFramework.Models/View/w_Customer.cs b/WinformDevFramework.Models/View/w_Customer.cs new file mode 100644 index 0000000000000000000000000000000000000000..a633863ef22d7627cc658f8d45795fb14d5cfb5c --- /dev/null +++ b/WinformDevFramework.Models/View/w_Customer.cs @@ -0,0 +1,33 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WinformDevFramework +{ + public partial class w_Customer + { + /// + /// 应付款总额 + /// + [SugarColumn(IsIgnore = true)] + public decimal TotalPayable { get; set; } = 100; + /// + /// 退货款总额 + /// + [SugarColumn(IsIgnore = true)] + public decimal TotalAmountReturned { get; set; } = 100; + /// + /// 已结款总额 + /// + [SugarColumn(IsIgnore = true)] + public decimal TotalAmountPaid{ get; set; } = 100; + /// + /// 未结款总额 + /// + [SugarColumn(IsIgnore = true)] + public decimal TotalAmountOutstanding { get; set; } = 100; + } +} diff --git a/WinformDevFramework.Models/View/w_Supplier.cs b/WinformDevFramework.Models/View/w_Supplier.cs new file mode 100644 index 0000000000000000000000000000000000000000..9e14ce26c647672f21a40475b6b30bfb8afc26f7 --- /dev/null +++ b/WinformDevFramework.Models/View/w_Supplier.cs @@ -0,0 +1,33 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WinformDevFramework +{ + public partial class w_Supplier + { + /// + /// 应付款总额 + /// + [SugarColumn(IsIgnore = true)] + public decimal TotalPayable { get; set; } = 100; + /// + /// 退货款总额 + /// + [SugarColumn(IsIgnore = true)] + public decimal TotalAmountReturned { get; set; } = 100; + /// + /// 已结款总额 + /// + [SugarColumn(IsIgnore = true)] + public decimal TotalAmountPaid{ get; set; } = 100; + /// + /// 未结款总额 + /// + [SugarColumn(IsIgnore = true)] + public decimal TotalAmountOutstanding { get; set; } = 100; + } +} diff --git a/WinformDevFramework.Repository/Basic/W_CustomerRepository.cs b/WinformDevFramework.Repository/Basic/W_CustomerRepository.cs new file mode 100644 index 0000000000000000000000000000000000000000..c703b25f303b4699780e4ed91de1d1f7f696e244 --- /dev/null +++ b/WinformDevFramework.Repository/Basic/W_CustomerRepository.cs @@ -0,0 +1,20 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WinformDevFramework.IRepository.System; +using WinformDevFramework.IRepository; +using WinformDevFramework.Models; +using WinformDevFramework.Models.DBModels; +namespace WinformDevFramework.Repository +{ + public class w_CustomerRepository : BaseRepository, Iw_CustomerRepository + { + public w_CustomerRepository(ISqlSugarClient sqlSugar) : base(sqlSugar) + { + + } + } +} \ No newline at end of file diff --git a/WinformDevFramework.Repository/Basic/W_SettlementAccountRepository.cs b/WinformDevFramework.Repository/Basic/W_SettlementAccountRepository.cs new file mode 100644 index 0000000000000000000000000000000000000000..52c3533a206bff09b53551fb50fcb3dbb0954b35 --- /dev/null +++ b/WinformDevFramework.Repository/Basic/W_SettlementAccountRepository.cs @@ -0,0 +1,20 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WinformDevFramework.IRepository.System; +using WinformDevFramework.IRepository; +using WinformDevFramework.Models; +using WinformDevFramework.Models.DBModels; +namespace WinformDevFramework.Repository +{ + public class w_SettlementAccountRepository : BaseRepository, Iw_SettlementAccountRepository + { + public w_SettlementAccountRepository(ISqlSugarClient sqlSugar) : base(sqlSugar) + { + + } + } +} \ No newline at end of file diff --git a/WinformDevFramework.Repository/Basic/W_SupplierRepository.cs b/WinformDevFramework.Repository/Basic/W_SupplierRepository.cs new file mode 100644 index 0000000000000000000000000000000000000000..9b35af32e33fa54225927d356a5ee3ffde660074 --- /dev/null +++ b/WinformDevFramework.Repository/Basic/W_SupplierRepository.cs @@ -0,0 +1,20 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WinformDevFramework.IRepository.System; +using WinformDevFramework.IRepository; +using WinformDevFramework.Models; +using WinformDevFramework.Models.DBModels; +namespace WinformDevFramework.Repository +{ + public class w_SupplierRepository : BaseRepository, Iw_SupplierRepository + { + public w_SupplierRepository(ISqlSugarClient sqlSugar) : base(sqlSugar) + { + + } + } +} \ No newline at end of file diff --git a/WinformDevFramework.Repository/Basic/W_WarehoursesRepository.cs b/WinformDevFramework.Repository/Basic/W_WarehoursesRepository.cs new file mode 100644 index 0000000000000000000000000000000000000000..0978dfa16d10b85fd58bf8cffcdf1023bae8225a --- /dev/null +++ b/WinformDevFramework.Repository/Basic/W_WarehoursesRepository.cs @@ -0,0 +1,20 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WinformDevFramework.IRepository.System; +using WinformDevFramework.IRepository; +using WinformDevFramework.Models; +using WinformDevFramework.Models.DBModels; +namespace WinformDevFramework.Repository +{ + public class w_WarehoursesRepository : BaseRepository, Iw_WarehoursesRepository + { + public w_WarehoursesRepository(ISqlSugarClient sqlSugar) : base(sqlSugar) + { + + } + } +} \ No newline at end of file diff --git a/WinformDevFramework.Services/Basic/W_CustomerServices.cs b/WinformDevFramework.Services/Basic/W_CustomerServices.cs new file mode 100644 index 0000000000000000000000000000000000000000..bb2c71a16adf6f9e03a0b41841eaadaf5f4e9e8a --- /dev/null +++ b/WinformDevFramework.Services/Basic/W_CustomerServices.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WinformDevFramework.IRepository.System; +using WinformDevFramework.IRepository.UnitOfWork; +using WinformDevFramework.IServices.System; +using WinformDevFramework.IServices; +using WinformDevFramework.IRepository; +using WinformDevFramework.Models; +namespace WinformDevFramework.Services +{ + public class w_CustomerServices : BaseServices, Iw_CustomerServices + { + private readonly Iw_CustomerRepository _dal; + private readonly IUnitOfWork _unitOfWork; + + public w_CustomerServices(IUnitOfWork unitOfWork, Iw_CustomerRepository dal) + { + this._dal = dal; + base.BaseDal = dal; + _unitOfWork = unitOfWork; + } + } +} \ No newline at end of file diff --git a/WinformDevFramework.Services/Basic/W_SettlementAccountServices.cs b/WinformDevFramework.Services/Basic/W_SettlementAccountServices.cs new file mode 100644 index 0000000000000000000000000000000000000000..74c8eb195880813ab3998f6579993b96654972ab --- /dev/null +++ b/WinformDevFramework.Services/Basic/W_SettlementAccountServices.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WinformDevFramework.IRepository.System; +using WinformDevFramework.IRepository.UnitOfWork; +using WinformDevFramework.IServices.System; +using WinformDevFramework.IServices; +using WinformDevFramework.IRepository; +using WinformDevFramework.Models; +namespace WinformDevFramework.Services +{ + public class w_SettlementAccountServices : BaseServices, Iw_SettlementAccountServices + { + private readonly Iw_SettlementAccountRepository _dal; + private readonly IUnitOfWork _unitOfWork; + + public w_SettlementAccountServices(IUnitOfWork unitOfWork, Iw_SettlementAccountRepository dal) + { + this._dal = dal; + base.BaseDal = dal; + _unitOfWork = unitOfWork; + } + } +} \ No newline at end of file diff --git a/WinformDevFramework.Services/Basic/W_SupplierServices.cs b/WinformDevFramework.Services/Basic/W_SupplierServices.cs new file mode 100644 index 0000000000000000000000000000000000000000..bff41cf41270a55405afe8ad2a31ef827f05f1d1 --- /dev/null +++ b/WinformDevFramework.Services/Basic/W_SupplierServices.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WinformDevFramework.IRepository.System; +using WinformDevFramework.IRepository.UnitOfWork; +using WinformDevFramework.IServices.System; +using WinformDevFramework.IServices; +using WinformDevFramework.IRepository; +using WinformDevFramework.Models; +namespace WinformDevFramework.Services +{ + public class w_SupplierServices : BaseServices, Iw_SupplierServices + { + private readonly Iw_SupplierRepository _dal; + private readonly IUnitOfWork _unitOfWork; + + public w_SupplierServices(IUnitOfWork unitOfWork, Iw_SupplierRepository dal) + { + this._dal = dal; + base.BaseDal = dal; + _unitOfWork = unitOfWork; + } + } +} \ No newline at end of file diff --git a/WinformDevFramework.Services/Basic/W_WarehoursesServices.cs b/WinformDevFramework.Services/Basic/W_WarehoursesServices.cs new file mode 100644 index 0000000000000000000000000000000000000000..858c2798f24237c45588affd7cc8be32bdc3216d --- /dev/null +++ b/WinformDevFramework.Services/Basic/W_WarehoursesServices.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WinformDevFramework.IRepository.System; +using WinformDevFramework.IRepository.UnitOfWork; +using WinformDevFramework.IServices.System; +using WinformDevFramework.IServices; +using WinformDevFramework.IRepository; +using WinformDevFramework.Models; +namespace WinformDevFramework.Services +{ + public class w_WarehoursesServices : BaseServices, Iw_WarehoursesServices + { + private readonly Iw_WarehoursesRepository _dal; + private readonly IUnitOfWork _unitOfWork; + + public w_WarehoursesServices(IUnitOfWork unitOfWork, Iw_WarehoursesRepository dal) + { + this._dal = dal; + base.BaseDal = dal; + _unitOfWork = unitOfWork; + } + } +} \ No newline at end of file diff --git a/WinformDevFramework/Common/ControlInfo.cs b/WinformDevFramework/Common/ControlInfo.cs new file mode 100644 index 0000000000000000000000000000000000000000..d841f46ec05788bce274ffdafa1a6e71d6ee1669 --- /dev/null +++ b/WinformDevFramework/Common/ControlInfo.cs @@ -0,0 +1,71 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WinformDevFramework +{ + public class ControlInfo + { + /// + /// 表名 + /// + public string tableName { set; get; } + + /// + /// 数据库字段名称 + /// + public string dataBaseFieldName { set; get; } + + /// + /// 数据库字段类型 + /// + public string dataBaseFieldType { set; get; } + + /// + /// 数据库字段说明 + /// + public string dataBaseFieldDDesr { set; get; } + + /// + /// 控件类型 + /// + public string controlType { set; get; } + + /// + /// 控件name + /// + public string controlName { set; get; } + + /// + /// 控件类型 + /// + public string labelName { set; get; } + + /// + /// 控件name + /// + public string labelText { set; get; } + + /// + /// 是否自增字段 + /// + public bool isIdentity { set; get; } + + /// + /// 是否搜索列 + /// + public bool isSearch { set; get; } + + /// + /// 是否为空检验 + /// + public bool isCheck { set; get; } + + /// + /// 是否可编辑 + /// + public bool isEdit { set; get; } = true; + } +} diff --git a/WinformDevFramework/Form1.cs b/WinformDevFramework/Form1.cs deleted file mode 100644 index 884f35dd48ce86022fe1f871ce5c17771fdee4cb..0000000000000000000000000000000000000000 --- a/WinformDevFramework/Form1.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; -using WinformDevFramework.Core.Configuration; - -namespace WinformDevFramework -{ - public partial class Form1 : Form - { - public Form1() - { - InitializeComponent(); - comboBox1.DataSource = new List() - { new User() { id = 1, name = "ww" }, new User() { id = 2, name = "kk" } }; - comboBox1.ValueMember = "id"; - comboBox1.DisplayMember = "name"; - } - - private void button1_Click(object sender, EventArgs e) - { - string id = comboBox1.SelectedValue.ToString(); - //throw new Exception("测试"); - AppSettingsHelper.SetContent("11211", "Update", "Version"); - } - - private void button2_Click(object sender, EventArgs e) - { - TabControl parentTabControl = this.Parent.Parent as TabControl; - TabPage tabpage = this.Parent as TabPage; - parentTabControl.TabPages.Remove(tabpage); - } - } - - class User - { - public int id { get; set; } - public string name { get; set; } - } -} diff --git a/WinformDevFramework/BaseForm1.Designer.cs b/WinformDevFramework/Pages/BaseForm1.Designer.cs similarity index 100% rename from WinformDevFramework/BaseForm1.Designer.cs rename to WinformDevFramework/Pages/BaseForm1.Designer.cs diff --git a/WinformDevFramework/BaseForm1.cs b/WinformDevFramework/Pages/BaseForm1.cs similarity index 89% rename from WinformDevFramework/BaseForm1.cs rename to WinformDevFramework/Pages/BaseForm1.cs index f5925f20be6ff3c8e44dd56a16ece60471afa6b3..e346f52940b95f36457332143f7dfa853e0b2751 100644 --- a/WinformDevFramework/BaseForm1.cs +++ b/WinformDevFramework/Pages/BaseForm1.cs @@ -19,6 +19,17 @@ namespace WinformDevFramework public partial class BaseForm1 : Form { protected FormStatus formStatus = FormStatus.First; + + /// + /// 始终为readonly + /// + public List ReadOnlyControlList = new List(); + + /// + /// 始终为可编辑 + /// + public List EditControlList = new List(); + public BaseForm1() { InitializeComponent(); @@ -90,11 +101,21 @@ namespace WinformDevFramework { foreach (Control control in groupBox.Controls) { + if (EditControlList.Contains(control.Name)) + { + control.Enabled = true; + } + + if (ReadOnlyControlList.Contains(control.Name)) + { + control.Enabled = false; + } + if (control is TextBox) { TextBox textBox = (TextBox)control; textBox.ReadOnly = !canEdit; - }else if (control is UITreeView||control is TreeView) + }else if (control is UITreeView||control is TreeView|| control is LinkLabel) { } @@ -120,7 +141,8 @@ namespace WinformDevFramework { control.Text = string.Empty; } - else if (control is Label || control is Button || control is CheckBox||control is GroupBox) + else if (control is Label || control is Button || control is CheckBox||control is GroupBox || control is TabPage) + { @@ -171,7 +193,10 @@ namespace WinformDevFramework private void btnSave_Click(object sender, EventArgs e) { - SaveFunction(sender, e); + if (ValidateData()) + { + SaveFunction(sender, e); + } } /// /// 保存 @@ -278,5 +303,14 @@ namespace WinformDevFramework { } + + /// + /// 校验数据 + /// + /// + public virtual bool ValidateData() + { + return false; + } } } diff --git a/WinformDevFramework/BaseForm1.resx b/WinformDevFramework/Pages/BaseForm1.resx similarity index 100% rename from WinformDevFramework/BaseForm1.resx rename to WinformDevFramework/Pages/BaseForm1.resx diff --git a/WinformDevFramework/Pages/Basic/FrmSupplier.Designer.cs b/WinformDevFramework/Pages/Basic/FrmSupplier.Designer.cs new file mode 100644 index 0000000000000000000000000000000000000000..571259feac260ec59ba51c5b7a225d619edd1dbf --- /dev/null +++ b/WinformDevFramework/Pages/Basic/FrmSupplier.Designer.cs @@ -0,0 +1,778 @@ +namespace WinformDevFramework +{ + partial class FrmSupplier + { + /// + /// 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() + { + this.label1 = new System.Windows.Forms.Label(); + this.txtSupplierName = new System.Windows.Forms.TextBox(); + this.txtContactPerson = new System.Windows.Forms.TextBox(); + this.联系人 = new System.Windows.Forms.Label(); + this.txtPhoneNumber = new System.Windows.Forms.TextBox(); + this.label3 = new System.Windows.Forms.Label(); + this.txtLandlinePhone = new System.Windows.Forms.TextBox(); + this.label4 = new System.Windows.Forms.Label(); + this.txtEmail = new System.Windows.Forms.TextBox(); + this.label5 = new System.Windows.Forms.Label(); + this.txtFaxing = new System.Windows.Forms.TextBox(); + this.label6 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.txtBeginPay = new System.Windows.Forms.NumericUpDown(); + this.txtEndPay = new System.Windows.Forms.NumericUpDown(); + this.label7 = new System.Windows.Forms.Label(); + this.txtTaxpayerNumber = new System.Windows.Forms.TextBox(); + this.label8 = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); + this.txtTaxtRate = new System.Windows.Forms.NumericUpDown(); + this.txtBank = new System.Windows.Forms.TextBox(); + this.label10 = new System.Windows.Forms.Label(); + this.txtBankAccount = new System.Windows.Forms.TextBox(); + this.label11 = new System.Windows.Forms.Label(); + this.txtAddress = new System.Windows.Forms.TextBox(); + this.label12 = new System.Windows.Forms.Label(); + this.txtSortOrder = new System.Windows.Forms.TextBox(); + this.label13 = new System.Windows.Forms.Label(); + this.label14 = new System.Windows.Forms.Label(); + this.txtRemark = new System.Windows.Forms.RichTextBox(); + this.tabControl2 = new System.Windows.Forms.TabControl(); + this.tabPage1 = new System.Windows.Forms.TabPage(); + this.dataGridView1 = new System.Windows.Forms.DataGridView(); + this.tabPage2 = new System.Windows.Forms.TabPage(); + this.dataGridView2 = new System.Windows.Forms.DataGridView(); + this.tabPage3 = new System.Windows.Forms.TabPage(); + this.dataGridView3 = new System.Windows.Forms.DataGridView(); + this.tabPage4 = new System.Windows.Forms.TabPage(); + this.dataGridView4 = new System.Windows.Forms.DataGridView(); + this.label15 = new System.Windows.Forms.Label(); + this.label16 = new System.Windows.Forms.Label(); + this.label17 = new System.Windows.Forms.Label(); + this.label18 = new System.Windows.Forms.Label(); + this.TotalAmountOutstanding = new System.Windows.Forms.LinkLabel(); + this.TotalAmountPaid = new System.Windows.Forms.LinkLabel(); + this.TotalAmountReturned = new System.Windows.Forms.LinkLabel(); + this.TotalPayable = new System.Windows.Forms.LinkLabel(); + this.label19 = new System.Windows.Forms.Label(); + this.checkBox1 = new System.Windows.Forms.CheckBox(); + this.palTools.SuspendLayout(); + this.tabControl1.SuspendLayout(); + this.tabDataEdit.SuspendLayout(); + this.groupBox1.SuspendLayout(); + this.flowLayoutPanelTools.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.txtBeginPay)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.txtEndPay)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.txtTaxtRate)).BeginInit(); + this.tabControl2.SuspendLayout(); + this.tabPage1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); + this.tabPage2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).BeginInit(); + this.tabPage3.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView3)).BeginInit(); + this.tabPage4.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView4)).BeginInit(); + this.SuspendLayout(); + // + // palTools + // + this.palTools.Size = new System.Drawing.Size(881, 31); + // + // tabControl1 + // + this.tabControl1.Size = new System.Drawing.Size(881, 570); + // + // tabList + // + this.tabList.Size = new System.Drawing.Size(873, 540); + // + // tabDataEdit + // + this.tabDataEdit.Size = new System.Drawing.Size(873, 540); + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.checkBox1); + this.groupBox1.Controls.Add(this.label19); + this.groupBox1.Controls.Add(this.TotalPayable); + this.groupBox1.Controls.Add(this.TotalAmountReturned); + this.groupBox1.Controls.Add(this.TotalAmountPaid); + this.groupBox1.Controls.Add(this.TotalAmountOutstanding); + this.groupBox1.Controls.Add(this.label18); + this.groupBox1.Controls.Add(this.label17); + this.groupBox1.Controls.Add(this.label16); + this.groupBox1.Controls.Add(this.label15); + this.groupBox1.Controls.Add(this.tabControl2); + this.groupBox1.Controls.Add(this.txtRemark); + this.groupBox1.Controls.Add(this.label14); + this.groupBox1.Controls.Add(this.txtSortOrder); + this.groupBox1.Controls.Add(this.label13); + this.groupBox1.Controls.Add(this.txtAddress); + this.groupBox1.Controls.Add(this.label12); + this.groupBox1.Controls.Add(this.txtBankAccount); + this.groupBox1.Controls.Add(this.label11); + this.groupBox1.Controls.Add(this.txtBank); + this.groupBox1.Controls.Add(this.label10); + this.groupBox1.Controls.Add(this.txtTaxtRate); + this.groupBox1.Controls.Add(this.label9); + this.groupBox1.Controls.Add(this.txtTaxpayerNumber); + this.groupBox1.Controls.Add(this.label8); + this.groupBox1.Controls.Add(this.txtEndPay); + this.groupBox1.Controls.Add(this.label7); + this.groupBox1.Controls.Add(this.txtBeginPay); + this.groupBox1.Controls.Add(this.label2); + this.groupBox1.Controls.Add(this.txtFaxing); + this.groupBox1.Controls.Add(this.label6); + this.groupBox1.Controls.Add(this.txtEmail); + this.groupBox1.Controls.Add(this.label5); + this.groupBox1.Controls.Add(this.txtLandlinePhone); + this.groupBox1.Controls.Add(this.label4); + this.groupBox1.Controls.Add(this.txtPhoneNumber); + this.groupBox1.Controls.Add(this.label3); + this.groupBox1.Controls.Add(this.txtContactPerson); + this.groupBox1.Controls.Add(this.联系人); + this.groupBox1.Controls.Add(this.txtSupplierName); + this.groupBox1.Controls.Add(this.label1); + this.groupBox1.Size = new System.Drawing.Size(867, 534); + this.groupBox1.Controls.SetChildIndex(this.txtID, 0); + this.groupBox1.Controls.SetChildIndex(this.label1, 0); + this.groupBox1.Controls.SetChildIndex(this.txtSupplierName, 0); + this.groupBox1.Controls.SetChildIndex(this.联系人, 0); + this.groupBox1.Controls.SetChildIndex(this.txtContactPerson, 0); + this.groupBox1.Controls.SetChildIndex(this.label3, 0); + this.groupBox1.Controls.SetChildIndex(this.txtPhoneNumber, 0); + this.groupBox1.Controls.SetChildIndex(this.label4, 0); + this.groupBox1.Controls.SetChildIndex(this.txtLandlinePhone, 0); + this.groupBox1.Controls.SetChildIndex(this.label5, 0); + this.groupBox1.Controls.SetChildIndex(this.txtEmail, 0); + this.groupBox1.Controls.SetChildIndex(this.label6, 0); + this.groupBox1.Controls.SetChildIndex(this.txtFaxing, 0); + this.groupBox1.Controls.SetChildIndex(this.label2, 0); + this.groupBox1.Controls.SetChildIndex(this.txtBeginPay, 0); + this.groupBox1.Controls.SetChildIndex(this.label7, 0); + this.groupBox1.Controls.SetChildIndex(this.txtEndPay, 0); + this.groupBox1.Controls.SetChildIndex(this.label8, 0); + this.groupBox1.Controls.SetChildIndex(this.txtTaxpayerNumber, 0); + this.groupBox1.Controls.SetChildIndex(this.label9, 0); + this.groupBox1.Controls.SetChildIndex(this.txtTaxtRate, 0); + this.groupBox1.Controls.SetChildIndex(this.label10, 0); + this.groupBox1.Controls.SetChildIndex(this.txtBank, 0); + this.groupBox1.Controls.SetChildIndex(this.label11, 0); + this.groupBox1.Controls.SetChildIndex(this.txtBankAccount, 0); + this.groupBox1.Controls.SetChildIndex(this.label12, 0); + this.groupBox1.Controls.SetChildIndex(this.txtAddress, 0); + this.groupBox1.Controls.SetChildIndex(this.label13, 0); + this.groupBox1.Controls.SetChildIndex(this.txtSortOrder, 0); + this.groupBox1.Controls.SetChildIndex(this.label14, 0); + this.groupBox1.Controls.SetChildIndex(this.txtRemark, 0); + this.groupBox1.Controls.SetChildIndex(this.tabControl2, 0); + this.groupBox1.Controls.SetChildIndex(this.label15, 0); + this.groupBox1.Controls.SetChildIndex(this.label16, 0); + this.groupBox1.Controls.SetChildIndex(this.label17, 0); + this.groupBox1.Controls.SetChildIndex(this.label18, 0); + this.groupBox1.Controls.SetChildIndex(this.TotalAmountOutstanding, 0); + this.groupBox1.Controls.SetChildIndex(this.TotalAmountPaid, 0); + this.groupBox1.Controls.SetChildIndex(this.TotalAmountReturned, 0); + this.groupBox1.Controls.SetChildIndex(this.TotalPayable, 0); + this.groupBox1.Controls.SetChildIndex(this.label19, 0); + this.groupBox1.Controls.SetChildIndex(this.checkBox1, 0); + // + // flowLayoutPanelTools + // + this.flowLayoutPanelTools.AutoSize = true; + this.flowLayoutPanelTools.Size = new System.Drawing.Size(877, 27); + // + // label1 + // + this.label1.Location = new System.Drawing.Point(8, 35); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(85, 23); + this.label1.TabIndex = 1; + this.label1.Text = "供应商名称"; + this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // txtSupplierName + // + this.txtSupplierName.Location = new System.Drawing.Point(99, 36); + this.txtSupplierName.Name = "txtSupplierName"; + this.txtSupplierName.Size = new System.Drawing.Size(131, 23); + this.txtSupplierName.TabIndex = 2; + // + // txtContactPerson + // + this.txtContactPerson.Location = new System.Drawing.Point(329, 37); + this.txtContactPerson.Name = "txtContactPerson"; + this.txtContactPerson.Size = new System.Drawing.Size(131, 23); + this.txtContactPerson.TabIndex = 4; + // + // 联系人 + // + this.联系人.Location = new System.Drawing.Point(238, 36); + this.联系人.Name = "联系人"; + this.联系人.Size = new System.Drawing.Size(85, 23); + this.联系人.TabIndex = 3; + this.联系人.Text = "联系人"; + this.联系人.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // txtPhoneNumber + // + this.txtPhoneNumber.Location = new System.Drawing.Point(557, 38); + this.txtPhoneNumber.Name = "txtPhoneNumber"; + this.txtPhoneNumber.Size = new System.Drawing.Size(131, 23); + this.txtPhoneNumber.TabIndex = 6; + // + // label3 + // + this.label3.Location = new System.Drawing.Point(466, 37); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(85, 23); + this.label3.TabIndex = 5; + this.label3.Text = "手机号码"; + this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // txtLandlinePhone + // + this.txtLandlinePhone.Location = new System.Drawing.Point(99, 77); + this.txtLandlinePhone.Name = "txtLandlinePhone"; + this.txtLandlinePhone.Size = new System.Drawing.Size(131, 23); + this.txtLandlinePhone.TabIndex = 8; + // + // label4 + // + this.label4.Location = new System.Drawing.Point(8, 76); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(85, 23); + this.label4.TabIndex = 7; + this.label4.Text = "固定电话"; + this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // txtEmail + // + this.txtEmail.Location = new System.Drawing.Point(329, 78); + this.txtEmail.Name = "txtEmail"; + this.txtEmail.Size = new System.Drawing.Size(131, 23); + this.txtEmail.TabIndex = 10; + // + // label5 + // + this.label5.Location = new System.Drawing.Point(238, 77); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(85, 23); + this.label5.TabIndex = 9; + this.label5.Text = "电子邮箱"; + this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // txtFaxing + // + this.txtFaxing.Location = new System.Drawing.Point(557, 78); + this.txtFaxing.Name = "txtFaxing"; + this.txtFaxing.Size = new System.Drawing.Size(131, 23); + this.txtFaxing.TabIndex = 12; + // + // label6 + // + this.label6.Location = new System.Drawing.Point(466, 77); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(85, 23); + this.label6.TabIndex = 11; + this.label6.Text = "传真"; + this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label2 + // + this.label2.Location = new System.Drawing.Point(8, 154); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(85, 23); + this.label2.TabIndex = 13; + this.label2.Text = "期初应付"; + this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // txtBeginPay + // + this.txtBeginPay.DecimalPlaces = 2; + this.txtBeginPay.Location = new System.Drawing.Point(99, 155); + this.txtBeginPay.Maximum = new decimal(new int[] { + 1215752192, + 23, + 0, + 0}); + this.txtBeginPay.Name = "txtBeginPay"; + this.txtBeginPay.Size = new System.Drawing.Size(120, 23); + this.txtBeginPay.TabIndex = 15; + // + // txtEndPay + // + this.txtEndPay.DecimalPlaces = 2; + this.txtEndPay.Location = new System.Drawing.Point(329, 155); + this.txtEndPay.Maximum = new decimal(new int[] { + 1215752192, + 23, + 0, + 0}); + this.txtEndPay.Name = "txtEndPay"; + this.txtEndPay.Size = new System.Drawing.Size(120, 23); + this.txtEndPay.TabIndex = 17; + // + // label7 + // + this.label7.Location = new System.Drawing.Point(238, 154); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(85, 23); + this.label7.TabIndex = 16; + this.label7.Text = "期末应付"; + this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // txtTaxpayerNumber + // + this.txtTaxpayerNumber.Location = new System.Drawing.Point(99, 196); + this.txtTaxpayerNumber.Name = "txtTaxpayerNumber"; + this.txtTaxpayerNumber.Size = new System.Drawing.Size(131, 23); + this.txtTaxpayerNumber.TabIndex = 19; + // + // label8 + // + this.label8.Location = new System.Drawing.Point(8, 195); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(85, 23); + this.label8.TabIndex = 18; + this.label8.Text = "纳税人识别号"; + this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label9 + // + this.label9.Location = new System.Drawing.Point(238, 196); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(85, 23); + this.label9.TabIndex = 20; + this.label9.Text = "税率(%)"; + this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // txtTaxtRate + // + this.txtTaxtRate.DecimalPlaces = 2; + this.txtTaxtRate.Location = new System.Drawing.Point(329, 197); + this.txtTaxtRate.Name = "txtTaxtRate"; + this.txtTaxtRate.Size = new System.Drawing.Size(120, 23); + this.txtTaxtRate.TabIndex = 21; + // + // txtBank + // + this.txtBank.Location = new System.Drawing.Point(99, 235); + this.txtBank.Name = "txtBank"; + this.txtBank.Size = new System.Drawing.Size(131, 23); + this.txtBank.TabIndex = 23; + // + // label10 + // + this.label10.Location = new System.Drawing.Point(8, 234); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(85, 23); + this.label10.TabIndex = 22; + this.label10.Text = "开户行"; + this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // txtBankAccount + // + this.txtBankAccount.Location = new System.Drawing.Point(329, 235); + this.txtBankAccount.Name = "txtBankAccount"; + this.txtBankAccount.Size = new System.Drawing.Size(131, 23); + this.txtBankAccount.TabIndex = 25; + // + // label11 + // + this.label11.Location = new System.Drawing.Point(238, 234); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(85, 23); + this.label11.TabIndex = 24; + this.label11.Text = "银行账号"; + this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // txtAddress + // + this.txtAddress.Location = new System.Drawing.Point(99, 116); + this.txtAddress.Name = "txtAddress"; + this.txtAddress.Size = new System.Drawing.Size(361, 23); + this.txtAddress.TabIndex = 27; + // + // label12 + // + this.label12.Location = new System.Drawing.Point(8, 115); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(85, 23); + this.label12.TabIndex = 26; + this.label12.Text = "地址"; + this.label12.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // txtSortOrder + // + this.txtSortOrder.Location = new System.Drawing.Point(557, 117); + this.txtSortOrder.Name = "txtSortOrder"; + this.txtSortOrder.Size = new System.Drawing.Size(131, 23); + this.txtSortOrder.TabIndex = 29; + this.txtSortOrder.Text = "1"; + // + // label13 + // + this.label13.Location = new System.Drawing.Point(466, 116); + this.label13.Name = "label13"; + this.label13.Size = new System.Drawing.Size(85, 23); + this.label13.TabIndex = 28; + this.label13.Text = "排序"; + this.label13.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label14 + // + this.label14.Location = new System.Drawing.Point(8, 274); + this.label14.Name = "label14"; + this.label14.Size = new System.Drawing.Size(85, 23); + this.label14.TabIndex = 30; + this.label14.Text = "备注"; + this.label14.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // txtRemark + // + this.txtRemark.Location = new System.Drawing.Point(99, 274); + this.txtRemark.Name = "txtRemark"; + this.txtRemark.Size = new System.Drawing.Size(361, 96); + this.txtRemark.TabIndex = 31; + this.txtRemark.Text = ""; + // + // tabControl2 + // + this.tabControl2.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.tabControl2.Controls.Add(this.tabPage1); + this.tabControl2.Controls.Add(this.tabPage2); + this.tabControl2.Controls.Add(this.tabPage3); + this.tabControl2.Controls.Add(this.tabPage4); + this.tabControl2.Location = new System.Drawing.Point(0, 376); + this.tabControl2.Name = "tabControl2"; + this.tabControl2.SelectedIndex = 0; + this.tabControl2.Size = new System.Drawing.Size(870, 161); + this.tabControl2.TabIndex = 32; + // + // tabPage1 + // + this.tabPage1.Controls.Add(this.dataGridView1); + this.tabPage1.Location = new System.Drawing.Point(4, 26); + this.tabPage1.Name = "tabPage1"; + this.tabPage1.Padding = new System.Windows.Forms.Padding(3); + this.tabPage1.Size = new System.Drawing.Size(862, 131); + this.tabPage1.TabIndex = 0; + this.tabPage1.Text = "应付款"; + this.tabPage1.UseVisualStyleBackColor = true; + // + // dataGridView1 + // + this.dataGridView1.AllowUserToAddRows = false; + this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; + this.dataGridView1.BackgroundColor = System.Drawing.SystemColors.Control; + this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill; + this.dataGridView1.GridColor = System.Drawing.SystemColors.Control; + this.dataGridView1.Location = new System.Drawing.Point(3, 3); + this.dataGridView1.MultiSelect = false; + this.dataGridView1.Name = "dataGridView1"; + this.dataGridView1.ReadOnly = true; + this.dataGridView1.RowHeadersVisible = false; + this.dataGridView1.RowTemplate.Height = 25; + this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.dataGridView1.Size = new System.Drawing.Size(856, 125); + this.dataGridView1.TabIndex = 0; + // + // tabPage2 + // + this.tabPage2.Controls.Add(this.dataGridView2); + this.tabPage2.Location = new System.Drawing.Point(4, 26); + this.tabPage2.Name = "tabPage2"; + this.tabPage2.Padding = new System.Windows.Forms.Padding(3); + this.tabPage2.Size = new System.Drawing.Size(781, 0); + this.tabPage2.TabIndex = 1; + this.tabPage2.Text = "退货款"; + this.tabPage2.UseVisualStyleBackColor = true; + // + // dataGridView2 + // + this.dataGridView2.AllowUserToAddRows = false; + this.dataGridView2.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; + this.dataGridView2.BackgroundColor = System.Drawing.SystemColors.Control; + this.dataGridView2.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridView2.Dock = System.Windows.Forms.DockStyle.Fill; + this.dataGridView2.GridColor = System.Drawing.SystemColors.Control; + this.dataGridView2.Location = new System.Drawing.Point(3, 3); + this.dataGridView2.MultiSelect = false; + this.dataGridView2.Name = "dataGridView2"; + this.dataGridView2.ReadOnly = true; + this.dataGridView2.RowHeadersVisible = false; + this.dataGridView2.RowTemplate.Height = 25; + this.dataGridView2.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.dataGridView2.Size = new System.Drawing.Size(775, 0); + this.dataGridView2.TabIndex = 1; + // + // tabPage3 + // + this.tabPage3.Controls.Add(this.dataGridView3); + this.tabPage3.Location = new System.Drawing.Point(4, 26); + this.tabPage3.Name = "tabPage3"; + this.tabPage3.Padding = new System.Windows.Forms.Padding(3); + this.tabPage3.Size = new System.Drawing.Size(781, 0); + this.tabPage3.TabIndex = 2; + this.tabPage3.Text = "已结款"; + this.tabPage3.UseVisualStyleBackColor = true; + // + // dataGridView3 + // + this.dataGridView3.AllowUserToAddRows = false; + this.dataGridView3.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; + this.dataGridView3.BackgroundColor = System.Drawing.SystemColors.Control; + this.dataGridView3.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridView3.Dock = System.Windows.Forms.DockStyle.Fill; + this.dataGridView3.GridColor = System.Drawing.SystemColors.Control; + this.dataGridView3.Location = new System.Drawing.Point(3, 3); + this.dataGridView3.MultiSelect = false; + this.dataGridView3.Name = "dataGridView3"; + this.dataGridView3.ReadOnly = true; + this.dataGridView3.RowHeadersVisible = false; + this.dataGridView3.RowTemplate.Height = 25; + this.dataGridView3.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.dataGridView3.Size = new System.Drawing.Size(775, 0); + this.dataGridView3.TabIndex = 1; + // + // tabPage4 + // + this.tabPage4.Controls.Add(this.dataGridView4); + this.tabPage4.Location = new System.Drawing.Point(4, 26); + this.tabPage4.Name = "tabPage4"; + this.tabPage4.Padding = new System.Windows.Forms.Padding(3); + this.tabPage4.Size = new System.Drawing.Size(781, 0); + this.tabPage4.TabIndex = 3; + this.tabPage4.Text = "未结款"; + this.tabPage4.UseVisualStyleBackColor = true; + // + // dataGridView4 + // + this.dataGridView4.AllowUserToAddRows = false; + this.dataGridView4.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; + this.dataGridView4.BackgroundColor = System.Drawing.SystemColors.Control; + this.dataGridView4.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridView4.Dock = System.Windows.Forms.DockStyle.Fill; + this.dataGridView4.GridColor = System.Drawing.SystemColors.Control; + this.dataGridView4.Location = new System.Drawing.Point(3, 3); + this.dataGridView4.MultiSelect = false; + this.dataGridView4.Name = "dataGridView4"; + this.dataGridView4.ReadOnly = true; + this.dataGridView4.RowHeadersVisible = false; + this.dataGridView4.RowTemplate.Height = 25; + this.dataGridView4.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.dataGridView4.Size = new System.Drawing.Size(775, 0); + this.dataGridView4.TabIndex = 1; + // + // label15 + // + this.label15.Location = new System.Drawing.Point(466, 195); + this.label15.Name = "label15"; + this.label15.Size = new System.Drawing.Size(85, 23); + this.label15.TabIndex = 33; + this.label15.Text = "应付款总额"; + this.label15.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label16 + // + this.label16.Location = new System.Drawing.Point(655, 194); + this.label16.Name = "label16"; + this.label16.Size = new System.Drawing.Size(85, 23); + this.label16.TabIndex = 34; + this.label16.Text = "退货款总额"; + this.label16.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label17 + // + this.label17.Location = new System.Drawing.Point(466, 237); + this.label17.Name = "label17"; + this.label17.Size = new System.Drawing.Size(85, 23); + this.label17.TabIndex = 35; + this.label17.Text = "已结款总额"; + this.label17.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label18 + // + this.label18.Location = new System.Drawing.Point(655, 236); + this.label18.Name = "label18"; + this.label18.Size = new System.Drawing.Size(85, 23); + this.label18.TabIndex = 36; + this.label18.Text = "未结款总额"; + this.label18.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // TotalAmountOutstanding + // + this.TotalAmountOutstanding.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.TotalAmountOutstanding.Location = new System.Drawing.Point(746, 239); + this.TotalAmountOutstanding.Name = "TotalAmountOutstanding"; + this.TotalAmountOutstanding.Size = new System.Drawing.Size(115, 17); + this.TotalAmountOutstanding.TabIndex = 37; + this.TotalAmountOutstanding.TabStop = true; + this.TotalAmountOutstanding.Text = "0.00"; + this.TotalAmountOutstanding.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.TotalAmountOutstanding.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.TotalAmountOutstanding_LinkClicked); + // + // TotalAmountPaid + // + this.TotalAmountPaid.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.TotalAmountPaid.Location = new System.Drawing.Point(557, 240); + this.TotalAmountPaid.Name = "TotalAmountPaid"; + this.TotalAmountPaid.Size = new System.Drawing.Size(116, 17); + this.TotalAmountPaid.TabIndex = 38; + this.TotalAmountPaid.TabStop = true; + this.TotalAmountPaid.Text = "0.00"; + this.TotalAmountPaid.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.TotalAmountPaid.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.TotalAmountPaid_LinkClicked); + // + // TotalAmountReturned + // + this.TotalAmountReturned.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.TotalAmountReturned.Location = new System.Drawing.Point(746, 197); + this.TotalAmountReturned.Name = "TotalAmountReturned"; + this.TotalAmountReturned.Size = new System.Drawing.Size(115, 17); + this.TotalAmountReturned.TabIndex = 39; + this.TotalAmountReturned.TabStop = true; + this.TotalAmountReturned.Text = "0.00"; + this.TotalAmountReturned.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.TotalAmountReturned.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.TotalAmountReturned_LinkClicked); + // + // TotalPayable + // + this.TotalPayable.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.TotalPayable.Location = new System.Drawing.Point(557, 197); + this.TotalPayable.Name = "TotalPayable"; + this.TotalPayable.Size = new System.Drawing.Size(116, 17); + this.TotalPayable.TabIndex = 40; + this.TotalPayable.TabStop = true; + this.TotalPayable.Text = "0.00"; + this.TotalPayable.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.TotalPayable.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.TotalPayable_LinkClicked); + // + // label19 + // + this.label19.Location = new System.Drawing.Point(466, 154); + this.label19.Name = "label19"; + this.label19.Size = new System.Drawing.Size(85, 23); + this.label19.TabIndex = 41; + this.label19.Text = "状态"; + this.label19.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // checkBox1 + // + this.checkBox1.AutoSize = true; + this.checkBox1.Location = new System.Drawing.Point(557, 156); + this.checkBox1.Name = "checkBox1"; + this.checkBox1.Size = new System.Drawing.Size(75, 21); + this.checkBox1.TabIndex = 42; + this.checkBox1.Text = "是否启用"; + this.checkBox1.UseVisualStyleBackColor = true; + // + // FrmSupplier + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(881, 601); + this.Name = "FrmSupplier"; + this.Text = "FrmSupplier"; + this.palTools.ResumeLayout(false); + this.palTools.PerformLayout(); + this.tabControl1.ResumeLayout(false); + this.tabDataEdit.ResumeLayout(false); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.flowLayoutPanelTools.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.txtBeginPay)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.txtEndPay)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.txtTaxtRate)).EndInit(); + this.tabControl2.ResumeLayout(false); + this.tabPage1.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); + this.tabPage2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).EndInit(); + this.tabPage3.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView3)).EndInit(); + this.tabPage4.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView4)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private TextBox txtSupplierName; + private Label label1; + private TextBox txtContactPerson; + private Label 联系人; + private TextBox txtPhoneNumber; + private Label label3; + private TextBox txtFaxing; + private Label label6; + private TextBox txtEmail; + private Label label5; + private TextBox txtLandlinePhone; + private Label label4; + private Label label2; + private NumericUpDown txtBeginPay; + private NumericUpDown txtEndPay; + private Label label7; + private Label label9; + private TextBox txtTaxpayerNumber; + private Label label8; + private NumericUpDown txtTaxtRate; + private TextBox txtBankAccount; + private Label label11; + private TextBox txtBank; + private Label label10; + private TextBox txtAddress; + private Label label12; + private TextBox txtSortOrder; + private Label label13; + private Label label14; + private RichTextBox txtRemark; + private TabControl tabControl2; + private TabPage tabPage1; + private TabPage tabPage2; + private TabPage tabPage3; + private TabPage tabPage4; + private DataGridView dataGridView1; + private DataGridView dataGridView2; + private DataGridView dataGridView3; + private DataGridView dataGridView4; + private Label label18; + private Label label17; + private Label label16; + private Label label15; + private LinkLabel TotalAmountOutstanding; + private LinkLabel TotalPayable; + private LinkLabel TotalAmountReturned; + private LinkLabel TotalAmountPaid; + private Label label19; + private CheckBox checkBox1; + } +} \ No newline at end of file diff --git a/WinformDevFramework/Pages/Basic/FrmSupplier.cs b/WinformDevFramework/Pages/Basic/FrmSupplier.cs new file mode 100644 index 0000000000000000000000000000000000000000..34e3b7a01b63dfaaa116c0342c739fac7a3871f5 --- /dev/null +++ b/WinformDevFramework/Pages/Basic/FrmSupplier.cs @@ -0,0 +1,306 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using WinformDevFramework.Core.Winform; +using WinformDevFramework.IServices; +using WinformDevFramework.Services; + +namespace WinformDevFramework +{ + public partial class FrmSupplier : BaseForm1 + { + private Iw_SupplierServices _iwSupplierServices; + public FrmSupplier(Iw_SupplierServices iwSupplierServices) + { + _iwSupplierServices = iwSupplierServices; + InitializeComponent(); + } + + public override void Init() + { + base.Init(); + this.dataGridViewList.DataSource = GetData(); + this.dataGridViewList.Columns["SupplierName"]!.HeaderText = "名称"; + this.dataGridViewList.Columns["ContactPerson"]!.HeaderText = "联系人"; + this.dataGridViewList.Columns["PhoneNumber"].HeaderText = "手机号码"; + this.dataGridViewList.Columns["Email"]!.HeaderText = "邮箱"; + this.dataGridViewList.Columns["BeginPay"]!.HeaderText = "期初应付"; + this.dataGridViewList.Columns["EndPay"].HeaderText = "期末应付"; + this.dataGridViewList.Columns["TaxtRate"]!.HeaderText = "税率"; + this.dataGridViewList.Columns["SortOrder"]!.HeaderText = "排序"; + this.dataGridViewList.Columns["Status"].HeaderText = "状态"; + this.dataGridViewList.Columns["Faxing"]!.HeaderText = "传真"; + this.dataGridViewList.Columns["Address"]!.HeaderText = "地址"; + this.dataGridViewList.Columns["Bank"].HeaderText = "开户行"; + + this.dataGridViewList.Columns["TaxpayerNumber"]!.HeaderText = "纳税人识别号"; + this.dataGridViewList.Columns["BankAccount"]!.HeaderText = "银行账号"; + this.dataGridViewList.Columns["LandlinePhone"].HeaderText = "固定电话"; + this.dataGridViewList.Columns["Remark"].HeaderText = "备注"; + + + this.dataGridViewList.Columns["TotalPayable"]!.HeaderText = "应付款总额"; + this.dataGridViewList.Columns["TotalAmountReturned"].HeaderText = "退货款总额"; + this.dataGridViewList.Columns["TotalAmountPaid"].HeaderText = "已结款总额"; + this.dataGridViewList.Columns["TotalAmountOutstanding"].HeaderText = "未结款总额"; + + SetToolButtonStatus(formStatus); + //SetToolsButton(); + } + + public override void TabControlSelectingFunction(object? sender, TabControlCancelEventArgs e) + { + base.TabControlSelectingFunction(sender, e); + } + + public override void DataGridViewListDoubleClick(object? sender, DataGridViewCellEventArgs e) + { + base.DataGridViewListDoubleClick(sender, e); + var g = (DataGridView)sender; + var model = g.CurrentRow.DataBoundItem as w_Supplier; + //给详情页设置数据 + this.txtID.Text = model.ID.ToString(); + txtSupplierName.Text = model.SupplierName; + txtContactPerson.Text = model.ContactPerson; + txtPhoneNumber.Text = model.PhoneNumber; + txtEmail.Text = model.Email; + txtBeginPay.Value = model.BeginPay ?? 0; + txtEndPay.Value = model.EndPay ?? 0; + txtTaxtRate.Value = model.TaxtRate ?? 0; + txtSortOrder.Text = model.SortOrder.ToString(); + checkBox1.Checked = model.Status.Value; + txtFaxing.Text = model.Faxing; + txtAddress.Text = model.Address; + txtBank.Text = model.Bank; + txtTaxpayerNumber.Text = model.TaxpayerNumber; + txtBankAccount.Text = model.BankAccount; + txtLandlinePhone.Text = model.LandlinePhone; + TotalPayable.Text = model.TotalPayable.ToString(); + TotalAmountReturned.Text = model.TotalAmountReturned.ToString(); + TotalAmountPaid.Text = model.TotalAmountPaid.ToString(); + TotalAmountOutstanding.Text = model.TotalAmountOutstanding.ToString(); + txtRemark.Text = model.Remark; + //TODO设置tab页数据 + + SetToolButtonStatus(formStatus); + + } + + public override void AddFunction(object sender, EventArgs e) + { + base.AddFunction(sender, e); + SetToolButtonStatus(formStatus); + } + + public override void EditFunction(object sender, EventArgs e) + { + base.EditFunction(sender, e); + SetToolButtonStatus(formStatus); + } + + public override void SaveFunction(object sender, EventArgs e) + { + base.SaveFunction(sender, e); + //新增 + if (string.IsNullOrEmpty(txtID.Text)) + { + w_Supplier model = new w_Supplier(); + model.SupplierName = txtSupplierName.Text; + model.ContactPerson= txtContactPerson.Text; + model.PhoneNumber= txtPhoneNumber.Text; + model.Email= txtEmail.Text; + model.BeginPay = txtBeginPay.Value; + model.EndPay = txtEndPay.Value; + model.TaxtRate = txtTaxtRate.Value; + model.SortOrder= int.Parse(string.IsNullOrEmpty(txtSortOrder.Text)?"1": txtSortOrder.Text); + model.Status= checkBox1.Checked; + model.Faxing= txtFaxing.Text; + model.Address= txtAddress.Text; + model.Bank= txtBank.Text; + model.TaxpayerNumber= txtTaxpayerNumber.Text; + model.BankAccount= txtBankAccount.Text; + model.LandlinePhone= txtLandlinePhone.Text; + model.Remark= txtRemark.Text; + var id = _iwSupplierServices.Insert(model); + txtID.Text = id.ToString(); + if (id > 0) + { + MessageBox.Show("保存成功!", "提示"); + } + } + // 修改 + else + { + w_Supplier model = _iwSupplierServices.QueryById(int.Parse(txtID.Text)); + model.SupplierName = txtSupplierName.Text; + model.ContactPerson = txtContactPerson.Text; + model.PhoneNumber = txtPhoneNumber.Text; + model.Email = txtEmail.Text; + model.BeginPay = txtBeginPay.Value; + model.EndPay = txtEndPay.Value; + model.TaxtRate = txtTaxtRate.Value; + model.SortOrder = int.Parse(txtSortOrder.Text); + model.Status = checkBox1.Checked; + model.Faxing = txtFaxing.Text; + model.Address = txtAddress.Text; + model.Bank = txtBank.Text; + model.TaxpayerNumber = txtTaxpayerNumber.Text; + model.BankAccount = txtBankAccount.Text; + model.LandlinePhone = txtLandlinePhone.Text; + model.Remark = txtRemark.Text; + if (_iwSupplierServices.Update(model)) + { + MessageBox.Show("保存成功!", "提示"); + } + } + SetToolButtonStatus(formStatus); + this.dataGridViewList.DataSource = GetData(); + } + + public override void CanelFunction(object sender, EventArgs e) + { + bool isAdd = formStatus == FormStatus.Add; + base.CanelFunction(sender, e); + SetToolButtonStatus(formStatus); + if (isAdd) btnEdit.Enabled = false; + } + + public override void DelFunction(object sender, EventArgs e) + { + base.DelFunction(sender, e); + var result = MessageBox.Show("是否删除?", "确认", MessageBoxButtons.YesNoCancel); + if (result == DialogResult.Yes) + { + _iwSupplierServices.DeleteById(Int32.Parse(txtID.Text)); + formStatus = FormStatus.Del; + SetToolButtonStatus(formStatus); + this.dataGridViewList.DataSource = GetData(); + } + } + + public override void SetToolButtonStatus(FormStatus status) + { + base.SetToolButtonStatus(status); + switch (status) + { + case FormStatus.Add: + { + btnAdd.Enabled = false; + btnEdit.Enabled = false; + btnSave.Enabled = true; + btnDel.Enabled = false; + btnCanel.Enabled = true; + SetControlStatus(this.groupBox1, true); + ClearControlsText(this.groupBox1); + break; + } + case FormStatus.Edit: + { + btnAdd.Enabled = false; + btnEdit.Enabled = false; + btnSave.Enabled = true; + btnDel.Enabled = false; + btnCanel.Enabled = true; + SetControlStatus(this.groupBox1, true); + break; + } + case FormStatus.View: + { + btnAdd.Enabled = true; + btnEdit.Enabled = true; + btnSave.Enabled = false; + btnDel.Enabled = true; + btnCanel.Enabled = false; + SetControlStatus(this.groupBox1, false); + break; + } + case FormStatus.Canel: + { + btnAdd.Enabled = true; + btnEdit.Enabled = true; + btnSave.Enabled = false; + btnDel.Enabled = false; + btnCanel.Enabled = false; + SetControlStatus(this.groupBox1, false); + break; + } + case FormStatus.First: + { + btnAdd.Enabled = true; + btnEdit.Enabled = false; + btnSave.Enabled = false; + btnDel.Enabled = false; + btnCanel.Enabled = false; + SetControlStatus(this.groupBox1, false); + break; + } + case FormStatus.Save: + { + btnAdd.Enabled = true; + btnEdit.Enabled = true; + btnSave.Enabled = false; + btnDel.Enabled = true; + btnCanel.Enabled = false; + SetControlStatus(this.groupBox1, false); + break; + } + case FormStatus.Del: + { + btnAdd.Enabled = true; + btnEdit.Enabled = false; + btnSave.Enabled = false; + btnDel.Enabled = false; + btnCanel.Enabled = false; + SetControlStatus(this.groupBox1, false); + ClearControlsText(this.groupBox1); + break; + } + } + } + public override bool ValidateData() + { + if (string.IsNullOrEmpty(txtSupplierName.Text)) + { + MessageBox.Show("字典内容不能为空!"); + return false; + } + return true; + } + /// + /// 获取数据 + /// + /// + private List GetData() + { + List data = new List(); + data = _iwSupplierServices.Query(); + return data; + } + + private void TotalAmountPaid_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + tabControl2.SelectedTab = tabPage3; + } + + private void TotalPayable_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + tabControl2.SelectedTab = tabPage1; + } + + private void TotalAmountReturned_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + tabControl2.SelectedTab = tabPage2; + } + + private void TotalAmountOutstanding_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + tabControl2.SelectedTab = tabPage4; + } + } +} diff --git a/WinformDevFramework/Form1.resx b/WinformDevFramework/Pages/Basic/FrmSupplier.resx similarity index 100% rename from WinformDevFramework/Form1.resx rename to WinformDevFramework/Pages/Basic/FrmSupplier.resx diff --git a/WinformDevFramework/Pages/Basic/FrmW_Customer.Designer.cs b/WinformDevFramework/Pages/Basic/FrmW_Customer.Designer.cs new file mode 100644 index 0000000000000000000000000000000000000000..2e659e3421f9da854c2c99868a04f1f692ca9b74 --- /dev/null +++ b/WinformDevFramework/Pages/Basic/FrmW_Customer.Designer.cs @@ -0,0 +1,760 @@ +namespace WinformDevFramework +{ + partial class Frmw_Customer + { + /// + /// 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() + { + this.lblSupplierName = new System.Windows.Forms.Label(); + this.SupplierName = new System.Windows.Forms.TextBox(); + this.lblContactPerson = new System.Windows.Forms.Label(); + this.ContactPerson = new System.Windows.Forms.TextBox(); + this.lblPhoneNumber = new System.Windows.Forms.Label(); + this.PhoneNumber = new System.Windows.Forms.TextBox(); + this.lblEmail = new System.Windows.Forms.Label(); + this.Email = new System.Windows.Forms.TextBox(); + this.lblBeginCollect = new System.Windows.Forms.Label(); + this.BeginCollect = new System.Windows.Forms.NumericUpDown(); + this.lblEndPayCollect = new System.Windows.Forms.Label(); + this.EndPayCollect = new System.Windows.Forms.NumericUpDown(); + this.lblTaxtRate = new System.Windows.Forms.Label(); + this.TaxtRate = new System.Windows.Forms.NumericUpDown(); + this.lblSortOrder = new System.Windows.Forms.Label(); + this.SortOrder = new System.Windows.Forms.NumericUpDown(); + this.lblStatus = new System.Windows.Forms.Label(); + this.Status = new System.Windows.Forms.CheckBox(); + this.lblRemark = new System.Windows.Forms.Label(); + this.Remark = new System.Windows.Forms.TextBox(); + this.lblFaxing = new System.Windows.Forms.Label(); + this.Faxing = new System.Windows.Forms.TextBox(); + this.lblAddress = new System.Windows.Forms.Label(); + this.Address = new System.Windows.Forms.TextBox(); + this.lblBank = new System.Windows.Forms.Label(); + this.Bank = new System.Windows.Forms.TextBox(); + this.lblTaxpayerNumber = new System.Windows.Forms.Label(); + this.TaxpayerNumber = new System.Windows.Forms.TextBox(); + this.lblBankAccount = new System.Windows.Forms.Label(); + this.BankAccount = new System.Windows.Forms.TextBox(); + this.lblLandlinePhone = new System.Windows.Forms.Label(); + this.LandlinePhone = new System.Windows.Forms.TextBox(); + this.tabControl2 = new System.Windows.Forms.TabControl(); + this.tabPage1 = new System.Windows.Forms.TabPage(); + this.dataGridView1 = new System.Windows.Forms.DataGridView(); + this.tabPage2 = new System.Windows.Forms.TabPage(); + this.dataGridView2 = new System.Windows.Forms.DataGridView(); + this.tabPage3 = new System.Windows.Forms.TabPage(); + this.dataGridView3 = new System.Windows.Forms.DataGridView(); + this.tabPage4 = new System.Windows.Forms.TabPage(); + this.dataGridView4 = new System.Windows.Forms.DataGridView(); + this.TotalPayable = new System.Windows.Forms.LinkLabel(); + this.TotalAmountReturned = new System.Windows.Forms.LinkLabel(); + this.TotalAmountPaid = new System.Windows.Forms.LinkLabel(); + this.TotalAmountOutstanding = new System.Windows.Forms.LinkLabel(); + this.label18 = new System.Windows.Forms.Label(); + this.label17 = new System.Windows.Forms.Label(); + this.label16 = new System.Windows.Forms.Label(); + this.label15 = new System.Windows.Forms.Label(); + this.palTools.SuspendLayout(); + this.tabControl1.SuspendLayout(); + this.tabDataEdit.SuspendLayout(); + this.groupBox1.SuspendLayout(); + this.flowLayoutPanelTools.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.BeginCollect)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.EndPayCollect)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.TaxtRate)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.SortOrder)).BeginInit(); + this.tabControl2.SuspendLayout(); + this.tabPage1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); + this.tabPage2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).BeginInit(); + this.tabPage3.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView3)).BeginInit(); + this.tabPage4.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView4)).BeginInit(); + this.SuspendLayout(); + // + // palTools + // + this.palTools.Size = new System.Drawing.Size(874, 31); + // + // tabControl1 + // + this.tabControl1.Size = new System.Drawing.Size(874, 520); + // + // tabList + // + this.tabList.Size = new System.Drawing.Size(866, 490); + // + // tabDataEdit + // + this.tabDataEdit.Size = new System.Drawing.Size(866, 490); + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.TotalPayable); + this.groupBox1.Controls.Add(this.TotalAmountReturned); + this.groupBox1.Controls.Add(this.TotalAmountPaid); + this.groupBox1.Controls.Add(this.TotalAmountOutstanding); + this.groupBox1.Controls.Add(this.label18); + this.groupBox1.Controls.Add(this.label17); + this.groupBox1.Controls.Add(this.label16); + this.groupBox1.Controls.Add(this.label15); + this.groupBox1.Controls.Add(this.tabControl2); + this.groupBox1.Controls.Add(this.LandlinePhone); + this.groupBox1.Controls.Add(this.lblLandlinePhone); + this.groupBox1.Controls.Add(this.BankAccount); + this.groupBox1.Controls.Add(this.lblBankAccount); + this.groupBox1.Controls.Add(this.TaxpayerNumber); + this.groupBox1.Controls.Add(this.lblTaxpayerNumber); + this.groupBox1.Controls.Add(this.Bank); + this.groupBox1.Controls.Add(this.lblBank); + this.groupBox1.Controls.Add(this.Address); + this.groupBox1.Controls.Add(this.lblAddress); + this.groupBox1.Controls.Add(this.Faxing); + this.groupBox1.Controls.Add(this.lblFaxing); + this.groupBox1.Controls.Add(this.Remark); + this.groupBox1.Controls.Add(this.lblRemark); + this.groupBox1.Controls.Add(this.Status); + this.groupBox1.Controls.Add(this.lblStatus); + this.groupBox1.Controls.Add(this.SortOrder); + this.groupBox1.Controls.Add(this.lblSortOrder); + this.groupBox1.Controls.Add(this.TaxtRate); + this.groupBox1.Controls.Add(this.lblTaxtRate); + this.groupBox1.Controls.Add(this.EndPayCollect); + this.groupBox1.Controls.Add(this.lblEndPayCollect); + this.groupBox1.Controls.Add(this.BeginCollect); + this.groupBox1.Controls.Add(this.lblBeginCollect); + this.groupBox1.Controls.Add(this.Email); + this.groupBox1.Controls.Add(this.lblEmail); + this.groupBox1.Controls.Add(this.PhoneNumber); + this.groupBox1.Controls.Add(this.lblPhoneNumber); + this.groupBox1.Controls.Add(this.ContactPerson); + this.groupBox1.Controls.Add(this.lblContactPerson); + this.groupBox1.Controls.Add(this.SupplierName); + this.groupBox1.Controls.Add(this.lblSupplierName); + this.groupBox1.Size = new System.Drawing.Size(860, 484); + this.groupBox1.Controls.SetChildIndex(this.lblSupplierName, 0); + this.groupBox1.Controls.SetChildIndex(this.SupplierName, 0); + this.groupBox1.Controls.SetChildIndex(this.lblContactPerson, 0); + this.groupBox1.Controls.SetChildIndex(this.ContactPerson, 0); + this.groupBox1.Controls.SetChildIndex(this.lblPhoneNumber, 0); + this.groupBox1.Controls.SetChildIndex(this.PhoneNumber, 0); + this.groupBox1.Controls.SetChildIndex(this.lblEmail, 0); + this.groupBox1.Controls.SetChildIndex(this.Email, 0); + this.groupBox1.Controls.SetChildIndex(this.lblBeginCollect, 0); + this.groupBox1.Controls.SetChildIndex(this.BeginCollect, 0); + this.groupBox1.Controls.SetChildIndex(this.lblEndPayCollect, 0); + this.groupBox1.Controls.SetChildIndex(this.EndPayCollect, 0); + this.groupBox1.Controls.SetChildIndex(this.lblTaxtRate, 0); + this.groupBox1.Controls.SetChildIndex(this.TaxtRate, 0); + this.groupBox1.Controls.SetChildIndex(this.lblSortOrder, 0); + this.groupBox1.Controls.SetChildIndex(this.SortOrder, 0); + this.groupBox1.Controls.SetChildIndex(this.lblStatus, 0); + this.groupBox1.Controls.SetChildIndex(this.Status, 0); + this.groupBox1.Controls.SetChildIndex(this.lblRemark, 0); + this.groupBox1.Controls.SetChildIndex(this.Remark, 0); + this.groupBox1.Controls.SetChildIndex(this.lblFaxing, 0); + this.groupBox1.Controls.SetChildIndex(this.Faxing, 0); + this.groupBox1.Controls.SetChildIndex(this.lblAddress, 0); + this.groupBox1.Controls.SetChildIndex(this.Address, 0); + this.groupBox1.Controls.SetChildIndex(this.lblBank, 0); + this.groupBox1.Controls.SetChildIndex(this.Bank, 0); + this.groupBox1.Controls.SetChildIndex(this.lblTaxpayerNumber, 0); + this.groupBox1.Controls.SetChildIndex(this.TaxpayerNumber, 0); + this.groupBox1.Controls.SetChildIndex(this.lblBankAccount, 0); + this.groupBox1.Controls.SetChildIndex(this.BankAccount, 0); + this.groupBox1.Controls.SetChildIndex(this.lblLandlinePhone, 0); + this.groupBox1.Controls.SetChildIndex(this.LandlinePhone, 0); + this.groupBox1.Controls.SetChildIndex(this.txtID, 0); + this.groupBox1.Controls.SetChildIndex(this.tabControl2, 0); + this.groupBox1.Controls.SetChildIndex(this.label15, 0); + this.groupBox1.Controls.SetChildIndex(this.label16, 0); + this.groupBox1.Controls.SetChildIndex(this.label17, 0); + this.groupBox1.Controls.SetChildIndex(this.label18, 0); + this.groupBox1.Controls.SetChildIndex(this.TotalAmountOutstanding, 0); + this.groupBox1.Controls.SetChildIndex(this.TotalAmountPaid, 0); + this.groupBox1.Controls.SetChildIndex(this.TotalAmountReturned, 0); + this.groupBox1.Controls.SetChildIndex(this.TotalPayable, 0); + // + // flowLayoutPanelTools + // + this.flowLayoutPanelTools.Size = new System.Drawing.Size(870, 27); + // + // lblSupplierName + // + this.lblSupplierName.Location = new System.Drawing.Point(10, 10); + this.lblSupplierName.Name = "lblSupplierName"; + this.lblSupplierName.Size = new System.Drawing.Size(85, 23); + this.lblSupplierName.TabIndex = 2; + this.lblSupplierName.Text = "名称"; + this.lblSupplierName.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // SupplierName + // + this.SupplierName.Location = new System.Drawing.Point(100, 10); + this.SupplierName.Name = "SupplierName"; + this.SupplierName.Size = new System.Drawing.Size(130, 23); + this.SupplierName.TabIndex = 1; + // + // lblContactPerson + // + this.lblContactPerson.Location = new System.Drawing.Point(230, 10); + this.lblContactPerson.Name = "lblContactPerson"; + this.lblContactPerson.Size = new System.Drawing.Size(85, 23); + this.lblContactPerson.TabIndex = 4; + this.lblContactPerson.Text = "联系人"; + this.lblContactPerson.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // ContactPerson + // + this.ContactPerson.Location = new System.Drawing.Point(320, 10); + this.ContactPerson.Name = "ContactPerson"; + this.ContactPerson.Size = new System.Drawing.Size(130, 23); + this.ContactPerson.TabIndex = 3; + // + // lblPhoneNumber + // + this.lblPhoneNumber.Location = new System.Drawing.Point(450, 10); + this.lblPhoneNumber.Name = "lblPhoneNumber"; + this.lblPhoneNumber.Size = new System.Drawing.Size(85, 23); + this.lblPhoneNumber.TabIndex = 6; + this.lblPhoneNumber.Text = "手机号码"; + this.lblPhoneNumber.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // PhoneNumber + // + this.PhoneNumber.Location = new System.Drawing.Point(540, 10); + this.PhoneNumber.Name = "PhoneNumber"; + this.PhoneNumber.Size = new System.Drawing.Size(130, 23); + this.PhoneNumber.TabIndex = 5; + // + // lblEmail + // + this.lblEmail.Location = new System.Drawing.Point(10, 45); + this.lblEmail.Name = "lblEmail"; + this.lblEmail.Size = new System.Drawing.Size(85, 23); + this.lblEmail.TabIndex = 8; + this.lblEmail.Text = "邮箱"; + this.lblEmail.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // Email + // + this.Email.Location = new System.Drawing.Point(100, 45); + this.Email.Name = "Email"; + this.Email.Size = new System.Drawing.Size(130, 23); + this.Email.TabIndex = 7; + // + // lblBeginCollect + // + this.lblBeginCollect.Location = new System.Drawing.Point(230, 45); + this.lblBeginCollect.Name = "lblBeginCollect"; + this.lblBeginCollect.Size = new System.Drawing.Size(85, 23); + this.lblBeginCollect.TabIndex = 10; + this.lblBeginCollect.Text = "期初应收"; + this.lblBeginCollect.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // BeginCollect + // + this.BeginCollect.Location = new System.Drawing.Point(320, 45); + this.BeginCollect.Name = "BeginCollect"; + this.BeginCollect.Size = new System.Drawing.Size(130, 23); + this.BeginCollect.TabIndex = 9; + // + // lblEndPayCollect + // + this.lblEndPayCollect.Location = new System.Drawing.Point(450, 45); + this.lblEndPayCollect.Name = "lblEndPayCollect"; + this.lblEndPayCollect.Size = new System.Drawing.Size(85, 23); + this.lblEndPayCollect.TabIndex = 12; + this.lblEndPayCollect.Text = "期末应收"; + this.lblEndPayCollect.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // EndPayCollect + // + this.EndPayCollect.Location = new System.Drawing.Point(540, 45); + this.EndPayCollect.Name = "EndPayCollect"; + this.EndPayCollect.Size = new System.Drawing.Size(130, 23); + this.EndPayCollect.TabIndex = 11; + // + // lblTaxtRate + // + this.lblTaxtRate.Location = new System.Drawing.Point(10, 80); + this.lblTaxtRate.Name = "lblTaxtRate"; + this.lblTaxtRate.Size = new System.Drawing.Size(85, 23); + this.lblTaxtRate.TabIndex = 14; + this.lblTaxtRate.Text = "税率"; + this.lblTaxtRate.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // TaxtRate + // + this.TaxtRate.Location = new System.Drawing.Point(100, 80); + this.TaxtRate.Name = "TaxtRate"; + this.TaxtRate.Size = new System.Drawing.Size(130, 23); + this.TaxtRate.TabIndex = 13; + // + // lblSortOrder + // + this.lblSortOrder.Location = new System.Drawing.Point(230, 80); + this.lblSortOrder.Name = "lblSortOrder"; + this.lblSortOrder.Size = new System.Drawing.Size(85, 23); + this.lblSortOrder.TabIndex = 16; + this.lblSortOrder.Text = "排序"; + this.lblSortOrder.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // SortOrder + // + this.SortOrder.Location = new System.Drawing.Point(320, 80); + this.SortOrder.Name = "SortOrder"; + this.SortOrder.Size = new System.Drawing.Size(130, 23); + this.SortOrder.TabIndex = 15; + // + // lblStatus + // + this.lblStatus.Location = new System.Drawing.Point(450, 80); + this.lblStatus.Name = "lblStatus"; + this.lblStatus.Size = new System.Drawing.Size(85, 23); + this.lblStatus.TabIndex = 18; + this.lblStatus.Text = "状态"; + this.lblStatus.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // Status + // + this.Status.Location = new System.Drawing.Point(540, 80); + this.Status.Name = "Status"; + this.Status.Size = new System.Drawing.Size(130, 23); + this.Status.TabIndex = 17; + this.Status.Text = "是否启用"; + // + // lblRemark + // + this.lblRemark.Location = new System.Drawing.Point(10, 115); + this.lblRemark.Name = "lblRemark"; + this.lblRemark.Size = new System.Drawing.Size(85, 23); + this.lblRemark.TabIndex = 20; + this.lblRemark.Text = "备注"; + this.lblRemark.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // Remark + // + this.Remark.Location = new System.Drawing.Point(100, 115); + this.Remark.Name = "Remark"; + this.Remark.Size = new System.Drawing.Size(130, 23); + this.Remark.TabIndex = 19; + // + // lblFaxing + // + this.lblFaxing.Location = new System.Drawing.Point(230, 115); + this.lblFaxing.Name = "lblFaxing"; + this.lblFaxing.Size = new System.Drawing.Size(85, 23); + this.lblFaxing.TabIndex = 22; + this.lblFaxing.Text = "传真"; + this.lblFaxing.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // Faxing + // + this.Faxing.Location = new System.Drawing.Point(320, 115); + this.Faxing.Name = "Faxing"; + this.Faxing.Size = new System.Drawing.Size(130, 23); + this.Faxing.TabIndex = 21; + // + // lblAddress + // + this.lblAddress.Location = new System.Drawing.Point(450, 115); + this.lblAddress.Name = "lblAddress"; + this.lblAddress.Size = new System.Drawing.Size(85, 23); + this.lblAddress.TabIndex = 24; + this.lblAddress.Text = "地址"; + this.lblAddress.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // Address + // + this.Address.Location = new System.Drawing.Point(540, 115); + this.Address.Name = "Address"; + this.Address.Size = new System.Drawing.Size(130, 23); + this.Address.TabIndex = 23; + // + // lblBank + // + this.lblBank.Location = new System.Drawing.Point(10, 150); + this.lblBank.Name = "lblBank"; + this.lblBank.Size = new System.Drawing.Size(85, 23); + this.lblBank.TabIndex = 26; + this.lblBank.Text = "开户行"; + this.lblBank.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // Bank + // + this.Bank.Location = new System.Drawing.Point(100, 150); + this.Bank.Name = "Bank"; + this.Bank.Size = new System.Drawing.Size(130, 23); + this.Bank.TabIndex = 25; + // + // lblTaxpayerNumber + // + this.lblTaxpayerNumber.Location = new System.Drawing.Point(230, 150); + this.lblTaxpayerNumber.Name = "lblTaxpayerNumber"; + this.lblTaxpayerNumber.Size = new System.Drawing.Size(85, 23); + this.lblTaxpayerNumber.TabIndex = 28; + this.lblTaxpayerNumber.Text = "纳税人识别号"; + this.lblTaxpayerNumber.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // TaxpayerNumber + // + this.TaxpayerNumber.Location = new System.Drawing.Point(320, 150); + this.TaxpayerNumber.Name = "TaxpayerNumber"; + this.TaxpayerNumber.Size = new System.Drawing.Size(130, 23); + this.TaxpayerNumber.TabIndex = 27; + // + // lblBankAccount + // + this.lblBankAccount.Location = new System.Drawing.Point(450, 150); + this.lblBankAccount.Name = "lblBankAccount"; + this.lblBankAccount.Size = new System.Drawing.Size(85, 23); + this.lblBankAccount.TabIndex = 30; + this.lblBankAccount.Text = "银行账号"; + this.lblBankAccount.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // BankAccount + // + this.BankAccount.Location = new System.Drawing.Point(540, 150); + this.BankAccount.Name = "BankAccount"; + this.BankAccount.Size = new System.Drawing.Size(130, 23); + this.BankAccount.TabIndex = 29; + // + // lblLandlinePhone + // + this.lblLandlinePhone.Location = new System.Drawing.Point(10, 185); + this.lblLandlinePhone.Name = "lblLandlinePhone"; + this.lblLandlinePhone.Size = new System.Drawing.Size(85, 23); + this.lblLandlinePhone.TabIndex = 32; + this.lblLandlinePhone.Text = "固定电话"; + this.lblLandlinePhone.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // LandlinePhone + // + this.LandlinePhone.Location = new System.Drawing.Point(100, 185); + this.LandlinePhone.Name = "LandlinePhone"; + this.LandlinePhone.Size = new System.Drawing.Size(130, 23); + this.LandlinePhone.TabIndex = 31; + // + // tabControl2 + // + this.tabControl2.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.tabControl2.Controls.Add(this.tabPage1); + this.tabControl2.Controls.Add(this.tabPage2); + this.tabControl2.Controls.Add(this.tabPage3); + this.tabControl2.Controls.Add(this.tabPage4); + this.tabControl2.Location = new System.Drawing.Point(0, 214); + this.tabControl2.Name = "tabControl2"; + this.tabControl2.SelectedIndex = 0; + this.tabControl2.Size = new System.Drawing.Size(863, 273); + this.tabControl2.TabIndex = 33; + // + // tabPage1 + // + this.tabPage1.Controls.Add(this.dataGridView1); + this.tabPage1.Location = new System.Drawing.Point(4, 26); + this.tabPage1.Name = "tabPage1"; + this.tabPage1.Padding = new System.Windows.Forms.Padding(3); + this.tabPage1.Size = new System.Drawing.Size(855, 243); + this.tabPage1.TabIndex = 0; + this.tabPage1.Text = "应付款"; + this.tabPage1.UseVisualStyleBackColor = true; + // + // dataGridView1 + // + this.dataGridView1.AllowUserToAddRows = false; + this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; + this.dataGridView1.BackgroundColor = System.Drawing.SystemColors.Control; + this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill; + this.dataGridView1.GridColor = System.Drawing.SystemColors.Control; + this.dataGridView1.Location = new System.Drawing.Point(3, 3); + this.dataGridView1.MultiSelect = false; + this.dataGridView1.Name = "dataGridView1"; + this.dataGridView1.ReadOnly = true; + this.dataGridView1.RowHeadersVisible = false; + this.dataGridView1.RowTemplate.Height = 25; + this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.dataGridView1.Size = new System.Drawing.Size(849, 237); + this.dataGridView1.TabIndex = 0; + // + // tabPage2 + // + this.tabPage2.Controls.Add(this.dataGridView2); + this.tabPage2.Location = new System.Drawing.Point(4, 26); + this.tabPage2.Name = "tabPage2"; + this.tabPage2.Padding = new System.Windows.Forms.Padding(3); + this.tabPage2.Size = new System.Drawing.Size(781, 142); + this.tabPage2.TabIndex = 1; + this.tabPage2.Text = "退货款"; + this.tabPage2.UseVisualStyleBackColor = true; + // + // dataGridView2 + // + this.dataGridView2.AllowUserToAddRows = false; + this.dataGridView2.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; + this.dataGridView2.BackgroundColor = System.Drawing.SystemColors.Control; + this.dataGridView2.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridView2.Dock = System.Windows.Forms.DockStyle.Fill; + this.dataGridView2.GridColor = System.Drawing.SystemColors.Control; + this.dataGridView2.Location = new System.Drawing.Point(3, 3); + this.dataGridView2.MultiSelect = false; + this.dataGridView2.Name = "dataGridView2"; + this.dataGridView2.ReadOnly = true; + this.dataGridView2.RowHeadersVisible = false; + this.dataGridView2.RowTemplate.Height = 25; + this.dataGridView2.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.dataGridView2.Size = new System.Drawing.Size(775, 136); + this.dataGridView2.TabIndex = 1; + // + // tabPage3 + // + this.tabPage3.Controls.Add(this.dataGridView3); + this.tabPage3.Location = new System.Drawing.Point(4, 26); + this.tabPage3.Name = "tabPage3"; + this.tabPage3.Padding = new System.Windows.Forms.Padding(3); + this.tabPage3.Size = new System.Drawing.Size(781, 142); + this.tabPage3.TabIndex = 2; + this.tabPage3.Text = "已结款"; + this.tabPage3.UseVisualStyleBackColor = true; + // + // dataGridView3 + // + this.dataGridView3.AllowUserToAddRows = false; + this.dataGridView3.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; + this.dataGridView3.BackgroundColor = System.Drawing.SystemColors.Control; + this.dataGridView3.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridView3.Dock = System.Windows.Forms.DockStyle.Fill; + this.dataGridView3.GridColor = System.Drawing.SystemColors.Control; + this.dataGridView3.Location = new System.Drawing.Point(3, 3); + this.dataGridView3.MultiSelect = false; + this.dataGridView3.Name = "dataGridView3"; + this.dataGridView3.ReadOnly = true; + this.dataGridView3.RowHeadersVisible = false; + this.dataGridView3.RowTemplate.Height = 25; + this.dataGridView3.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.dataGridView3.Size = new System.Drawing.Size(775, 136); + this.dataGridView3.TabIndex = 1; + // + // tabPage4 + // + this.tabPage4.Controls.Add(this.dataGridView4); + this.tabPage4.Location = new System.Drawing.Point(4, 26); + this.tabPage4.Name = "tabPage4"; + this.tabPage4.Padding = new System.Windows.Forms.Padding(3); + this.tabPage4.Size = new System.Drawing.Size(781, 142); + this.tabPage4.TabIndex = 3; + this.tabPage4.Text = "未结款"; + this.tabPage4.UseVisualStyleBackColor = true; + // + // dataGridView4 + // + this.dataGridView4.AllowUserToAddRows = false; + this.dataGridView4.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; + this.dataGridView4.BackgroundColor = System.Drawing.SystemColors.Control; + this.dataGridView4.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridView4.Dock = System.Windows.Forms.DockStyle.Fill; + this.dataGridView4.GridColor = System.Drawing.SystemColors.Control; + this.dataGridView4.Location = new System.Drawing.Point(3, 3); + this.dataGridView4.MultiSelect = false; + this.dataGridView4.Name = "dataGridView4"; + this.dataGridView4.ReadOnly = true; + this.dataGridView4.RowHeadersVisible = false; + this.dataGridView4.RowTemplate.Height = 25; + this.dataGridView4.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.dataGridView4.Size = new System.Drawing.Size(775, 136); + this.dataGridView4.TabIndex = 1; + // + // TotalPayable + // + this.TotalPayable.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.TotalPayable.Location = new System.Drawing.Point(767, 12); + this.TotalPayable.Name = "TotalPayable"; + this.TotalPayable.Size = new System.Drawing.Size(116, 17); + this.TotalPayable.TabIndex = 48; + this.TotalPayable.TabStop = true; + this.TotalPayable.Text = "0.00"; + this.TotalPayable.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.TotalPayable.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.TotalPayable_LinkClicked); + // + // TotalAmountReturned + // + this.TotalAmountReturned.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.TotalAmountReturned.Location = new System.Drawing.Point(767, 48); + this.TotalAmountReturned.Name = "TotalAmountReturned"; + this.TotalAmountReturned.Size = new System.Drawing.Size(115, 17); + this.TotalAmountReturned.TabIndex = 47; + this.TotalAmountReturned.TabStop = true; + this.TotalAmountReturned.Text = "0.00"; + this.TotalAmountReturned.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.TotalAmountReturned.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.TotalAmountReturned_LinkClicked); + // + // TotalAmountPaid + // + this.TotalAmountPaid.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.TotalAmountPaid.Location = new System.Drawing.Point(767, 83); + this.TotalAmountPaid.Name = "TotalAmountPaid"; + this.TotalAmountPaid.Size = new System.Drawing.Size(116, 17); + this.TotalAmountPaid.TabIndex = 46; + this.TotalAmountPaid.TabStop = true; + this.TotalAmountPaid.Text = "0.00"; + this.TotalAmountPaid.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.TotalAmountPaid.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.TotalAmountPaid_LinkClicked); + // + // TotalAmountOutstanding + // + this.TotalAmountOutstanding.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.TotalAmountOutstanding.Location = new System.Drawing.Point(767, 118); + this.TotalAmountOutstanding.Name = "TotalAmountOutstanding"; + this.TotalAmountOutstanding.Size = new System.Drawing.Size(115, 17); + this.TotalAmountOutstanding.TabIndex = 45; + this.TotalAmountOutstanding.TabStop = true; + this.TotalAmountOutstanding.Text = "0.00"; + this.TotalAmountOutstanding.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.TotalAmountOutstanding.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.TotalAmountOutstanding_LinkClicked); + // + // label18 + // + this.label18.Location = new System.Drawing.Point(676, 115); + this.label18.Name = "label18"; + this.label18.Size = new System.Drawing.Size(85, 23); + this.label18.TabIndex = 44; + this.label18.Text = "未结款总额"; + this.label18.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label17 + // + this.label17.Location = new System.Drawing.Point(676, 80); + this.label17.Name = "label17"; + this.label17.Size = new System.Drawing.Size(85, 23); + this.label17.TabIndex = 43; + this.label17.Text = "已结款总额"; + this.label17.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label16 + // + this.label16.Location = new System.Drawing.Point(676, 45); + this.label16.Name = "label16"; + this.label16.Size = new System.Drawing.Size(85, 23); + this.label16.TabIndex = 42; + this.label16.Text = "退货款总额"; + this.label16.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label15 + // + this.label15.Location = new System.Drawing.Point(676, 10); + this.label15.Name = "label15"; + this.label15.Size = new System.Drawing.Size(85, 23); + this.label15.TabIndex = 41; + this.label15.Text = "应付款总额"; + this.label15.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // Frmw_Customer + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(874, 551); + this.Name = "Frmw_Customer"; + this.Text = "Frmw_Customer"; + this.palTools.ResumeLayout(false); + this.tabControl1.ResumeLayout(false); + this.tabDataEdit.ResumeLayout(false); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.flowLayoutPanelTools.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.BeginCollect)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.EndPayCollect)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.TaxtRate)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.SortOrder)).EndInit(); + this.tabControl2.ResumeLayout(false); + this.tabPage1.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); + this.tabPage2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).EndInit(); + this.tabPage3.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView3)).EndInit(); + this.tabPage4.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView4)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + private TextBox SupplierName; + private Label lblSupplierName; + private TextBox ContactPerson; + private Label lblContactPerson; + private TextBox PhoneNumber; + private Label lblPhoneNumber; + private TextBox Email; + private Label lblEmail; + private NumericUpDown BeginCollect; + private Label lblBeginCollect; + private NumericUpDown EndPayCollect; + private Label lblEndPayCollect; + private NumericUpDown TaxtRate; + private Label lblTaxtRate; + private NumericUpDown SortOrder; + private Label lblSortOrder; + private CheckBox Status; + private Label lblStatus; + private TextBox Remark; + private Label lblRemark; + private TextBox Faxing; + private Label lblFaxing; + private TextBox Address; + private Label lblAddress; + private TextBox Bank; + private Label lblBank; + private TextBox TaxpayerNumber; + private Label lblTaxpayerNumber; + private TextBox BankAccount; + private Label lblBankAccount; + private TextBox LandlinePhone; + private Label lblLandlinePhone; + private TabControl tabControl2; + private TabPage tabPage1; + private DataGridView dataGridView1; + private TabPage tabPage2; + private DataGridView dataGridView2; + private TabPage tabPage3; + private DataGridView dataGridView3; + private TabPage tabPage4; + private DataGridView dataGridView4; + private LinkLabel TotalPayable; + private LinkLabel TotalAmountReturned; + private LinkLabel TotalAmountPaid; + private LinkLabel TotalAmountOutstanding; + private Label label18; + private Label label17; + private Label label16; + private Label label15; + } +} \ No newline at end of file diff --git a/WinformDevFramework/Pages/Basic/FrmW_Customer.cs b/WinformDevFramework/Pages/Basic/FrmW_Customer.cs new file mode 100644 index 0000000000000000000000000000000000000000..20fe69ab9f71877d09d625aec5ae99c1f4d3ba3d --- /dev/null +++ b/WinformDevFramework/Pages/Basic/FrmW_Customer.cs @@ -0,0 +1,289 @@ +using SqlSugar; +using WinformDevFramework.Core.Winform; +using WinformDevFramework.IServices; +using WinformDevFramework; + +namespace WinformDevFramework +{ + public partial class Frmw_Customer : BaseForm1 + { + private Iw_CustomerServices _w_CustomerServices; + public Frmw_Customer(Iw_CustomerServices w_CustomerServices) + { + _w_CustomerServices= w_CustomerServices; + InitializeComponent(); + } + + public override void Init() + { + base.Init(); + //查询数据 + this.dataGridViewList.DataSource = GetData(); + + // 设置隐藏列 + this.dataGridViewList.Columns["SupplierName"].HeaderText = "名称"; + this.dataGridViewList.Columns["ContactPerson"].HeaderText = "联系人"; + this.dataGridViewList.Columns["PhoneNumber"].HeaderText = "手机号码"; + this.dataGridViewList.Columns["Email"].HeaderText = "邮箱"; + this.dataGridViewList.Columns["BeginCollect"].HeaderText = "期初应收"; + this.dataGridViewList.Columns["EndPayCollect"].HeaderText = "期末应收"; + this.dataGridViewList.Columns["TaxtRate"].HeaderText = "税率"; + this.dataGridViewList.Columns["SortOrder"].HeaderText = "排序"; + this.dataGridViewList.Columns["Status"].HeaderText = "状态"; + this.dataGridViewList.Columns["Remark"].HeaderText = "备注"; + this.dataGridViewList.Columns["Faxing"].HeaderText = "传真"; + this.dataGridViewList.Columns["Address"].HeaderText = "地址"; + this.dataGridViewList.Columns["Bank"].HeaderText = "开户行"; + this.dataGridViewList.Columns["TaxpayerNumber"].HeaderText = "纳税人识别号"; + this.dataGridViewList.Columns["BankAccount"].HeaderText = "银行账号"; + this.dataGridViewList.Columns["LandlinePhone"].HeaderText = "固定电话"; + SetToolButtonStatus(formStatus); + //SetToolsButton(); + } + + public override void TabControlSelectingFunction(object? sender, TabControlCancelEventArgs e) + { + base.TabControlSelectingFunction(sender, e); + } + + public override void DataGridViewListDoubleClick(object? sender, DataGridViewCellEventArgs e) + { + base.DataGridViewListDoubleClick(sender, e); + var g = (DataGridView)sender; + var model = g.CurrentRow.DataBoundItem as w_Customer; + + //给详情页设置数据 + this.txtID.Text = model.ID.ToString(); + this.SupplierName.Text = model.SupplierName.ToString(); + this.ContactPerson.Text = model.ContactPerson.ToString(); + this.PhoneNumber.Text = model.PhoneNumber.ToString(); + this.Email.Text = model.Email.ToString(); + this.BeginCollect.Text = model.BeginCollect.ToString(); + this.EndPayCollect.Text = model.EndPayCollect.ToString(); + this.TaxtRate.Text = model.TaxtRate.ToString(); + this.SortOrder.Text = model.SortOrder.ToString(); + this.Status.Checked = model.Status.Value; + this.Remark.Text = model.Remark.ToString(); + this.Faxing.Text = model.Faxing.ToString(); + this.Address.Text = model.Address.ToString(); + this.Bank.Text = model.Bank.ToString(); + this.TaxpayerNumber.Text = model.TaxpayerNumber.ToString(); + this.BankAccount.Text = model.BankAccount.ToString(); + this.LandlinePhone.Text = model.LandlinePhone.ToString(); + SetToolButtonStatus(formStatus); + } + + public override void AddFunction(object sender, EventArgs e) + { + base.AddFunction(sender, e); + SetToolButtonStatus(formStatus); + } + + public override void EditFunction(object sender, EventArgs e) + { + base.EditFunction(sender, e); + SetToolButtonStatus(formStatus); + } + + public override void SaveFunction(object sender, EventArgs e) + { + base.SaveFunction(sender, e); + { + //新增 + if (string.IsNullOrEmpty(txtID.Text)) + { + w_Customer model = new w_Customer(); + // TODO获取界面的数据 + model.SupplierName=this.SupplierName.Text; + model.ContactPerson=this.ContactPerson.Text; + model.PhoneNumber=this.PhoneNumber.Text; + model.Email=this.Email.Text; + model.BeginCollect=this.BeginCollect.Value; + model.EndPayCollect=this.EndPayCollect.Value; + model.TaxtRate=this.TaxtRate.Value; + model.SortOrder=this.SortOrder.ToInt32(); + model.Status=this.Status.Checked; + model.Remark=this.Remark.Text; + model.Faxing=this.Faxing.Text; + model.Address=this.Address.Text; + model.Bank=this.Bank.Text; + model.TaxpayerNumber=this.TaxpayerNumber.Text; + model.BankAccount=this.BankAccount.Text; + model.LandlinePhone=this.LandlinePhone.Text; + var id = _w_CustomerServices.Insert(model); + txtID.Text = id.ToString(); + if (id > 0) + { + MessageBox.Show("保存成功!", "提示"); + } + } + // 修改 + else + { + w_Customer model = _w_CustomerServices.QueryById(int.Parse(txtID.Text)); + // TODO获取界面的数据 + model.SupplierName = this.SupplierName.Text; + model.ContactPerson = this.ContactPerson.Text; + model.PhoneNumber = this.PhoneNumber.Text; + model.Email = this.Email.Text; + model.BeginCollect = this.BeginCollect.Value; + model.EndPayCollect = this.EndPayCollect.Value; + model.TaxtRate = this.TaxtRate.Value; + model.SortOrder = int.Parse(this.SortOrder.Text); + model.Status = this.Status.Checked; + model.Remark = this.Remark.Text; + model.Faxing = this.Faxing.Text; + model.Address = this.Address.Text; + model.Bank = this.Bank.Text; + model.TaxpayerNumber = this.TaxpayerNumber.Text; + model.BankAccount = this.BankAccount.Text; + model.LandlinePhone = this.LandlinePhone.Text; + if (_w_CustomerServices.Update(model)) + { + MessageBox.Show("保存成功!", "提示"); + } + } + SetToolButtonStatus(formStatus); + //列表重新赋值 + this.dataGridViewList.DataSource = GetData(); + } + } + + public override void CanelFunction(object sender, EventArgs e) + { + bool isAdd = formStatus == FormStatus.Add; + base.CanelFunction(sender, e); + SetToolButtonStatus(formStatus); + if (isAdd) btnEdit.Enabled = false; + } + + public override void DelFunction(object sender, EventArgs e) + { + base.DelFunction(sender, e); + var result = MessageBox.Show("是否删除?", "确认", MessageBoxButtons.YesNoCancel); + if (result == DialogResult.Yes) + { + _w_CustomerServices.DeleteById(Int32.Parse(txtID.Text)); + formStatus = FormStatus.Del; + SetToolButtonStatus(formStatus); + //列表重新赋值 + this.dataGridViewList.DataSource = GetData(); + } + } + + public override void SetToolButtonStatus(FormStatus status) + { + base.SetToolButtonStatus(status); + switch (status) + { + case FormStatus.Add: + { + btnAdd.Enabled = false; + btnEdit.Enabled = false; + btnSave.Enabled = true; + btnDel.Enabled = false; + btnCanel.Enabled = true; + SetControlStatus(this.groupBox1, true); + ClearControlsText(this.groupBox1); + break; + } + case FormStatus.Edit: + { + btnAdd.Enabled = false; + btnEdit.Enabled = false; + btnSave.Enabled = true; + btnDel.Enabled = false; + btnCanel.Enabled = true; + SetControlStatus(this.groupBox1, true); + break; + } + case FormStatus.View: + { + btnAdd.Enabled = true; + btnEdit.Enabled = true; + btnSave.Enabled = false; + btnDel.Enabled = true; + btnCanel.Enabled = false; + SetControlStatus(this.groupBox1, false); + break; + } + case FormStatus.Canel: + { + btnAdd.Enabled = true; + btnEdit.Enabled = true; + btnSave.Enabled = false; + btnDel.Enabled = false; + btnCanel.Enabled = false; + SetControlStatus(this.groupBox1, false); + break; + } + case FormStatus.First: + { + btnAdd.Enabled = true; + btnEdit.Enabled = false; + btnSave.Enabled = false; + btnDel.Enabled = false; + btnCanel.Enabled = false; + SetControlStatus(this.groupBox1, false); + break; + } + case FormStatus.Save: + { + btnAdd.Enabled = true; + btnEdit.Enabled = true; + btnSave.Enabled = false; + btnDel.Enabled = true; + btnCanel.Enabled = false; + SetControlStatus(this.groupBox1, false); + break; + } + case FormStatus.Del: + { + btnAdd.Enabled = true; + btnEdit.Enabled = false; + btnSave.Enabled = false; + btnDel.Enabled = false; + btnCanel.Enabled = false; + SetControlStatus(this.groupBox1, false); + ClearControlsText(this.groupBox1); + break; + } + } + } + + public override bool ValidateData() + { + return true; + } + /// + /// 获取数据 + /// + /// + private List GetData() + { + List data = new List(); + data = _w_CustomerServices.Query(); + return data; + } + + private void TotalAmountPaid_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + tabControl2.SelectedTab = tabPage3; + } + + private void TotalPayable_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + tabControl2.SelectedTab = tabPage1; + } + + private void TotalAmountReturned_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + tabControl2.SelectedTab = tabPage2; + } + + private void TotalAmountOutstanding_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + tabControl2.SelectedTab = tabPage4; + } + } +} diff --git a/WinformDevFramework/FrmDicData.resx b/WinformDevFramework/Pages/Basic/FrmW_Customer.resx similarity index 100% rename from WinformDevFramework/FrmDicData.resx rename to WinformDevFramework/Pages/Basic/FrmW_Customer.resx diff --git a/WinformDevFramework/Pages/Basic/FrmW_SettlementAccount.Designer.cs b/WinformDevFramework/Pages/Basic/FrmW_SettlementAccount.Designer.cs new file mode 100644 index 0000000000000000000000000000000000000000..87835954c43557fc1c25fda0e66f3fb3a0ff2b8d --- /dev/null +++ b/WinformDevFramework/Pages/Basic/FrmW_SettlementAccount.Designer.cs @@ -0,0 +1,492 @@ +namespace WinformDevFramework +{ + partial class Frmw_SettlementAccount + { + /// + /// 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() + { + this.lblCode = new System.Windows.Forms.Label(); + this.Code = new System.Windows.Forms.TextBox(); + this.lblName = new System.Windows.Forms.Label(); + this.CName = new System.Windows.Forms.TextBox(); + this.lblBeginAmount = new System.Windows.Forms.Label(); + this.BeginAmount = new System.Windows.Forms.NumericUpDown(); + this.lblNowAmount = new System.Windows.Forms.Label(); + this.NowAmount = new System.Windows.Forms.NumericUpDown(); + this.lblSortOrder = new System.Windows.Forms.Label(); + this.SortOrder = new System.Windows.Forms.NumericUpDown(); + this.lblRemark = new System.Windows.Forms.Label(); + this.Remark = new System.Windows.Forms.TextBox(); + this.tabControl2 = new System.Windows.Forms.TabControl(); + this.tabPage1 = new System.Windows.Forms.TabPage(); + this.dataGridView1 = new System.Windows.Forms.DataGridView(); + this.tabPage2 = new System.Windows.Forms.TabPage(); + this.dataGridView2 = new System.Windows.Forms.DataGridView(); + this.tabPage3 = new System.Windows.Forms.TabPage(); + this.dataGridView3 = new System.Windows.Forms.DataGridView(); + this.tabPage4 = new System.Windows.Forms.TabPage(); + this.dataGridView4 = new System.Windows.Forms.DataGridView(); + this.TotalPayable = new System.Windows.Forms.LinkLabel(); + this.TotalAmountReturned = new System.Windows.Forms.LinkLabel(); + this.TotalAmountPaid = new System.Windows.Forms.LinkLabel(); + this.TotalAmountOutstanding = new System.Windows.Forms.LinkLabel(); + this.label18 = new System.Windows.Forms.Label(); + this.label17 = new System.Windows.Forms.Label(); + this.label16 = new System.Windows.Forms.Label(); + this.label15 = new System.Windows.Forms.Label(); + this.palTools.SuspendLayout(); + this.tabControl1.SuspendLayout(); + this.tabDataEdit.SuspendLayout(); + this.groupBox1.SuspendLayout(); + this.flowLayoutPanelTools.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.BeginAmount)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.NowAmount)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.SortOrder)).BeginInit(); + this.tabControl2.SuspendLayout(); + this.tabPage1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); + this.tabPage2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).BeginInit(); + this.tabPage3.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView3)).BeginInit(); + this.tabPage4.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView4)).BeginInit(); + this.SuspendLayout(); + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.TotalPayable); + this.groupBox1.Controls.Add(this.TotalAmountReturned); + this.groupBox1.Controls.Add(this.TotalAmountPaid); + this.groupBox1.Controls.Add(this.TotalAmountOutstanding); + this.groupBox1.Controls.Add(this.label18); + this.groupBox1.Controls.Add(this.label17); + this.groupBox1.Controls.Add(this.label16); + this.groupBox1.Controls.Add(this.label15); + this.groupBox1.Controls.Add(this.tabControl2); + this.groupBox1.Controls.Add(this.Remark); + this.groupBox1.Controls.Add(this.lblRemark); + this.groupBox1.Controls.Add(this.SortOrder); + this.groupBox1.Controls.Add(this.lblSortOrder); + this.groupBox1.Controls.Add(this.NowAmount); + this.groupBox1.Controls.Add(this.lblNowAmount); + this.groupBox1.Controls.Add(this.BeginAmount); + this.groupBox1.Controls.Add(this.lblBeginAmount); + this.groupBox1.Controls.Add(this.CName); + this.groupBox1.Controls.Add(this.lblName); + this.groupBox1.Controls.Add(this.Code); + this.groupBox1.Controls.Add(this.lblCode); + this.groupBox1.Controls.SetChildIndex(this.lblCode, 0); + this.groupBox1.Controls.SetChildIndex(this.Code, 0); + this.groupBox1.Controls.SetChildIndex(this.lblName, 0); + this.groupBox1.Controls.SetChildIndex(this.CName, 0); + this.groupBox1.Controls.SetChildIndex(this.lblBeginAmount, 0); + this.groupBox1.Controls.SetChildIndex(this.BeginAmount, 0); + this.groupBox1.Controls.SetChildIndex(this.lblNowAmount, 0); + this.groupBox1.Controls.SetChildIndex(this.NowAmount, 0); + this.groupBox1.Controls.SetChildIndex(this.lblSortOrder, 0); + this.groupBox1.Controls.SetChildIndex(this.SortOrder, 0); + this.groupBox1.Controls.SetChildIndex(this.lblRemark, 0); + this.groupBox1.Controls.SetChildIndex(this.Remark, 0); + this.groupBox1.Controls.SetChildIndex(this.tabControl2, 0); + this.groupBox1.Controls.SetChildIndex(this.label15, 0); + this.groupBox1.Controls.SetChildIndex(this.label16, 0); + this.groupBox1.Controls.SetChildIndex(this.label17, 0); + this.groupBox1.Controls.SetChildIndex(this.label18, 0); + this.groupBox1.Controls.SetChildIndex(this.TotalAmountOutstanding, 0); + this.groupBox1.Controls.SetChildIndex(this.TotalAmountPaid, 0); + this.groupBox1.Controls.SetChildIndex(this.TotalAmountReturned, 0); + this.groupBox1.Controls.SetChildIndex(this.TotalPayable, 0); + this.groupBox1.Controls.SetChildIndex(this.txtID, 0); + // + // lblCode + // + this.lblCode.Location = new System.Drawing.Point(10, 10); + this.lblCode.Name = "lblCode"; + this.lblCode.Size = new System.Drawing.Size(85, 23); + this.lblCode.TabIndex = 2; + this.lblCode.Text = "编号"; + this.lblCode.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // Code + // + this.Code.Location = new System.Drawing.Point(100, 10); + this.Code.Name = "Code"; + this.Code.Size = new System.Drawing.Size(130, 23); + this.Code.TabIndex = 1; + // + // lblName + // + this.lblName.Location = new System.Drawing.Point(230, 10); + this.lblName.Name = "lblName"; + this.lblName.Size = new System.Drawing.Size(85, 23); + this.lblName.TabIndex = 4; + this.lblName.Text = "名称"; + this.lblName.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // CName + // + this.CName.Location = new System.Drawing.Point(320, 10); + this.CName.Name = "CName"; + this.CName.Size = new System.Drawing.Size(130, 23); + this.CName.TabIndex = 3; + // + // lblBeginAmount + // + this.lblBeginAmount.Location = new System.Drawing.Point(230, 45); + this.lblBeginAmount.Name = "lblBeginAmount"; + this.lblBeginAmount.Size = new System.Drawing.Size(85, 23); + this.lblBeginAmount.TabIndex = 6; + this.lblBeginAmount.Text = "期初金额"; + this.lblBeginAmount.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // BeginAmount + // + this.BeginAmount.Location = new System.Drawing.Point(320, 45); + this.BeginAmount.Name = "BeginAmount"; + this.BeginAmount.Size = new System.Drawing.Size(130, 23); + this.BeginAmount.TabIndex = 5; + // + // lblNowAmount + // + this.lblNowAmount.Location = new System.Drawing.Point(10, 45); + this.lblNowAmount.Name = "lblNowAmount"; + this.lblNowAmount.Size = new System.Drawing.Size(85, 23); + this.lblNowAmount.TabIndex = 8; + this.lblNowAmount.Text = "当前余额"; + this.lblNowAmount.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // NowAmount + // + this.NowAmount.Location = new System.Drawing.Point(100, 45); + this.NowAmount.Name = "NowAmount"; + this.NowAmount.Size = new System.Drawing.Size(130, 23); + this.NowAmount.TabIndex = 7; + // + // lblSortOrder + // + this.lblSortOrder.Location = new System.Drawing.Point(10, 82); + this.lblSortOrder.Name = "lblSortOrder"; + this.lblSortOrder.Size = new System.Drawing.Size(85, 23); + this.lblSortOrder.TabIndex = 10; + this.lblSortOrder.Text = "排序"; + this.lblSortOrder.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // SortOrder + // + this.SortOrder.Location = new System.Drawing.Point(100, 82); + this.SortOrder.Name = "SortOrder"; + this.SortOrder.Size = new System.Drawing.Size(130, 23); + this.SortOrder.TabIndex = 9; + // + // lblRemark + // + this.lblRemark.Location = new System.Drawing.Point(230, 82); + this.lblRemark.Name = "lblRemark"; + this.lblRemark.Size = new System.Drawing.Size(85, 23); + this.lblRemark.TabIndex = 12; + this.lblRemark.Text = "备注"; + this.lblRemark.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // Remark + // + this.Remark.Location = new System.Drawing.Point(320, 82); + this.Remark.Name = "Remark"; + this.Remark.Size = new System.Drawing.Size(130, 23); + this.Remark.TabIndex = 11; + // + // tabControl2 + // + this.tabControl2.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.tabControl2.Controls.Add(this.tabPage1); + this.tabControl2.Controls.Add(this.tabPage2); + this.tabControl2.Controls.Add(this.tabPage3); + this.tabControl2.Controls.Add(this.tabPage4); + this.tabControl2.Location = new System.Drawing.Point(0, 144); + this.tabControl2.Name = "tabControl2"; + this.tabControl2.SelectedIndex = 0; + this.tabControl2.Size = new System.Drawing.Size(786, 242); + this.tabControl2.TabIndex = 34; + // + // tabPage1 + // + this.tabPage1.Controls.Add(this.dataGridView1); + this.tabPage1.Location = new System.Drawing.Point(4, 26); + this.tabPage1.Name = "tabPage1"; + this.tabPage1.Padding = new System.Windows.Forms.Padding(3); + this.tabPage1.Size = new System.Drawing.Size(778, 212); + this.tabPage1.TabIndex = 0; + this.tabPage1.Text = "收款"; + this.tabPage1.UseVisualStyleBackColor = true; + // + // dataGridView1 + // + this.dataGridView1.AllowUserToAddRows = false; + this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; + this.dataGridView1.BackgroundColor = System.Drawing.SystemColors.Control; + this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill; + this.dataGridView1.GridColor = System.Drawing.SystemColors.Control; + this.dataGridView1.Location = new System.Drawing.Point(3, 3); + this.dataGridView1.MultiSelect = false; + this.dataGridView1.Name = "dataGridView1"; + this.dataGridView1.ReadOnly = true; + this.dataGridView1.RowHeadersVisible = false; + this.dataGridView1.RowTemplate.Height = 25; + this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.dataGridView1.Size = new System.Drawing.Size(772, 206); + this.dataGridView1.TabIndex = 0; + // + // tabPage2 + // + this.tabPage2.Controls.Add(this.dataGridView2); + this.tabPage2.Location = new System.Drawing.Point(4, 26); + this.tabPage2.Name = "tabPage2"; + this.tabPage2.Padding = new System.Windows.Forms.Padding(3); + this.tabPage2.Size = new System.Drawing.Size(778, 212); + this.tabPage2.TabIndex = 1; + this.tabPage2.Text = "付款"; + this.tabPage2.UseVisualStyleBackColor = true; + // + // dataGridView2 + // + this.dataGridView2.AllowUserToAddRows = false; + this.dataGridView2.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; + this.dataGridView2.BackgroundColor = System.Drawing.SystemColors.Control; + this.dataGridView2.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridView2.Dock = System.Windows.Forms.DockStyle.Fill; + this.dataGridView2.GridColor = System.Drawing.SystemColors.Control; + this.dataGridView2.Location = new System.Drawing.Point(3, 3); + this.dataGridView2.MultiSelect = false; + this.dataGridView2.Name = "dataGridView2"; + this.dataGridView2.ReadOnly = true; + this.dataGridView2.RowHeadersVisible = false; + this.dataGridView2.RowTemplate.Height = 25; + this.dataGridView2.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.dataGridView2.Size = new System.Drawing.Size(772, 206); + this.dataGridView2.TabIndex = 1; + // + // tabPage3 + // + this.tabPage3.Controls.Add(this.dataGridView3); + this.tabPage3.Location = new System.Drawing.Point(4, 26); + this.tabPage3.Name = "tabPage3"; + this.tabPage3.Padding = new System.Windows.Forms.Padding(3); + this.tabPage3.Size = new System.Drawing.Size(778, 212); + this.tabPage3.TabIndex = 2; + this.tabPage3.Text = "其他收入"; + this.tabPage3.UseVisualStyleBackColor = true; + // + // dataGridView3 + // + this.dataGridView3.AllowUserToAddRows = false; + this.dataGridView3.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; + this.dataGridView3.BackgroundColor = System.Drawing.SystemColors.Control; + this.dataGridView3.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridView3.Dock = System.Windows.Forms.DockStyle.Fill; + this.dataGridView3.GridColor = System.Drawing.SystemColors.Control; + this.dataGridView3.Location = new System.Drawing.Point(3, 3); + this.dataGridView3.MultiSelect = false; + this.dataGridView3.Name = "dataGridView3"; + this.dataGridView3.ReadOnly = true; + this.dataGridView3.RowHeadersVisible = false; + this.dataGridView3.RowTemplate.Height = 25; + this.dataGridView3.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.dataGridView3.Size = new System.Drawing.Size(772, 206); + this.dataGridView3.TabIndex = 1; + // + // tabPage4 + // + this.tabPage4.Controls.Add(this.dataGridView4); + this.tabPage4.Location = new System.Drawing.Point(4, 26); + this.tabPage4.Name = "tabPage4"; + this.tabPage4.Padding = new System.Windows.Forms.Padding(3); + this.tabPage4.Size = new System.Drawing.Size(778, 212); + this.tabPage4.TabIndex = 3; + this.tabPage4.Text = "其他支出"; + this.tabPage4.UseVisualStyleBackColor = true; + // + // dataGridView4 + // + this.dataGridView4.AllowUserToAddRows = false; + this.dataGridView4.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; + this.dataGridView4.BackgroundColor = System.Drawing.SystemColors.Control; + this.dataGridView4.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridView4.Dock = System.Windows.Forms.DockStyle.Fill; + this.dataGridView4.GridColor = System.Drawing.SystemColors.Control; + this.dataGridView4.Location = new System.Drawing.Point(3, 3); + this.dataGridView4.MultiSelect = false; + this.dataGridView4.Name = "dataGridView4"; + this.dataGridView4.ReadOnly = true; + this.dataGridView4.RowHeadersVisible = false; + this.dataGridView4.RowTemplate.Height = 25; + this.dataGridView4.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.dataGridView4.Size = new System.Drawing.Size(772, 206); + this.dataGridView4.TabIndex = 1; + // + // TotalPayable + // + this.TotalPayable.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.TotalPayable.Location = new System.Drawing.Point(597, 12); + this.TotalPayable.Name = "TotalPayable"; + this.TotalPayable.Size = new System.Drawing.Size(116, 17); + this.TotalPayable.TabIndex = 48; + this.TotalPayable.TabStop = true; + this.TotalPayable.Text = "0.00"; + this.TotalPayable.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // TotalAmountReturned + // + this.TotalAmountReturned.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.TotalAmountReturned.Location = new System.Drawing.Point(597, 45); + this.TotalAmountReturned.Name = "TotalAmountReturned"; + this.TotalAmountReturned.Size = new System.Drawing.Size(115, 17); + this.TotalAmountReturned.TabIndex = 47; + this.TotalAmountReturned.TabStop = true; + this.TotalAmountReturned.Text = "0.00"; + this.TotalAmountReturned.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // TotalAmountPaid + // + this.TotalAmountPaid.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.TotalAmountPaid.Location = new System.Drawing.Point(596, 82); + this.TotalAmountPaid.Name = "TotalAmountPaid"; + this.TotalAmountPaid.Size = new System.Drawing.Size(116, 17); + this.TotalAmountPaid.TabIndex = 46; + this.TotalAmountPaid.TabStop = true; + this.TotalAmountPaid.Text = "0.00"; + this.TotalAmountPaid.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // TotalAmountOutstanding + // + this.TotalAmountOutstanding.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.TotalAmountOutstanding.Location = new System.Drawing.Point(596, 121); + this.TotalAmountOutstanding.Name = "TotalAmountOutstanding"; + this.TotalAmountOutstanding.Size = new System.Drawing.Size(115, 17); + this.TotalAmountOutstanding.TabIndex = 45; + this.TotalAmountOutstanding.TabStop = true; + this.TotalAmountOutstanding.Text = "0.00"; + this.TotalAmountOutstanding.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // label18 + // + this.label18.Location = new System.Drawing.Point(505, 118); + this.label18.Name = "label18"; + this.label18.Size = new System.Drawing.Size(85, 23); + this.label18.TabIndex = 44; + this.label18.Text = "未结款总额"; + this.label18.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label17 + // + this.label17.Location = new System.Drawing.Point(505, 79); + this.label17.Name = "label17"; + this.label17.Size = new System.Drawing.Size(85, 23); + this.label17.TabIndex = 43; + this.label17.Text = "已结款总额"; + this.label17.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label16 + // + this.label16.Location = new System.Drawing.Point(506, 42); + this.label16.Name = "label16"; + this.label16.Size = new System.Drawing.Size(85, 23); + this.label16.TabIndex = 42; + this.label16.Text = "退货款总额"; + this.label16.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label15 + // + this.label15.Location = new System.Drawing.Point(506, 10); + this.label15.Name = "label15"; + this.label15.Size = new System.Drawing.Size(85, 23); + this.label15.TabIndex = 41; + this.label15.Text = "应付款总额"; + this.label15.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // Frmw_SettlementAccount + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(800, 450); + this.Name = "Frmw_SettlementAccount"; + this.Text = "Frmw_SettlementAccount"; + this.palTools.ResumeLayout(false); + this.tabControl1.ResumeLayout(false); + this.tabDataEdit.ResumeLayout(false); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.flowLayoutPanelTools.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.BeginAmount)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.NowAmount)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.SortOrder)).EndInit(); + this.tabControl2.ResumeLayout(false); + this.tabPage1.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); + this.tabPage2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).EndInit(); + this.tabPage3.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView3)).EndInit(); + this.tabPage4.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView4)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + private TextBox Code; + private Label lblCode; + private TextBox CName; + private Label lblName; + private NumericUpDown BeginAmount; + private Label lblBeginAmount; + private NumericUpDown NowAmount; + private Label lblNowAmount; + private NumericUpDown SortOrder; + private Label lblSortOrder; + private TextBox Remark; + private Label lblRemark; + private TabControl tabControl2; + private TabPage tabPage1; + private DataGridView dataGridView1; + private TabPage tabPage2; + private DataGridView dataGridView2; + private TabPage tabPage3; + private DataGridView dataGridView3; + private TabPage tabPage4; + private DataGridView dataGridView4; + private LinkLabel TotalPayable; + private LinkLabel TotalAmountReturned; + private LinkLabel TotalAmountPaid; + private LinkLabel TotalAmountOutstanding; + private Label label18; + private Label label17; + private Label label16; + private Label label15; + } +} \ No newline at end of file diff --git a/WinformDevFramework/Pages/Basic/FrmW_SettlementAccount.cs b/WinformDevFramework/Pages/Basic/FrmW_SettlementAccount.cs new file mode 100644 index 0000000000000000000000000000000000000000..2b45e6454c5dab0f6b770161ec5c8eaa13a6ad66 --- /dev/null +++ b/WinformDevFramework/Pages/Basic/FrmW_SettlementAccount.cs @@ -0,0 +1,239 @@ +using SqlSugar; +using WinformDevFramework.Core.Winform; +using WinformDevFramework.IServices; +using WinformDevFramework; + +namespace WinformDevFramework +{ + public partial class Frmw_SettlementAccount : BaseForm1 + { + private Iw_SettlementAccountServices _w_SettlementAccountServices; + public Frmw_SettlementAccount(Iw_SettlementAccountServices w_SettlementAccountServices) + { + _w_SettlementAccountServices= w_SettlementAccountServices; + InitializeComponent(); + } + + public override void Init() + { + base.Init(); + //查询数据 + this.dataGridViewList.DataSource = GetData(); + + // 设置隐藏列 + this.dataGridViewList.Columns["Code"].HeaderText = "编号"; + this.dataGridViewList.Columns["Name"].HeaderText = "名称"; + this.dataGridViewList.Columns["BeginAmount"].HeaderText = "期初金额"; + this.dataGridViewList.Columns["NowAmount"].HeaderText = "当前余额"; + this.dataGridViewList.Columns["SortOrder"].HeaderText = "排序"; + this.dataGridViewList.Columns["Remark"].HeaderText = "备注"; + SetToolButtonStatus(formStatus); + //SetToolsButton(); + } + + public override void TabControlSelectingFunction(object? sender, TabControlCancelEventArgs e) + { + base.TabControlSelectingFunction(sender, e); + } + + public override void DataGridViewListDoubleClick(object? sender, DataGridViewCellEventArgs e) + { + base.DataGridViewListDoubleClick(sender, e); + var g = (DataGridView)sender; + var model = g.CurrentRow.DataBoundItem as w_SettlementAccount; + + //给详情页设置数据 + this.txtID.Text = model.ID.ToString(); + this.Code.Text = model.Code.ToString(); + this.CName.Text = model.Name.ToString(); + this.BeginAmount.Text = model.BeginAmount.ToString(); + this.NowAmount.Text = model.NowAmount.ToString(); + this.SortOrder.Text = model.SortOrder.ToString(); + this.Remark.Text = model.Remark.ToString(); + SetToolButtonStatus(formStatus); + } + + public override void AddFunction(object sender, EventArgs e) + { + base.AddFunction(sender, e); + SetToolButtonStatus(formStatus); + } + + public override void EditFunction(object sender, EventArgs e) + { + base.EditFunction(sender, e); + SetToolButtonStatus(formStatus); + } + + public override void SaveFunction(object sender, EventArgs e) + { + base.SaveFunction(sender, e); + { + //新增 + if (string.IsNullOrEmpty(txtID.Text)) + { + w_SettlementAccount model = new w_SettlementAccount(); + // TODO获取界面的数据 + model.Code=this.Code.Text; + model.Name=this.CName.Text; + model.BeginAmount=this.BeginAmount.Value; + model.NowAmount=this.NowAmount.Value; + model.SortOrder=this.SortOrder.ToInt32(); + model.Remark=this.Remark.Text; + var id = _w_SettlementAccountServices.Insert(model); + txtID.Text = id.ToString(); + if (id > 0) + { + MessageBox.Show("保存成功!", "提示"); + } + } + // 修改 + else + { + w_SettlementAccount model = _w_SettlementAccountServices.QueryById(int.Parse(txtID.Text)); + // TODO获取界面的数据 + model.Code = this.Code.Text; + model.Name = this.CName.Text; + model.BeginAmount = this.BeginAmount.Value; + model.NowAmount = this.NowAmount.Value; + model.SortOrder = this.SortOrder.ToInt32(); + model.Remark=this.Remark.Text; + if (_w_SettlementAccountServices.Update(model)) + { + MessageBox.Show("保存成功!", "提示"); + } + } + SetToolButtonStatus(formStatus); + //列表重新赋值 + this.dataGridViewList.DataSource = GetData(); + } + } + + public override void CanelFunction(object sender, EventArgs e) + { + bool isAdd = formStatus == FormStatus.Add; + base.CanelFunction(sender, e); + SetToolButtonStatus(formStatus); + if (isAdd) btnEdit.Enabled = false; + } + + public override void DelFunction(object sender, EventArgs e) + { + base.DelFunction(sender, e); + var result = MessageBox.Show("是否删除?", "确认", MessageBoxButtons.YesNoCancel); + if (result == DialogResult.Yes) + { + _w_SettlementAccountServices.DeleteById(Int32.Parse(txtID.Text)); + formStatus = FormStatus.Del; + SetToolButtonStatus(formStatus); + //列表重新赋值 + this.dataGridViewList.DataSource = GetData(); + } + } + + public override void SetToolButtonStatus(FormStatus status) + { + base.SetToolButtonStatus(status); + switch (status) + { + case FormStatus.Add: + { + btnAdd.Enabled = false; + btnEdit.Enabled = false; + btnSave.Enabled = true; + btnDel.Enabled = false; + btnCanel.Enabled = true; + SetControlStatus(this.groupBox1, true); + ClearControlsText(this.groupBox1); + break; + } + case FormStatus.Edit: + { + btnAdd.Enabled = false; + btnEdit.Enabled = false; + btnSave.Enabled = true; + btnDel.Enabled = false; + btnCanel.Enabled = true; + SetControlStatus(this.groupBox1, true); + break; + } + case FormStatus.View: + { + btnAdd.Enabled = true; + btnEdit.Enabled = true; + btnSave.Enabled = false; + btnDel.Enabled = true; + btnCanel.Enabled = false; + SetControlStatus(this.groupBox1, false); + break; + } + case FormStatus.Canel: + { + btnAdd.Enabled = true; + btnEdit.Enabled = true; + btnSave.Enabled = false; + btnDel.Enabled = false; + btnCanel.Enabled = false; + SetControlStatus(this.groupBox1, false); + break; + } + case FormStatus.First: + { + btnAdd.Enabled = true; + btnEdit.Enabled = false; + btnSave.Enabled = false; + btnDel.Enabled = false; + btnCanel.Enabled = false; + SetControlStatus(this.groupBox1, false); + break; + } + case FormStatus.Save: + { + btnAdd.Enabled = true; + btnEdit.Enabled = true; + btnSave.Enabled = false; + btnDel.Enabled = true; + btnCanel.Enabled = false; + SetControlStatus(this.groupBox1, false); + break; + } + case FormStatus.Del: + { + btnAdd.Enabled = true; + btnEdit.Enabled = false; + btnSave.Enabled = false; + btnDel.Enabled = false; + btnCanel.Enabled = false; + SetControlStatus(this.groupBox1, false); + ClearControlsText(this.groupBox1); + break; + } + } + } + + public override bool ValidateData() + { + if (string.IsNullOrEmpty(Code.Text)) + { + MessageBox.Show("Code不能为空!"); + return false; + } + if (string.IsNullOrEmpty(CName.Text)) + { + MessageBox.Show("Name不能为空!"); + return false; + } + return true; + } + /// + /// 获取数据 + /// + /// + private List GetData() + { + List data = new List(); + data = _w_SettlementAccountServices.Query(); + return data; + } + } +} diff --git a/WinformDevFramework/System/FrmCreateCode.resx b/WinformDevFramework/Pages/Basic/FrmW_SettlementAccount.resx similarity index 100% rename from WinformDevFramework/System/FrmCreateCode.resx rename to WinformDevFramework/Pages/Basic/FrmW_SettlementAccount.resx diff --git a/WinformDevFramework/Pages/Basic/FrmW_Warehourses.Designer.cs b/WinformDevFramework/Pages/Basic/FrmW_Warehourses.Designer.cs new file mode 100644 index 0000000000000000000000000000000000000000..330415c5f96167d17c4b11fbe501467c58d96e0b --- /dev/null +++ b/WinformDevFramework/Pages/Basic/FrmW_Warehourses.Designer.cs @@ -0,0 +1,338 @@ +namespace WinformDevFramework +{ + partial class Frmw_Warehourses + { + /// + /// 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() + { + this.lblWarehousesName = new System.Windows.Forms.Label(); + this.WarehousesName = new System.Windows.Forms.TextBox(); + this.lblAddress = new System.Windows.Forms.Label(); + this.Address = new System.Windows.Forms.TextBox(); + this.lblStorageFee = new System.Windows.Forms.Label(); + this.StorageFee = new System.Windows.Forms.NumericUpDown(); + this.lblChargePersonID = new System.Windows.Forms.Label(); + this.lblSortOrder = new System.Windows.Forms.Label(); + this.SortOrder = new System.Windows.Forms.NumericUpDown(); + this.lblRemark = new System.Windows.Forms.Label(); + this.Remark = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.tabControl2 = new System.Windows.Forms.TabControl(); + this.tabPage1 = new System.Windows.Forms.TabPage(); + this.dataGridView1 = new System.Windows.Forms.DataGridView(); + this.tabPage2 = new System.Windows.Forms.TabPage(); + this.dataGridView2 = new System.Windows.Forms.DataGridView(); + this.comboBoxPerson = new System.Windows.Forms.ComboBox(); + this.palTools.SuspendLayout(); + this.tabControl1.SuspendLayout(); + this.tabDataEdit.SuspendLayout(); + this.groupBox1.SuspendLayout(); + this.flowLayoutPanelTools.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.StorageFee)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.SortOrder)).BeginInit(); + this.tabControl2.SuspendLayout(); + this.tabPage1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); + this.tabPage2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).BeginInit(); + this.SuspendLayout(); + // + // palTools + // + this.palTools.Size = new System.Drawing.Size(810, 31); + // + // tabControl1 + // + this.tabControl1.Size = new System.Drawing.Size(810, 510); + // + // tabList + // + this.tabList.Size = new System.Drawing.Size(802, 480); + // + // tabDataEdit + // + this.tabDataEdit.Size = new System.Drawing.Size(802, 480); + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.comboBoxPerson); + this.groupBox1.Controls.Add(this.tabControl2); + this.groupBox1.Controls.Add(this.label1); + this.groupBox1.Controls.Add(this.Remark); + this.groupBox1.Controls.Add(this.lblRemark); + this.groupBox1.Controls.Add(this.SortOrder); + this.groupBox1.Controls.Add(this.lblSortOrder); + this.groupBox1.Controls.Add(this.lblChargePersonID); + this.groupBox1.Controls.Add(this.StorageFee); + this.groupBox1.Controls.Add(this.lblStorageFee); + this.groupBox1.Controls.Add(this.Address); + this.groupBox1.Controls.Add(this.lblAddress); + this.groupBox1.Controls.Add(this.WarehousesName); + this.groupBox1.Controls.Add(this.lblWarehousesName); + this.groupBox1.Size = new System.Drawing.Size(796, 474); + this.groupBox1.Controls.SetChildIndex(this.lblWarehousesName, 0); + this.groupBox1.Controls.SetChildIndex(this.WarehousesName, 0); + this.groupBox1.Controls.SetChildIndex(this.lblAddress, 0); + this.groupBox1.Controls.SetChildIndex(this.Address, 0); + this.groupBox1.Controls.SetChildIndex(this.lblStorageFee, 0); + this.groupBox1.Controls.SetChildIndex(this.StorageFee, 0); + this.groupBox1.Controls.SetChildIndex(this.lblChargePersonID, 0); + this.groupBox1.Controls.SetChildIndex(this.lblSortOrder, 0); + this.groupBox1.Controls.SetChildIndex(this.SortOrder, 0); + this.groupBox1.Controls.SetChildIndex(this.lblRemark, 0); + this.groupBox1.Controls.SetChildIndex(this.Remark, 0); + this.groupBox1.Controls.SetChildIndex(this.txtID, 0); + this.groupBox1.Controls.SetChildIndex(this.label1, 0); + this.groupBox1.Controls.SetChildIndex(this.tabControl2, 0); + this.groupBox1.Controls.SetChildIndex(this.comboBoxPerson, 0); + // + // flowLayoutPanelTools + // + this.flowLayoutPanelTools.Size = new System.Drawing.Size(806, 27); + // + // lblWarehousesName + // + this.lblWarehousesName.Location = new System.Drawing.Point(10, 32); + this.lblWarehousesName.Name = "lblWarehousesName"; + this.lblWarehousesName.Size = new System.Drawing.Size(100, 23); + this.lblWarehousesName.TabIndex = 2; + this.lblWarehousesName.Text = "仓库名称"; + this.lblWarehousesName.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // WarehousesName + // + this.WarehousesName.Location = new System.Drawing.Point(115, 32); + this.WarehousesName.Name = "WarehousesName"; + this.WarehousesName.Size = new System.Drawing.Size(150, 23); + this.WarehousesName.TabIndex = 1; + // + // lblAddress + // + this.lblAddress.Location = new System.Drawing.Point(265, 32); + this.lblAddress.Name = "lblAddress"; + this.lblAddress.Size = new System.Drawing.Size(100, 23); + this.lblAddress.TabIndex = 4; + this.lblAddress.Text = "地址"; + this.lblAddress.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // Address + // + this.Address.Location = new System.Drawing.Point(370, 32); + this.Address.Name = "Address"; + this.Address.Size = new System.Drawing.Size(155, 23); + this.Address.TabIndex = 3; + // + // lblStorageFee + // + this.lblStorageFee.Location = new System.Drawing.Point(10, 75); + this.lblStorageFee.Name = "lblStorageFee"; + this.lblStorageFee.Size = new System.Drawing.Size(100, 23); + this.lblStorageFee.TabIndex = 6; + this.lblStorageFee.Text = "仓储费"; + this.lblStorageFee.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // StorageFee + // + this.StorageFee.Location = new System.Drawing.Point(115, 75); + this.StorageFee.Name = "StorageFee"; + this.StorageFee.Size = new System.Drawing.Size(100, 23); + this.StorageFee.TabIndex = 5; + // + // lblChargePersonID + // + this.lblChargePersonID.Location = new System.Drawing.Point(522, 32); + this.lblChargePersonID.Name = "lblChargePersonID"; + this.lblChargePersonID.Size = new System.Drawing.Size(100, 23); + this.lblChargePersonID.TabIndex = 8; + this.lblChargePersonID.Text = "负责人"; + this.lblChargePersonID.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // lblSortOrder + // + this.lblSortOrder.Location = new System.Drawing.Point(265, 76); + this.lblSortOrder.Name = "lblSortOrder"; + this.lblSortOrder.Size = new System.Drawing.Size(100, 23); + this.lblSortOrder.TabIndex = 10; + this.lblSortOrder.Text = "排序"; + this.lblSortOrder.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // SortOrder + // + this.SortOrder.Location = new System.Drawing.Point(370, 76); + this.SortOrder.Name = "SortOrder"; + this.SortOrder.Size = new System.Drawing.Size(100, 23); + this.SortOrder.TabIndex = 9; + // + // lblRemark + // + this.lblRemark.Location = new System.Drawing.Point(10, 120); + this.lblRemark.Name = "lblRemark"; + this.lblRemark.Size = new System.Drawing.Size(100, 23); + this.lblRemark.TabIndex = 12; + this.lblRemark.Text = "备注"; + this.lblRemark.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // Remark + // + this.Remark.Location = new System.Drawing.Point(115, 120); + this.Remark.Name = "Remark"; + this.Remark.Size = new System.Drawing.Size(410, 23); + this.Remark.TabIndex = 11; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(218, 78); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(37, 17); + this.label1.TabIndex = 13; + this.label1.Text = "元/天"; + // + // tabControl2 + // + this.tabControl2.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.tabControl2.Controls.Add(this.tabPage1); + this.tabControl2.Controls.Add(this.tabPage2); + this.tabControl2.Location = new System.Drawing.Point(0, 149); + this.tabControl2.Name = "tabControl2"; + this.tabControl2.SelectedIndex = 0; + this.tabControl2.Size = new System.Drawing.Size(799, 328); + this.tabControl2.TabIndex = 14; + // + // tabPage1 + // + this.tabPage1.Controls.Add(this.dataGridView1); + this.tabPage1.Location = new System.Drawing.Point(4, 26); + this.tabPage1.Name = "tabPage1"; + this.tabPage1.Padding = new System.Windows.Forms.Padding(3); + this.tabPage1.Size = new System.Drawing.Size(791, 298); + this.tabPage1.TabIndex = 0; + this.tabPage1.Text = "仓储明细"; + this.tabPage1.UseVisualStyleBackColor = true; + // + // dataGridView1 + // + this.dataGridView1.AllowUserToAddRows = false; + this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; + this.dataGridView1.BackgroundColor = System.Drawing.SystemColors.Control; + this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill; + this.dataGridView1.GridColor = System.Drawing.SystemColors.Control; + this.dataGridView1.Location = new System.Drawing.Point(3, 3); + this.dataGridView1.MultiSelect = false; + this.dataGridView1.Name = "dataGridView1"; + this.dataGridView1.ReadOnly = true; + this.dataGridView1.RowHeadersVisible = false; + this.dataGridView1.RowTemplate.Height = 25; + this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.dataGridView1.Size = new System.Drawing.Size(785, 292); + this.dataGridView1.TabIndex = 1; + // + // tabPage2 + // + this.tabPage2.Controls.Add(this.dataGridView2); + this.tabPage2.Location = new System.Drawing.Point(4, 26); + this.tabPage2.Name = "tabPage2"; + this.tabPage2.Padding = new System.Windows.Forms.Padding(3); + this.tabPage2.Size = new System.Drawing.Size(791, 298); + this.tabPage2.TabIndex = 1; + this.tabPage2.Text = "出入库记录"; + this.tabPage2.UseVisualStyleBackColor = true; + // + // dataGridView2 + // + this.dataGridView2.AllowUserToAddRows = false; + this.dataGridView2.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; + this.dataGridView2.BackgroundColor = System.Drawing.SystemColors.Control; + this.dataGridView2.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridView2.Dock = System.Windows.Forms.DockStyle.Fill; + this.dataGridView2.GridColor = System.Drawing.SystemColors.Control; + this.dataGridView2.Location = new System.Drawing.Point(3, 3); + this.dataGridView2.MultiSelect = false; + this.dataGridView2.Name = "dataGridView2"; + this.dataGridView2.ReadOnly = true; + this.dataGridView2.RowHeadersVisible = false; + this.dataGridView2.RowTemplate.Height = 25; + this.dataGridView2.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.dataGridView2.Size = new System.Drawing.Size(785, 292); + this.dataGridView2.TabIndex = 1; + // + // comboBoxPerson + // + this.comboBoxPerson.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxPerson.FormattingEnabled = true; + this.comboBoxPerson.Location = new System.Drawing.Point(628, 30); + this.comboBoxPerson.Name = "comboBoxPerson"; + this.comboBoxPerson.Size = new System.Drawing.Size(122, 25); + this.comboBoxPerson.TabIndex = 15; + // + // Frmw_Warehourses + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(810, 541); + this.Name = "Frmw_Warehourses"; + this.Text = "Frmw_Warehourses"; + this.palTools.ResumeLayout(false); + this.tabControl1.ResumeLayout(false); + this.tabDataEdit.ResumeLayout(false); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.flowLayoutPanelTools.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.StorageFee)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.SortOrder)).EndInit(); + this.tabControl2.ResumeLayout(false); + this.tabPage1.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); + this.tabPage2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + private TextBox WarehousesName; + private Label lblWarehousesName; + private TextBox Address; + private Label lblAddress; + private NumericUpDown StorageFee; + private Label lblStorageFee; + private Label lblChargePersonID; + private NumericUpDown SortOrder; + private Label lblSortOrder; + private TextBox Remark; + private Label lblRemark; + private Label label1; + private TabControl tabControl2; + private TabPage tabPage1; + private TabPage tabPage2; + private DataGridView dataGridView1; + private DataGridView dataGridView2; + private ComboBox comboBoxPerson; + } +} \ No newline at end of file diff --git a/WinformDevFramework/Pages/Basic/FrmW_Warehourses.cs b/WinformDevFramework/Pages/Basic/FrmW_Warehourses.cs new file mode 100644 index 0000000000000000000000000000000000000000..89867441e9ce8549b9bd78bcbfb5774b1dd271a0 --- /dev/null +++ b/WinformDevFramework/Pages/Basic/FrmW_Warehourses.cs @@ -0,0 +1,234 @@ +using SqlSugar; +using WinformDevFramework.Core.Winform; +using WinformDevFramework.IServices; +using WinformDevFramework; +using WinformDevFramework.IServices.System; + +namespace WinformDevFramework +{ + public partial class Frmw_Warehourses : BaseForm1 + { + private Iw_WarehoursesServices _w_WarehoursesServices; + private ISysUserServices _sysUserServices; + public Frmw_Warehourses(Iw_WarehoursesServices w_WarehoursesServices, ISysUserServices sysUserServices) + { + _w_WarehoursesServices= w_WarehoursesServices; + _sysUserServices= sysUserServices; + InitializeComponent(); + } + + public override void Init() + { + base.Init(); + //查询数据 + this.dataGridViewList.DataSource = _w_WarehoursesServices.Query(); + + this.comboBoxPerson.DataSource = _sysUserServices.Query(); + comboBoxPerson.ValueMember = "ID"; + comboBoxPerson.DisplayMember = "Fullname"; + // 设置隐藏列 + this.dataGridViewList.Columns["WarehousesName"].HeaderText = "仓库名称"; + this.dataGridViewList.Columns["Address"].HeaderText = "地址"; + this.dataGridViewList.Columns["StorageFee"].HeaderText = "仓储费"; + //this.dataGridViewList.Columns["ChargePerson"].HeaderText = "负责人"; + this.dataGridViewList.Columns["ChargePersonID"].Visible = false; + this.dataGridViewList.Columns["SortOrder"].HeaderText = "排序"; + this.dataGridViewList.Columns["Remark"].HeaderText = "备注"; + + + SetToolButtonStatus(formStatus); + //SetToolsButton(); + } + + + public override void TabControlSelectingFunction(object? sender, TabControlCancelEventArgs e) + { + base.TabControlSelectingFunction(sender, e); + } + + public override void DataGridViewListDoubleClick(object? sender, DataGridViewCellEventArgs e) + { + base.DataGridViewListDoubleClick(sender, e); + var g = (DataGridView)sender; + var model = g.CurrentRow.DataBoundItem as w_Warehourses; + + //给详情页设置数据 + this.txtID.Text = model.ID.ToString(); + Address.Text=model.Address; + WarehousesName.Text = model.WarehousesName; + StorageFee.Value = model.StorageFee ?? 0; + comboBoxPerson.SelectedValue = model.ChargePersonID; + SortOrder.Text = model.SortOrder.ToString(); + Remark.Text = model.Remark; + SetToolButtonStatus(formStatus); + } + + public override void AddFunction(object sender, EventArgs e) + { + base.AddFunction(sender, e); + SetToolButtonStatus(formStatus); + } + + public override void EditFunction(object sender, EventArgs e) + { + base.EditFunction(sender, e); + SetToolButtonStatus(formStatus); + } + + public override void SaveFunction(object sender, EventArgs e) + { + base.SaveFunction(sender, e); + { + //新增 + if (string.IsNullOrEmpty(txtID.Text)) + { + w_Warehourses model = new w_Warehourses(); + // TODO获取界面的数据 + model.Address= Address.Text; + model.WarehousesName= WarehousesName.Text; + model.StorageFee = StorageFee.Value; + model.ChargePersonID= (int)comboBoxPerson.SelectedValue; + model.SortOrder= SortOrder.ToInt32(); + model.Remark= Remark.Text; + var id = _w_WarehoursesServices.Insert(model); + txtID.Text = id.ToString(); + if (id > 0) + { + MessageBox.Show("保存成功!", "提示"); + } + } + // 修改 + else + { + w_Warehourses model = _w_WarehoursesServices.QueryById(int.Parse(txtID.Text)); + // TODO获取界面的数据 + model.Address = Address.Text; + model.WarehousesName = WarehousesName.Text; + model.StorageFee = StorageFee.Value; + model.ChargePersonID = (int)comboBoxPerson.SelectedValue; + model.SortOrder = SortOrder.ToInt32(); + model.Remark = Remark.Text; + if (_w_WarehoursesServices.Update(model)) + { + MessageBox.Show("保存成功!", "提示"); + } + } + SetToolButtonStatus(formStatus); + //列表重新赋值 + this.dataGridViewList.DataSource = _w_WarehoursesServices.Query(); + } + } + + public override void CanelFunction(object sender, EventArgs e) + { + bool isAdd = formStatus == FormStatus.Add; + base.CanelFunction(sender, e); + SetToolButtonStatus(formStatus); + if (isAdd) btnEdit.Enabled = false; + } + + public override void DelFunction(object sender, EventArgs e) + { + base.DelFunction(sender, e); + var result = MessageBox.Show("是否删除?", "确认", MessageBoxButtons.YesNoCancel); + if (result == DialogResult.Yes) + { + _w_WarehoursesServices.DeleteById(Int32.Parse(txtID.Text)); + formStatus = FormStatus.Del; + SetToolButtonStatus(formStatus); + //列表重新赋值 + this.dataGridViewList.DataSource = _w_WarehoursesServices.Query(); + } + } + + public override void SetToolButtonStatus(FormStatus status) + { + base.SetToolButtonStatus(status); + switch (status) + { + case FormStatus.Add: + { + btnAdd.Enabled = false; + btnEdit.Enabled = false; + btnSave.Enabled = true; + btnDel.Enabled = false; + btnCanel.Enabled = true; + SetControlStatus(this.groupBox1, true); + ClearControlsText(this.groupBox1); + break; + } + case FormStatus.Edit: + { + btnAdd.Enabled = false; + btnEdit.Enabled = false; + btnSave.Enabled = true; + btnDel.Enabled = false; + btnCanel.Enabled = true; + SetControlStatus(this.groupBox1, true); + break; + } + case FormStatus.View: + { + btnAdd.Enabled = true; + btnEdit.Enabled = true; + btnSave.Enabled = false; + btnDel.Enabled = true; + btnCanel.Enabled = false; + SetControlStatus(this.groupBox1, false); + break; + } + case FormStatus.Canel: + { + btnAdd.Enabled = true; + btnEdit.Enabled = true; + btnSave.Enabled = false; + btnDel.Enabled = false; + btnCanel.Enabled = false; + SetControlStatus(this.groupBox1, false); + break; + } + case FormStatus.First: + { + btnAdd.Enabled = true; + btnEdit.Enabled = false; + btnSave.Enabled = false; + btnDel.Enabled = false; + btnCanel.Enabled = false; + SetControlStatus(this.groupBox1, false); + break; + } + case FormStatus.Save: + { + btnAdd.Enabled = true; + btnEdit.Enabled = true; + btnSave.Enabled = false; + btnDel.Enabled = true; + btnCanel.Enabled = false; + SetControlStatus(this.groupBox1, false); + break; + } + case FormStatus.Del: + { + btnAdd.Enabled = true; + btnEdit.Enabled = false; + btnSave.Enabled = false; + btnDel.Enabled = false; + btnCanel.Enabled = false; + SetControlStatus(this.groupBox1, false); + ClearControlsText(this.groupBox1); + break; + } + } + } + + public override bool ValidateData() + { + if (string.IsNullOrEmpty(WarehousesName.Text)) + { + MessageBox.Show("仓库名称不能为空!"); + return false; + } + return true; + } + } +} diff --git a/WinformDevFramework/System/FrmDataSource.resx b/WinformDevFramework/Pages/Basic/FrmW_Warehourses.resx similarity index 100% rename from WinformDevFramework/System/FrmDataSource.resx rename to WinformDevFramework/Pages/Basic/FrmW_Warehourses.resx diff --git a/WinformDevFramework/Form1.Designer.cs b/WinformDevFramework/Pages/Form1.Designer.cs similarity index 38% rename from WinformDevFramework/Form1.Designer.cs rename to WinformDevFramework/Pages/Form1.Designer.cs index 525635f075c683c349bd7080c48dc91c83b05601..9ae2ff419f20f804253165f3328b8ee2f3f8b888 100644 --- a/WinformDevFramework/Form1.Designer.cs +++ b/WinformDevFramework/Pages/Form1.Designer.cs @@ -28,69 +28,51 @@ /// private void InitializeComponent() { - this.comboBox1 = new System.Windows.Forms.ComboBox(); - this.button1 = new System.Windows.Forms.Button(); - this.button2 = new System.Windows.Forms.Button(); - this.textBox1 = new System.Windows.Forms.TextBox(); + this.components = new System.ComponentModel.Container(); + this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components); + this.ucDataGridView1 = new HZH_Controls.Controls.UCDataGridView(); this.SuspendLayout(); // - // comboBox1 + // notifyIcon1 // - this.comboBox1.FormattingEnabled = true; - this.comboBox1.Location = new System.Drawing.Point(288, 143); - this.comboBox1.Name = "comboBox1"; - this.comboBox1.Size = new System.Drawing.Size(121, 25); - this.comboBox1.TabIndex = 0; + this.notifyIcon1.Text = "notifyIcon1"; + this.notifyIcon1.Visible = true; // - // button1 + // ucDataGridView1 // - this.button1.Location = new System.Drawing.Point(569, 197); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(75, 23); - this.button1.TabIndex = 1; - this.button1.Text = "button1"; - this.button1.UseVisualStyleBackColor = true; - this.button1.Click += new System.EventHandler(this.button1_Click); - // - // button2 - // - this.button2.Location = new System.Drawing.Point(352, 256); - this.button2.Name = "button2"; - this.button2.Size = new System.Drawing.Size(75, 23); - this.button2.TabIndex = 2; - this.button2.Text = "关闭"; - this.button2.UseVisualStyleBackColor = true; - this.button2.Click += new System.EventHandler(this.button2_Click); - // - // textBox1 - // - this.textBox1.Location = new System.Drawing.Point(346, 72); - this.textBox1.Name = "textBox1"; - this.textBox1.Size = new System.Drawing.Size(239, 23); - this.textBox1.TabIndex = 3; - this.textBox1.Text = "我是更新后的版本"; + this.ucDataGridView1.BackColor = System.Drawing.Color.White; + this.ucDataGridView1.Columns = null; + this.ucDataGridView1.DataSource = null; + this.ucDataGridView1.Dock = System.Windows.Forms.DockStyle.Fill; + this.ucDataGridView1.HeadFont = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.ucDataGridView1.HeadHeight = 40; + this.ucDataGridView1.HeadPadingLeft = 0; + this.ucDataGridView1.HeadTextColor = System.Drawing.Color.Black; + this.ucDataGridView1.IsShowCheckBox = false; + this.ucDataGridView1.IsShowHead = true; + this.ucDataGridView1.Location = new System.Drawing.Point(0, 0); + this.ucDataGridView1.Name = "ucDataGridView1"; + this.ucDataGridView1.Padding = new System.Windows.Forms.Padding(0, 40, 0, 0); + this.ucDataGridView1.RowHeight = 40; + this.ucDataGridView1.RowType = typeof(HZH_Controls.Controls.UCDataGridViewRow); + this.ucDataGridView1.Size = new System.Drawing.Size(825, 381); + this.ucDataGridView1.TabIndex = 0; // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(800, 450); - this.Controls.Add(this.textBox1); - this.Controls.Add(this.button2); - this.Controls.Add(this.button1); - this.Controls.Add(this.comboBox1); + this.ClientSize = new System.Drawing.Size(825, 381); + this.Controls.Add(this.ucDataGridView1); this.Name = "Form1"; this.Text = "Form1"; + this.Load += new System.EventHandler(this.Form1_Load); this.ResumeLayout(false); - this.PerformLayout(); } #endregion - - private ComboBox comboBox1; - private Button button1; - private Button button2; - private TextBox textBox1; + private NotifyIcon notifyIcon1; + private HZH_Controls.Controls.UCDataGridView ucDataGridView1; } } \ No newline at end of file diff --git a/WinformDevFramework/Pages/Form1.cs b/WinformDevFramework/Pages/Form1.cs new file mode 100644 index 0000000000000000000000000000000000000000..c61b5c84024d0ec3d7ab0c474969e1db8468fbdd --- /dev/null +++ b/WinformDevFramework/Pages/Form1.cs @@ -0,0 +1,78 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Data.Entity.Core.Metadata.Edm; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using DynamicData; +using HZH_Controls.Controls; +using WinformDevFramework.Core.Configuration; +using WinformDevFramework.IServices.System; +using WinformDevFramework.Models; +using static System.Windows.Forms.VisualStyles.VisualStyleElement.Rebar; + +namespace WinformDevFramework +{ + public partial class Form1 : Form + { + private Random _rand = new Random(); + private ISysMenuServices _menuServices; + public Form1( ISysMenuServices sysMenuServices) + { + _menuServices = sysMenuServices; + InitializeComponent(); + + } + private void AddRootNode(string nodeText) + { + ; + } + + private void AddChildNodes(int nodeCount) + { + + } + private void button1_Click(object sender, EventArgs e) + { + + } + + private void button2_Click(object sender, EventArgs e) + { + TabControl parentTabControl = this.Parent.Parent as TabControl; + TabPage tabpage = this.Parent as TabPage; + parentTabControl.TabPages.Remove(tabpage); + } + + private void button1_Click_1(object sender, EventArgs e) + { + TabControl parentTabControl = this.Parent.Parent as TabControl; + TabPage tabpage = this.Parent as TabPage; + parentTabControl.TabPages.Remove(tabpage); + } + + private void Form1_Load(object sender, EventArgs e) + { + ucDataGridView1.RowType = typeof(UCDataGridViewTreeRow); + List lstCulumns = new List(); + lstCulumns.Add(new DataGridViewColumnEntity() { DataField = "ID", HeadText = "编号", Width = 70, WidthType = SizeType.Absolute }); + lstCulumns.Add(new DataGridViewColumnEntity() { DataField = "Username", HeadText = "姓名", Width = 50, WidthType = SizeType.Percent }); + lstCulumns.Add(new DataGridViewColumnEntity() { DataField = "Age", HeadText = "年龄", Width = 50, WidthType = SizeType.Percent }); + lstCulumns.Add(new DataGridViewColumnEntity() { DataField = "Birthday", HeadText = "生日", Width = 50, WidthType = SizeType.Percent, Format = (a) => { return ((DateTime)a).ToString("yyyy-MM-dd"); } }); + lstCulumns.Add(new DataGridViewColumnEntity() { DataField = "Sex", HeadText = "性别", Width = 50, WidthType = SizeType.Percent, Format = (a) => { return ((int)a) == 0 ? "女" : "男"; } }); + this.ucDataGridView1.Columns = lstCulumns; + this.ucDataGridView1.IsShowCheckBox = true; + this.ucDataGridView1.DataSource = _menuServices.Query(); + } + } + + class User + { + public int id { get; set; } + public string name { get; set; } + } +} diff --git a/WinformDevFramework/Pages/Form1.resx b/WinformDevFramework/Pages/Form1.resx new file mode 100644 index 0000000000000000000000000000000000000000..50794d4033910f3b82fce4ad92cfea33bc32c107 --- /dev/null +++ b/WinformDevFramework/Pages/Form1.resx @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + 17, 17 + + \ No newline at end of file diff --git a/WinformDevFramework/FrmLogin.Designer.cs b/WinformDevFramework/Pages/FrmLogin.Designer.cs similarity index 100% rename from WinformDevFramework/FrmLogin.Designer.cs rename to WinformDevFramework/Pages/FrmLogin.Designer.cs diff --git a/WinformDevFramework/FrmLogin.cs b/WinformDevFramework/Pages/FrmLogin.cs similarity index 100% rename from WinformDevFramework/FrmLogin.cs rename to WinformDevFramework/Pages/FrmLogin.cs diff --git a/WinformDevFramework/FrmLogin.resx b/WinformDevFramework/Pages/FrmLogin.resx similarity index 100% rename from WinformDevFramework/FrmLogin.resx rename to WinformDevFramework/Pages/FrmLogin.resx diff --git a/WinformDevFramework/FrmMain.Designer.cs b/WinformDevFramework/Pages/FrmMain.Designer.cs similarity index 100% rename from WinformDevFramework/FrmMain.Designer.cs rename to WinformDevFramework/Pages/FrmMain.Designer.cs diff --git a/WinformDevFramework/FrmMain.cs b/WinformDevFramework/Pages/FrmMain.cs similarity index 100% rename from WinformDevFramework/FrmMain.cs rename to WinformDevFramework/Pages/FrmMain.cs diff --git a/WinformDevFramework/FrmMain.resx b/WinformDevFramework/Pages/FrmMain.resx similarity index 100% rename from WinformDevFramework/FrmMain.resx rename to WinformDevFramework/Pages/FrmMain.resx diff --git a/WinformDevFramework/FrmUpdate.Designer.cs b/WinformDevFramework/Pages/FrmUpdate.Designer.cs similarity index 100% rename from WinformDevFramework/FrmUpdate.Designer.cs rename to WinformDevFramework/Pages/FrmUpdate.Designer.cs diff --git a/WinformDevFramework/FrmUpdate.cs b/WinformDevFramework/Pages/FrmUpdate.cs similarity index 100% rename from WinformDevFramework/FrmUpdate.cs rename to WinformDevFramework/Pages/FrmUpdate.cs diff --git a/WinformDevFramework/FrmUpdate.resx b/WinformDevFramework/Pages/FrmUpdate.resx similarity index 100% rename from WinformDevFramework/FrmUpdate.resx rename to WinformDevFramework/Pages/FrmUpdate.resx diff --git a/WinformDevFramework/System/FrmCreateCode.Designer.cs b/WinformDevFramework/Pages/System/FrmCreateCode.Designer.cs similarity index 48% rename from WinformDevFramework/System/FrmCreateCode.Designer.cs rename to WinformDevFramework/Pages/System/FrmCreateCode.Designer.cs index f860383d3c6e53663f87ebab20519048da3472cd..48886b7340b2e4a901692013e63a2054011316af 100644 --- a/WinformDevFramework/System/FrmCreateCode.Designer.cs +++ b/WinformDevFramework/Pages/System/FrmCreateCode.Designer.cs @@ -29,25 +29,52 @@ private void InitializeComponent() { this.panel3 = new System.Windows.Forms.Panel(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); this.button4 = new System.Windows.Forms.Button(); this.btnOk = new System.Windows.Forms.Button(); this.button2 = new System.Windows.Forms.Button(); this.txtUrl = new System.Windows.Forms.TextBox(); this.label5 = new System.Windows.Forms.Label(); this.txtNameSpace = new System.Windows.Forms.TextBox(); - this.label4 = new System.Windows.Forms.Label(); this.uiComboTreeViewTable = new Sunny.UI.UIComboTreeView(); + this.label4 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.textBox1 = new System.Windows.Forms.TextBox(); this.button1 = new System.Windows.Forms.Button(); this.comboBox1 = new System.Windows.Forms.ComboBox(); this.label1 = new System.Windows.Forms.Label(); + this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.groupBox3 = new System.Windows.Forms.GroupBox(); + this.dataGridViewTable = new System.Windows.Forms.DataGridView(); + this.tableName = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridView1 = new System.Windows.Forms.DataGridView(); + this.dataBaseFieldName = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.FieldType = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.controlType = new System.Windows.Forms.DataGridViewComboBoxColumn(); + this.controlName = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.labelName = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.labelText = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.isIdentity = new System.Windows.Forms.DataGridViewCheckBoxColumn(); + this.isSearch = new System.Windows.Forms.DataGridViewCheckBoxColumn(); + this.isCheck = new System.Windows.Forms.DataGridViewCheckBoxColumn(); + this.isEdit = new System.Windows.Forms.DataGridViewCheckBoxColumn(); this.panel3.SuspendLayout(); + this.groupBox1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); + this.splitContainer1.Panel1.SuspendLayout(); + this.splitContainer1.Panel2.SuspendLayout(); + this.splitContainer1.SuspendLayout(); + this.groupBox2.SuspendLayout(); + this.groupBox3.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridViewTable)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); this.SuspendLayout(); // // panel3 // + this.panel3.Controls.Add(this.groupBox1); this.panel3.Controls.Add(this.button4); this.panel3.Controls.Add(this.btnOk); this.panel3.Controls.Add(this.button2); @@ -55,19 +82,32 @@ this.panel3.Controls.Add(this.label5); this.panel3.Controls.Add(this.txtNameSpace); this.panel3.Controls.Add(this.label4); - this.panel3.Controls.Add(this.uiComboTreeViewTable); this.panel3.Controls.Add(this.label3); this.panel3.Controls.Add(this.label2); this.panel3.Controls.Add(this.textBox1); this.panel3.Controls.Add(this.button1); this.panel3.Controls.Add(this.comboBox1); this.panel3.Controls.Add(this.label1); + this.panel3.Controls.Add(this.uiComboTreeViewTable); this.panel3.Dock = System.Windows.Forms.DockStyle.Fill; this.panel3.Location = new System.Drawing.Point(0, 0); this.panel3.Name = "panel3"; - this.panel3.Size = new System.Drawing.Size(800, 450); + this.panel3.Size = new System.Drawing.Size(779, 426); this.panel3.TabIndex = 2; // + // groupBox1 + // + this.groupBox1.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.groupBox1.Controls.Add(this.splitContainer1); + this.groupBox1.Location = new System.Drawing.Point(3, 248); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(773, 175); + this.groupBox1.TabIndex = 17; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "界面"; + // // button4 // this.button4.Location = new System.Drawing.Point(306, 219); @@ -133,24 +173,6 @@ this.label4.Text = "命名空间"; this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // - // uiComboTreeViewTable - // - this.uiComboTreeViewTable.DropDownStyle = Sunny.UI.UIDropDownStyle.DropDownList; - this.uiComboTreeViewTable.FillColor = System.Drawing.Color.White; - this.uiComboTreeViewTable.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.uiComboTreeViewTable.Location = new System.Drawing.Point(153, 101); - this.uiComboTreeViewTable.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.uiComboTreeViewTable.MinimumSize = new System.Drawing.Size(63, 0); - this.uiComboTreeViewTable.Name = "uiComboTreeViewTable"; - this.uiComboTreeViewTable.Padding = new System.Windows.Forms.Padding(0, 0, 30, 2); - this.uiComboTreeViewTable.RectColor = System.Drawing.Color.Gray; - this.uiComboTreeViewTable.Size = new System.Drawing.Size(284, 25); - this.uiComboTreeViewTable.Style = Sunny.UI.UIStyle.Custom; - this.uiComboTreeViewTable.TabIndex = 9; - this.uiComboTreeViewTable.TagString = ""; - this.uiComboTreeViewTable.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft; - this.uiComboTreeViewTable.Watermark = ""; - // // label3 // this.label3.Location = new System.Drawing.Point(54, 104); @@ -178,6 +200,26 @@ this.textBox1.ReadOnly = true; this.textBox1.Size = new System.Drawing.Size(284, 23); this.textBox1.TabIndex = 6; + + // uiComboTreeViewTable + // + this.uiComboTreeViewTable.DropDownStyle = Sunny.UI.UIDropDownStyle.DropDownList; + this.uiComboTreeViewTable.FillColor = System.Drawing.Color.White; + this.uiComboTreeViewTable.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.uiComboTreeViewTable.Location = new System.Drawing.Point(153, 101); + this.uiComboTreeViewTable.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.uiComboTreeViewTable.MinimumSize = new System.Drawing.Size(63, 0); + this.uiComboTreeViewTable.Name = "uiComboTreeViewTable"; + this.uiComboTreeViewTable.Padding = new System.Windows.Forms.Padding(0, 0, 30, 2); + this.uiComboTreeViewTable.RectColor = System.Drawing.Color.Gray; + this.uiComboTreeViewTable.Size = new System.Drawing.Size(284, 25); + this.uiComboTreeViewTable.Style = Sunny.UI.UIStyle.Custom; + this.uiComboTreeViewTable.TabIndex = 9; + this.uiComboTreeViewTable.TagString = ""; + this.uiComboTreeViewTable.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft; + this.uiComboTreeViewTable.Watermark = ""; + // + // // // button1 // @@ -209,17 +251,185 @@ this.label1.Text = "选择数据库"; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // + // splitContainer1 + // + this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer1.Location = new System.Drawing.Point(3, 19); + this.splitContainer1.Name = "splitContainer1"; + // + // splitContainer1.Panel1 + // + this.splitContainer1.Panel1.Controls.Add(this.groupBox2); + // + // splitContainer1.Panel2 + // + this.splitContainer1.Panel2.Controls.Add(this.groupBox3); + this.splitContainer1.Size = new System.Drawing.Size(767, 153); + this.splitContainer1.SplitterDistance = 133; + this.splitContainer1.TabIndex = 0; + // + // groupBox2 + // + this.groupBox2.Controls.Add(this.dataGridViewTable); + this.groupBox2.Dock = System.Windows.Forms.DockStyle.Fill; + this.groupBox2.Location = new System.Drawing.Point(0, 0); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(133, 153); + this.groupBox2.TabIndex = 0; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "数据表"; + // + // groupBox3 + // + this.groupBox3.Controls.Add(this.dataGridView1); + this.groupBox3.Dock = System.Windows.Forms.DockStyle.Fill; + this.groupBox3.Location = new System.Drawing.Point(0, 0); + this.groupBox3.Name = "groupBox3"; + this.groupBox3.Size = new System.Drawing.Size(630, 153); + this.groupBox3.TabIndex = 0; + this.groupBox3.TabStop = false; + this.groupBox3.Text = "设置"; + // + // dataGridViewTable + // + this.dataGridViewTable.BackgroundColor = System.Drawing.SystemColors.Control; + this.dataGridViewTable.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridViewTable.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.tableName}); + this.dataGridViewTable.Dock = System.Windows.Forms.DockStyle.Fill; + this.dataGridViewTable.Location = new System.Drawing.Point(3, 19); + this.dataGridViewTable.Name = "dataGridViewTable"; + this.dataGridViewTable.ReadOnly = true; + this.dataGridViewTable.RowHeadersVisible = false; + this.dataGridViewTable.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders; + this.dataGridViewTable.RowTemplate.Height = 25; + this.dataGridViewTable.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.dataGridViewTable.Size = new System.Drawing.Size(127, 131); + this.dataGridViewTable.TabIndex = 0; + // + // tableName + // + this.tableName.HeaderText = "表名"; + this.tableName.Name = "tableName"; + this.tableName.DataPropertyName = "tableName"; + this.tableName.ReadOnly = true; + // + // dataGridView1 + // + this.dataGridView1.BackgroundColor = System.Drawing.SystemColors.Control; + this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.dataBaseFieldName, + this.FieldType, + this.controlType, + this.controlName, + this.labelName, + this.labelText, + this.isIdentity, + this.isSearch, + this.isCheck, + this.isEdit}); + this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill; + this.dataGridView1.Location = new System.Drawing.Point(3, 19); + this.dataGridView1.Name = "dataGridView1"; + this.dataGridView1.ReadOnly = false; + this.dataGridView1.RowHeadersVisible = false; + this.dataGridView1.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders; + this.dataGridView1.RowTemplate.Height = 25; + this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.dataGridView1.Size = new System.Drawing.Size(624, 131); + this.dataGridView1.TabIndex = 1; + // + // dataGridViewTextBoxColumnFieldName + // + this.dataBaseFieldName.HeaderText = "字段名称"; + this.dataBaseFieldName.Name = "dataBaseFieldName"; + this.dataBaseFieldName.DataPropertyName = "dataBaseFieldName"; + this.dataBaseFieldName.ReadOnly = false; + // + // FieldType + // + this.FieldType.HeaderText = "字段类型"; + this.FieldType.Name = "dataBaseFieldType"; + this.FieldType.DataPropertyName = "dataBaseFieldType"; + this.FieldType.ReadOnly = false; + // + // controlType + // + this.controlType.HeaderText = "控件类型"; + this.controlType.Name = "controlType"; + this.controlType.DataPropertyName = "controlType"; + this.controlType.ReadOnly = false; + // + // controlName + // + this.controlName.HeaderText = "控件Name"; + this.controlName.Name = "controlName"; + this.controlName.DataPropertyName = "controlName"; + this.controlName.ReadOnly = false; + // + // labelName + // + this.labelName.HeaderText = "标签Name"; + this.labelName.Name = "labelName"; + this.labelName.DataPropertyName = "labelName"; + this.labelName.ReadOnly = false; + // + // labelText + // + this.labelText.HeaderText = "标签文本"; + this.labelText.Name = "labelText"; + this.labelText.DataPropertyName = "labelText"; + this.labelText.ReadOnly = false; + // + // isIdentity + // + this.isIdentity.HeaderText = "是否自增"; + this.isIdentity.Name = "isIdentity"; + this.isIdentity.DataPropertyName = "isIdentity"; + this.isIdentity.ReadOnly = true; + // + // isSearch + // + this.isSearch.HeaderText = "是否搜索项"; + this.isSearch.Name = "isSearch"; + this.isSearch.DataPropertyName = "isSearch"; + this.isSearch.ReadOnly = false; + // + // isCheck + // + this.isCheck.HeaderText = "是否要为空检验"; + this.isCheck.Name = "isCheck"; + this.isCheck.DataPropertyName = "isCheck"; + this.isCheck.ReadOnly = false; + // + // isEdit + // + this.isEdit.HeaderText = "是否可编辑"; + this.isEdit.Name = "isEdit"; + this.isEdit.DataPropertyName = "isEdit"; + this.isEdit.ReadOnly = false; + // // FrmCreateCode // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(800, 450); + this.ClientSize = new System.Drawing.Size(779, 426); this.Controls.Add(this.panel3); this.Name = "FrmCreateCode"; this.Text = "FrmCreateCode"; this.Load += new System.EventHandler(this.FrmCreateCode_Load); this.panel3.ResumeLayout(false); this.panel3.PerformLayout(); + this.groupBox1.ResumeLayout(false); + this.splitContainer1.Panel1.ResumeLayout(false); + this.splitContainer1.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); + this.splitContainer1.ResumeLayout(false); + this.groupBox2.ResumeLayout(false); + this.groupBox3.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.dataGridViewTable)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); this.ResumeLayout(false); } @@ -240,5 +450,22 @@ private Button button2; private Button button4; private Button btnOk; + private GroupBox groupBox1; + private SplitContainer splitContainer1; + private GroupBox groupBox2; + private GroupBox groupBox3; + private DataGridView dataGridViewTable; + private DataGridViewTextBoxColumn tableName; + private DataGridView dataGridView1; + private DataGridViewTextBoxColumn dataBaseFieldName; + private DataGridViewTextBoxColumn FieldType; + private DataGridViewComboBoxColumn controlType; + private DataGridViewTextBoxColumn controlName; + private DataGridViewTextBoxColumn labelName; + private DataGridViewTextBoxColumn labelText; + private DataGridViewCheckBoxColumn isIdentity; + private DataGridViewCheckBoxColumn isSearch; + private DataGridViewCheckBoxColumn isCheck; + private DataGridViewCheckBoxColumn isEdit; } } \ No newline at end of file diff --git a/WinformDevFramework/System/FrmCreateCode.cs b/WinformDevFramework/Pages/System/FrmCreateCode.cs similarity index 52% rename from WinformDevFramework/System/FrmCreateCode.cs rename to WinformDevFramework/Pages/System/FrmCreateCode.cs index fcef6a4c7db61810a398f04b87ede94b8f42e2c8..0fbe40b4d7ea90d97c88b699d6269ea45d1fec4b 100644 --- a/WinformDevFramework/System/FrmCreateCode.cs +++ b/WinformDevFramework/Pages/System/FrmCreateCode.cs @@ -6,7 +6,12 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; +using System.Windows.Markup; +using Autofac; +using DynamicData; +using HZH_Controls.Controls; using SqlSugar; +using Sunny.UI; using WinformDevFramework.IServices.System; using WinformDevFramework.Models; using WinformDevFramework.Models.DBModels; @@ -32,8 +37,117 @@ namespace WinformDevFramework this.uiComboTreeViewTable.DropDownStyle = Sunny.UI.UIDropDownStyle.DropDownList; uiComboTreeViewTable.ShowClearButton=true; uiComboTreeViewTable.ShowSelectedAllCheckBox=true; + uiComboTreeViewTable.TextChanged += UiComboTreeViewTable_TextChanged; + dataGridViewTable.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; + this.controlType.DataSource= new string[]{ "TextBox", "NumericUpDown", "CheckBox", "DateTimePicker", }; + dataGridViewTable.SelectionChanged += dataGridViewTable_SelectionChanged; + dataGridViewTable.SelectionMode=DataGridViewSelectionMode.FullRowSelect; + dataGridViewTable.MultiSelect = false; } + private void dataGridViewTable_SelectionChanged(object? sender, EventArgs e) + { + DataGridView d=(DataGridView)sender; + if (d.SelectedRows.Count > 0) + { + var selectedRow = d.SelectedRows[0]; + var selectedCell = selectedRow.Cells[0]; + if (selectedRow.Index > -1 && !string.IsNullOrEmpty(selectedCell.Value.ToString())) + { + foreach (DataGridViewRow row in dataGridView1.Rows) + { + if (!((ControlInfo)row.DataBoundItem).tableName.Equals(selectedCell.Value.ToString())) + { + CurrencyManager cm = (CurrencyManager)BindingContext[dataGridView1.DataSource]; + cm.SuspendBinding(); + row.Visible = false; + cm.ResumeBinding(); + + } + else + { + row.Visible = true; + + } + } + } + } + + } + + private void UiComboTreeViewTable_TextChanged(object? sender, EventArgs e) + { + var tables = uiComboTreeViewTable.Text.Split(";").ToList(); + if (tables.Any()) + { + List list = new List(); + ISqlSugarClient dbClient = AppInfo.Container.Resolve(); + foreach (var item in tables) + { + string str=item.TrimStart().TrimEnd(); + string sqlGetAllTables = @"SELECT + dataBaseFieldName = convert(varchar(100), a.name), + tableName = convert(varchar(50), d.name), + dataBaseFieldType = CONVERT(varchar(50), b.name), + dataBaseFieldDDesr = convert(varchar(50), isnull(g.[value], '')) + FROM dbo.syscolumns a + left join dbo.systypes b on a.xusertype = b.xusertype + inner join dbo.sysobjects d on a.id = d.id and d.xtype = 'U' and d.name <> 'dtproperties' + left join dbo.syscomments e on a.cdefault = e.id + left join sys.extended_properties g on a.id = g.major_id and a.colid = g.minor_id + left join sys.extended_properties f on d.id = f.major_id and f.minor_id = 0 " + $"where d.name = '{str}'"; + + //string strsql2 = $"SELECT TABLE_NAME,COLUMN_NAME FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE TABLE_NAME='{item}'"; + //List keysList = new List(); + //keysList.AddRange(dbClient.Ado.SqlQuery(strsql2)); + + var data = dbClient.Ado.SqlQuery(sqlGetAllTables); + string strsql3 = $"SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.columns WHERE TABLE_NAME='{str}' AND COLUMNPROPERTY( OBJECT_ID('{str}'),COLUMN_NAME,'IsIdentity')=1"; + List IdentityList = new List(); + IdentityList.AddRange(dbClient.Ado.SqlQuery(strsql3)); + + data.ForEach(p => + { + p.controlName = p.dataBaseFieldName; + p.controlType = GetControlType(p.dataBaseFieldType); + p.isIdentity = IdentityList.Contains(p.dataBaseFieldName); + p.labelName = "lbl" + p.dataBaseFieldName; + p.labelText = p.dataBaseFieldDDesr; + }); + list.AddRange(data); + } + dataGridView1.DataSource = list; + dataGridViewTable.DataSource = list.Distinct(p=>p.tableName).ToList(); + foreach (DataGridViewColumn column in dataGridViewTable.Columns) + { + if (!column.Name.Equals("tableName")) + { + column.Visible = false; + } + } + dataGridView1.Columns["tableName"].Visible = false; + dataGridView1.Columns["dataBaseFieldDDesr"].Visible = false; + } + + } + + private string GetControlType(string dataType) + { + string type = "TextBox"; + switch (dataType) + { + case "int": + type = "NumericUpDown"; break; + case "decimal": + type = "NumericUpDown"; break; + case "bit": + type = "CheckBox"; break; + case "datetime": + type = "DateTimePicker"; break; + } + + return type; + } private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { sysDataSource dataSource = (sysDataSource)comboBox1.SelectedValue; @@ -103,6 +217,8 @@ namespace WinformDevFramework var sc = new ServicesCreate(); var irc = new IRepositoryCreate(); var rc = new RepositoryCreate(); + var wc = new WinformCreate(); + var data = dataGridView1.DataSource as List; //生成Iservices Services IRepository Repository ts.ForEach(p => { @@ -110,6 +226,7 @@ namespace WinformDevFramework sc.Create(p, txtNameSpace.Text, txtUrl.Text); irc.Create(p, txtNameSpace.Text, txtUrl.Text); rc.Create(p, txtNameSpace.Text, txtUrl.Text); + wc.Create(p, txtNameSpace.Text, txtUrl.Text, data.Where(x=>x.tableName.Equals(p)).ToList()); }); MessageBox.Show("生成成功"); diff --git a/WinformDevFramework/Pages/System/FrmCreateCode.resx b/WinformDevFramework/Pages/System/FrmCreateCode.resx new file mode 100644 index 0000000000000000000000000000000000000000..865095faa79e5810118671873b46fc824bdfe706 --- /dev/null +++ b/WinformDevFramework/Pages/System/FrmCreateCode.resx @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + \ No newline at end of file diff --git a/WinformDevFramework/System/FrmDataSource.Designer.cs b/WinformDevFramework/Pages/System/FrmDataSource.Designer.cs similarity index 100% rename from WinformDevFramework/System/FrmDataSource.Designer.cs rename to WinformDevFramework/Pages/System/FrmDataSource.Designer.cs diff --git a/WinformDevFramework/System/FrmDataSource.cs b/WinformDevFramework/Pages/System/FrmDataSource.cs similarity index 99% rename from WinformDevFramework/System/FrmDataSource.cs rename to WinformDevFramework/Pages/System/FrmDataSource.cs index a7e8309be910aa2d2dc6b08b8ccfb57c7481912e..cbeb0582f0f7070d7d2433a1a2d9e863681f9b8d 100644 --- a/WinformDevFramework/System/FrmDataSource.cs +++ b/WinformDevFramework/Pages/System/FrmDataSource.cs @@ -78,7 +78,7 @@ namespace WinformDevFramework public override void SaveFunction(object sender, EventArgs e) { base.SaveFunction(sender, e); - if (ValidateData()) + //if (ValidateData()) { //新增 if (string.IsNullOrEmpty(txtID.Text)) @@ -233,7 +233,7 @@ namespace WinformDevFramework } } //验证数据 - private bool ValidateData() + public override bool ValidateData() { bool result = false; if (string.IsNullOrEmpty(txtConnectName.Text)) diff --git a/WinformDevFramework/System/FrmDicType.resx b/WinformDevFramework/Pages/System/FrmDataSource.resx similarity index 100% rename from WinformDevFramework/System/FrmDicType.resx rename to WinformDevFramework/Pages/System/FrmDataSource.resx diff --git a/WinformDevFramework/FrmDicData.Designer.cs b/WinformDevFramework/Pages/System/FrmDicData.Designer.cs similarity index 100% rename from WinformDevFramework/FrmDicData.Designer.cs rename to WinformDevFramework/Pages/System/FrmDicData.Designer.cs diff --git a/WinformDevFramework/FrmDicData.cs b/WinformDevFramework/Pages/System/FrmDicData.cs similarity index 95% rename from WinformDevFramework/FrmDicData.cs rename to WinformDevFramework/Pages/System/FrmDicData.cs index c24f17e24407ef761dae6777c6a52daad8c1cb66..b8f1e2c1f3fe15a70a744be55dd50d8c63298f67 100644 --- a/WinformDevFramework/FrmDicData.cs +++ b/WinformDevFramework/Pages/System/FrmDicData.cs @@ -1,18 +1,6 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; -using SqlSugar; +using SqlSugar; using WinformDevFramework.Core.Winform; using WinformDevFramework.IServices; -using WinformDevFramework.Models; -using static System.Windows.Forms.VisualStyles.VisualStyleElement; -using static Sunny.UI.UIAvatar; namespace WinformDevFramework { @@ -49,7 +37,7 @@ namespace WinformDevFramework this.dataGridViewList.Columns["DicTypeID"].Visible=false; SetToolButtonStatus(formStatus); SetDicType(_sysDicTypeServices.Query()); - //SetToolsButton(); + SetToolsButton(); } public override void TabControlSelectingFunction(object? sender, TabControlCancelEventArgs e) @@ -85,8 +73,6 @@ namespace WinformDevFramework public override void SaveFunction(object sender, EventArgs e) { base.SaveFunction(sender, e); - base.SaveFunction(sender, e); - if (ValidateData()) { //新增 if (string.IsNullOrEmpty(txtID.Text)) @@ -253,7 +239,7 @@ namespace WinformDevFramework cmbDicType.DisplayMember = "DicTypeName"; } - private bool ValidateData() + public override bool ValidateData() { if (string.IsNullOrEmpty(txtDicDataText.Text)) { diff --git a/WinformDevFramework/System/FrmMenu.resx b/WinformDevFramework/Pages/System/FrmDicData.resx similarity index 100% rename from WinformDevFramework/System/FrmMenu.resx rename to WinformDevFramework/Pages/System/FrmDicData.resx diff --git a/WinformDevFramework/System/FrmDicType.Designer.cs b/WinformDevFramework/Pages/System/FrmDicType.Designer.cs similarity index 100% rename from WinformDevFramework/System/FrmDicType.Designer.cs rename to WinformDevFramework/Pages/System/FrmDicType.Designer.cs diff --git a/WinformDevFramework/System/FrmDicType.cs b/WinformDevFramework/Pages/System/FrmDicType.cs similarity index 99% rename from WinformDevFramework/System/FrmDicType.cs rename to WinformDevFramework/Pages/System/FrmDicType.cs index d9ecc49b302ae1e4bd35efd78cf3dec9bc872eb9..df1557c8da982cd61e788467d78a3b983e3a7fa0 100644 --- a/WinformDevFramework/System/FrmDicType.cs +++ b/WinformDevFramework/Pages/System/FrmDicType.cs @@ -68,7 +68,7 @@ namespace WinformDevFramework public override void SaveFunction(object sender, EventArgs e) { base.SaveFunction(sender, e); - if (ValidateData()) + //if (ValidateData()) { //新增 if (string.IsNullOrEmpty(txtID.Text)) @@ -209,7 +209,7 @@ namespace WinformDevFramework /// 校验数据 /// /// - private bool ValidateData() + public override bool ValidateData() { bool result = false; if (string.IsNullOrEmpty(txtDicTypeName.Text)) diff --git a/WinformDevFramework/System/FrmMessage.resx b/WinformDevFramework/Pages/System/FrmDicType.resx similarity index 100% rename from WinformDevFramework/System/FrmMessage.resx rename to WinformDevFramework/Pages/System/FrmDicType.resx diff --git a/WinformDevFramework/System/FrmMenu.Designer.cs b/WinformDevFramework/Pages/System/FrmMenu.Designer.cs similarity index 93% rename from WinformDevFramework/System/FrmMenu.Designer.cs rename to WinformDevFramework/Pages/System/FrmMenu.Designer.cs index c9f20cfb87cceecc229d4177f52c1a787f87490c..ce606c910bca5c8f75fd1d44fe12cb2c713dce16 100644 --- a/WinformDevFramework/System/FrmMenu.Designer.cs +++ b/WinformDevFramework/Pages/System/FrmMenu.Designer.cs @@ -44,12 +44,13 @@ this.label2 = new System.Windows.Forms.Label(); this.txtPermissionCode = new System.Windows.Forms.TextBox(); this.label3 = new System.Windows.Forms.Label(); - this.pictureBox=new System.Windows.Forms.PictureBox(); + this.pictureBox = new System.Windows.Forms.PictureBox(); this.palTools.SuspendLayout(); this.tabControl1.SuspendLayout(); this.tabDataEdit.SuspendLayout(); this.groupBox1.SuspendLayout(); this.flowLayoutPanelTools.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit(); this.SuspendLayout(); // // groupBox1 @@ -58,19 +59,20 @@ this.groupBox1.Controls.Add(this.label3); this.groupBox1.Controls.Add(this.txtMenuCode); this.groupBox1.Controls.Add(this.label2); - this.groupBox1.Controls.Add(this.label1); this.groupBox1.Controls.Add(this.uiComboTreeViewPMenu); + this.groupBox1.Controls.Add(this.label1); this.groupBox1.Controls.Add(this.ldUpdateDate); this.groupBox1.Controls.Add(this.ltUpdateBy); this.groupBox1.Controls.Add(this.ldCreateDate); this.groupBox1.Controls.Add(this.lcMenuType); - this.groupBox1.Controls.Add(this.btnSelectIcon); this.groupBox1.Controls.Add(this.pictureBox); + this.groupBox1.Controls.Add(this.btnSelectIcon); this.groupBox1.Controls.Add(this.ltCreateBy); this.groupBox1.Controls.Add(this.ltSort); this.groupBox1.Controls.Add(this.ltIcon); this.groupBox1.Controls.Add(this.ltMenuUrl); this.groupBox1.Controls.Add(this.ltMenuTitle); + this.groupBox1.Enter += new System.EventHandler(this.groupBox1_Enter); this.groupBox1.Controls.SetChildIndex(this.ltMenuTitle, 0); this.groupBox1.Controls.SetChildIndex(this.ltMenuUrl, 0); this.groupBox1.Controls.SetChildIndex(this.ltIcon, 0); @@ -94,30 +96,6 @@ // this.txtID.Location = new System.Drawing.Point(667, 33); // - // btnAdd - // - this.btnAdd.Location = new System.Drawing.Point(89, 3); - // - // btnEdit - // - this.btnEdit.Location = new System.Drawing.Point(150, 3); - // - // btnSave - // - this.btnSave.Location = new System.Drawing.Point(211, 3); - // - // btnCanel - // - this.btnCanel.Location = new System.Drawing.Point(333, 3); - // - // btnDel - // - this.btnDel.Location = new System.Drawing.Point(272, 3); - // - // btnResetPW - // - this.btnResetPW.Location = new System.Drawing.Point(3, 3); - // // ltMenuTitle // this.ltMenuTitle.Location = new System.Drawing.Point(6, 32); @@ -162,11 +140,6 @@ this.btnSelectIcon.Text = "选择"; this.btnSelectIcon.UseVisualStyleBackColor = true; this.btnSelectIcon.Click += new System.EventHandler(this.btnSelectIcon_Click); - - this.pictureBox.Location = new System.Drawing.Point(650, 80); - this.pictureBox.Name = "pictureBox"; - this.pictureBox.Size = new System.Drawing.Size(20, 20); - this.pictureBox.TabIndex = 9; // // lcMenuType // @@ -196,23 +169,6 @@ this.ltUpdateBy.Size = new System.Drawing.Size(184, 28); this.ltUpdateBy.TabIndex = 12; // - // uiComboTreeViewPMenu - // - this.uiComboTreeViewPMenu.DropDownStyle = Sunny.UI.UIDropDownStyle.DropDownList; - this.uiComboTreeViewPMenu.FillColor = System.Drawing.Color.White; - this.uiComboTreeViewPMenu.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.uiComboTreeViewPMenu.Location = new System.Drawing.Point(491, 31); - this.uiComboTreeViewPMenu.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.uiComboTreeViewPMenu.MinimumSize = new System.Drawing.Size(63, 0); - this.uiComboTreeViewPMenu.Name = "uiComboTreeViewPMenu"; - this.uiComboTreeViewPMenu.Padding = new System.Windows.Forms.Padding(0, 0, 30, 2); - this.uiComboTreeViewPMenu.RectColor = System.Drawing.Color.Gray; - this.uiComboTreeViewPMenu.Size = new System.Drawing.Size(150, 28); - this.uiComboTreeViewPMenu.Style = Sunny.UI.UIStyle.Custom; - this.uiComboTreeViewPMenu.TabIndex = 14; - this.uiComboTreeViewPMenu.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft; - this.uiComboTreeViewPMenu.Watermark = ""; - // // label1 // this.label1.AutoSize = true; @@ -238,6 +194,24 @@ this.label2.TabIndex = 16; this.label2.Text = "菜单编码"; this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // uiComboTreeViewPMenu + // + this.uiComboTreeViewPMenu.DropDownStyle = Sunny.UI.UIDropDownStyle.DropDownList; + this.uiComboTreeViewPMenu.FillColor = System.Drawing.Color.White; + this.uiComboTreeViewPMenu.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.uiComboTreeViewPMenu.Location = new System.Drawing.Point(491, 31); + this.uiComboTreeViewPMenu.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.uiComboTreeViewPMenu.MinimumSize = new System.Drawing.Size(63, 0); + this.uiComboTreeViewPMenu.Name = "uiComboTreeViewPMenu"; + this.uiComboTreeViewPMenu.Padding = new System.Windows.Forms.Padding(0, 0, 30, 2); + this.uiComboTreeViewPMenu.RectColor = System.Drawing.Color.Gray; + this.uiComboTreeViewPMenu.Size = new System.Drawing.Size(150, 28); + this.uiComboTreeViewPMenu.Style = Sunny.UI.UIStyle.Custom; + this.uiComboTreeViewPMenu.TabIndex = 14; + this.uiComboTreeViewPMenu.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft; + this.uiComboTreeViewPMenu.Watermark = ""; + // // // txtPermissionCode // @@ -256,6 +230,14 @@ this.label3.Text = "权限编码"; this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // + // pictureBox + // + this.pictureBox.Location = new System.Drawing.Point(650, 80); + this.pictureBox.Name = "pictureBox"; + this.pictureBox.Size = new System.Drawing.Size(20, 20); + this.pictureBox.TabIndex = 9; + this.pictureBox.TabStop = false; + // // FrmMenu // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); @@ -269,6 +251,7 @@ this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); this.flowLayoutPanelTools.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit(); this.ResumeLayout(false); } diff --git a/WinformDevFramework/System/FrmMenu.cs b/WinformDevFramework/Pages/System/FrmMenu.cs similarity index 98% rename from WinformDevFramework/System/FrmMenu.cs rename to WinformDevFramework/Pages/System/FrmMenu.cs index 56972e59f27d33bbbc1ba107e2d5aa1958612646..7a2778b758dc593eec7ff7046326c9759c00c2e9 100644 --- a/WinformDevFramework/System/FrmMenu.cs +++ b/WinformDevFramework/Pages/System/FrmMenu.cs @@ -1,12 +1,8 @@ using SqlSugar; -using System.Windows.Forms; using Sunny.UI; -using WinformDevFramework.Core.Configuration; using WinformDevFramework.Core.Winform; using WinformDevFramework.IServices.System; using WinformDevFramework.Models; -using static Npgsql.Replication.PgOutput.Messages.RelationMessage; -using static System.Windows.Forms.VisualStyles.VisualStyleElement; namespace WinformDevFramework { @@ -26,6 +22,11 @@ namespace WinformDevFramework public override void Init() { base.Init(); + ReadOnlyControlList.Add("ltCreateBy"); + ReadOnlyControlList.Add("ldCreateDate"); + ReadOnlyControlList.Add("ltUpdateBy"); + ReadOnlyControlList.Add("ldUpdateDate"); + dataGridViewList.DoubleBuffered(); ltMenuTitle.Label.Text = "菜单名称"; ltIcon.Label.Text = "菜单图标"; @@ -311,7 +312,7 @@ namespace WinformDevFramework public override void SaveFunction(object sender, EventArgs e) { base.SaveFunction(sender, e); - if (ValidateData()) + //if (ValidateData()) { //新增 if (string.IsNullOrEmpty(txtID.Text)) @@ -398,7 +399,7 @@ namespace WinformDevFramework } //验证数据 - private bool ValidateData() + public override bool ValidateData() { bool result=false; if (string.IsNullOrEmpty(ltMenuTitle.TextBox.Text)) @@ -450,6 +451,10 @@ namespace WinformDevFramework ltIcon.TextBox.Text= selectedImagePath; } } - + + private void groupBox1_Enter(object sender, EventArgs e) + { + + } } } diff --git a/WinformDevFramework/System/FrmRole.resx b/WinformDevFramework/Pages/System/FrmMenu.resx similarity index 100% rename from WinformDevFramework/System/FrmRole.resx rename to WinformDevFramework/Pages/System/FrmMenu.resx diff --git a/WinformDevFramework/System/FrmMessage.Designer.cs b/WinformDevFramework/Pages/System/FrmMessage.Designer.cs similarity index 100% rename from WinformDevFramework/System/FrmMessage.Designer.cs rename to WinformDevFramework/Pages/System/FrmMessage.Designer.cs diff --git a/WinformDevFramework/System/FrmMessage.cs b/WinformDevFramework/Pages/System/FrmMessage.cs similarity index 100% rename from WinformDevFramework/System/FrmMessage.cs rename to WinformDevFramework/Pages/System/FrmMessage.cs diff --git a/WinformDevFramework/System/FrmUser.resx b/WinformDevFramework/Pages/System/FrmMessage.resx similarity index 100% rename from WinformDevFramework/System/FrmUser.resx rename to WinformDevFramework/Pages/System/FrmMessage.resx diff --git a/WinformDevFramework/System/FrmRole.Designer.cs b/WinformDevFramework/Pages/System/FrmRole.Designer.cs similarity index 99% rename from WinformDevFramework/System/FrmRole.Designer.cs rename to WinformDevFramework/Pages/System/FrmRole.Designer.cs index 1363da78b081c8e53b474bd33e93520ef3184826..65234f3f36dacb360201e783df424cd23a5ec461 100644 --- a/WinformDevFramework/System/FrmRole.Designer.cs +++ b/WinformDevFramework/Pages/System/FrmRole.Designer.cs @@ -145,7 +145,7 @@ // this.uiTreeViewFunction.Dock = System.Windows.Forms.DockStyle.Fill; this.uiTreeViewFunction.FillColor = System.Drawing.SystemColors.Control; - this.uiTreeViewFunction.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); + this.uiTreeViewFunction.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); this.uiTreeViewFunction.Location = new System.Drawing.Point(3, 19); this.uiTreeViewFunction.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.uiTreeViewFunction.MinimumSize = new System.Drawing.Size(1, 1); diff --git a/WinformDevFramework/System/FrmRole.cs b/WinformDevFramework/Pages/System/FrmRole.cs similarity index 99% rename from WinformDevFramework/System/FrmRole.cs rename to WinformDevFramework/Pages/System/FrmRole.cs index d27374895520311e2329232250425f3bdfd563f6..74806b3d8a47928887b462aea4713c751d593fc2 100644 --- a/WinformDevFramework/System/FrmRole.cs +++ b/WinformDevFramework/Pages/System/FrmRole.cs @@ -97,7 +97,7 @@ namespace WinformDevFramework public override void SaveFunction(object sender, EventArgs e) { base.SaveFunction(sender, e); - if (ValidateData()) + //if (ValidateData()) { //新增 if (string.IsNullOrEmpty(txtID.Text)) @@ -298,7 +298,7 @@ namespace WinformDevFramework } //验证数据 - private bool ValidateData() + public override bool ValidateData() { bool result = false; if (string.IsNullOrEmpty(txtRoleName.Text)) diff --git a/WinformDevFramework/Pages/System/FrmRole.resx b/WinformDevFramework/Pages/System/FrmRole.resx new file mode 100644 index 0000000000000000000000000000000000000000..f298a7be80982ebd538a05758a03bc827419d418 --- /dev/null +++ b/WinformDevFramework/Pages/System/FrmRole.resx @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + \ No newline at end of file diff --git a/WinformDevFramework/System/FrmUser.Designer.cs b/WinformDevFramework/Pages/System/FrmUser.Designer.cs similarity index 100% rename from WinformDevFramework/System/FrmUser.Designer.cs rename to WinformDevFramework/Pages/System/FrmUser.Designer.cs diff --git a/WinformDevFramework/System/FrmUser.cs b/WinformDevFramework/Pages/System/FrmUser.cs similarity index 99% rename from WinformDevFramework/System/FrmUser.cs rename to WinformDevFramework/Pages/System/FrmUser.cs index 3a809e9d2ce805f3c29f69b8c96586cd226b79e6..79d344344b2ccf50f61976dd491566d7cfd73757 100644 --- a/WinformDevFramework/System/FrmUser.cs +++ b/WinformDevFramework/Pages/System/FrmUser.cs @@ -99,7 +99,7 @@ namespace WinformDevFramework public override void SaveFunction(object sender, EventArgs e) { base.SaveFunction(sender, e); - if (ValidateData()) + //if (ValidateData()) { //新增 if (string.IsNullOrEmpty(txtID.Text)) @@ -292,7 +292,7 @@ namespace WinformDevFramework } } //验证数据 - private bool ValidateData() + public override bool ValidateData() { bool result = false; if (string.IsNullOrEmpty(txtUserName.Text)) diff --git a/WinformDevFramework/Pages/System/FrmUser.resx b/WinformDevFramework/Pages/System/FrmUser.resx new file mode 100644 index 0000000000000000000000000000000000000000..f298a7be80982ebd538a05758a03bc827419d418 --- /dev/null +++ b/WinformDevFramework/Pages/System/FrmUser.resx @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + \ No newline at end of file diff --git "a/WinformDevFramework/Resources/\344\276\233\345\272\224\345\225\206.png" "b/WinformDevFramework/Resources/\344\276\233\345\272\224\345\225\206.png" new file mode 100644 index 0000000000000000000000000000000000000000..36e6705a5e63f6b9df4243d27f706fb0eb00274c Binary files /dev/null and "b/WinformDevFramework/Resources/\344\276\233\345\272\224\345\225\206.png" differ diff --git a/WinformDevFramework/Temp.txt b/WinformDevFramework/Temp.txt index 4cbdacdd35288573c9614b3a748a25eb550d276c..cafba2a5b97982aa0da56920db4fb4ef7e3abbdb 100644 --- a/WinformDevFramework/Temp.txt +++ b/WinformDevFramework/Temp.txt @@ -1 +1 @@ -woshiDevFERNGZHI \ No newline at end of file +woshiDevFERNGZHI www \ No newline at end of file diff --git a/WinformDevFramework/Template/Form.vm b/WinformDevFramework/Template/Form.vm new file mode 100644 index 0000000000000000000000000000000000000000..cb75bf8d0d1536ea52a8d3eeeb8da1c87cfa673a --- /dev/null +++ b/WinformDevFramework/Template/Form.vm @@ -0,0 +1,234 @@ +using SqlSugar; +using WinformDevFramework.Core.Winform; +using WinformDevFramework.IServices; +using WinformDevFramework; + +namespace ${NameSpace} +{ + public partial class Frm${tableName} : BaseForm1 + { + private I${tableName}Services _${tableName}Services; + public Frm${tableName}(I${tableName}Services ${tableName}Services) + { + _${tableName}Services= ${tableName}Services; + InitializeComponent(); + } + + public override void Init() + { + base.Init(); + //查询数据 + this.dataGridViewList.DataSource = GetData(); + + // 设置隐藏列 +#foreach($info in $EntityList) +#if(!${info.isIdentity}) + this.dataGridViewList.Columns["${info.controlName}"].HeaderText = "${info.dataBaseFieldDDesr}"; +#end +#end + SetToolButtonStatus(formStatus); + SetToolsButton(); + } + + public override void TabControlSelectingFunction(object? sender, TabControlCancelEventArgs e) + { + base.TabControlSelectingFunction(sender, e); + } + + public override void DataGridViewListDoubleClick(object? sender, DataGridViewCellEventArgs e) + { + base.DataGridViewListDoubleClick(sender, e); + var g = (DataGridView)sender; + var model = g.CurrentRow.DataBoundItem as ${tableName}; + + //给详情页设置数据 + this.txtID.Text = model.ID.ToString(); +#foreach($info in $EntityList) +#if(!${info.isIdentity}) + this.${info.controlName}.Text = model.${info.controlName}.ToString(); +#end +#end + SetToolButtonStatus(formStatus); + } + + public override void AddFunction(object sender, EventArgs e) + { + base.AddFunction(sender, e); + SetToolButtonStatus(formStatus); + } + + public override void EditFunction(object sender, EventArgs e) + { + base.EditFunction(sender, e); + SetToolButtonStatus(formStatus); + } + + public override void SaveFunction(object sender, EventArgs e) + { + base.SaveFunction(sender, e); + { + //新增 + if (string.IsNullOrEmpty(txtID.Text)) + { + ${tableName} model = new ${tableName}(); + // TODO获取界面的数据 +#foreach($info in $EntityList) +#if(!${info.isIdentity}) + model.${info.controlName}=this.${info.controlName}.Text; +#end +#end + var id = _${tableName}Services.Insert(model); + txtID.Text = id.ToString(); + if (id > 0) + { + MessageBox.Show("保存成功!", "提示"); + } + } + // 修改 + else + { + ${tableName} model = _${tableName}Services.QueryById(int.Parse(txtID.Text)); + // TODO获取界面的数据 +#foreach($info in $EntityList) +#if(!${info.isIdentity}) + model.${info.controlName}=this.${info.controlName}.Text; +#end +#end + if (_${tableName}Services.Update(model)) + { + MessageBox.Show("保存成功!", "提示"); + } + } + SetToolButtonStatus(formStatus); + //列表重新赋值 + this.dataGridViewList.DataSource = GetData(); + } + } + + public override void CanelFunction(object sender, EventArgs e) + { + bool isAdd = formStatus == FormStatus.Add; + base.CanelFunction(sender, e); + SetToolButtonStatus(formStatus); + if (isAdd) btnEdit.Enabled = false; + } + + public override void DelFunction(object sender, EventArgs e) + { + base.DelFunction(sender, e); + var result = MessageBox.Show("是否删除?", "确认", MessageBoxButtons.YesNoCancel); + if (result == DialogResult.Yes) + { + _${tableName}Services.DeleteById(Int32.Parse(txtID.Text)); + formStatus = FormStatus.Del; + SetToolButtonStatus(formStatus); + //列表重新赋值 + this.dataGridViewList.DataSource = GetData(); + } + } + + public override void SetToolButtonStatus(FormStatus status) + { + base.SetToolButtonStatus(status); + switch (status) + { + case FormStatus.Add: + { + btnAdd.Enabled = false; + btnEdit.Enabled = false; + btnSave.Enabled = true; + btnDel.Enabled = false; + btnCanel.Enabled = true; + SetControlStatus(this.groupBox1, true); + ClearControlsText(this.groupBox1); + break; + } + case FormStatus.Edit: + { + btnAdd.Enabled = false; + btnEdit.Enabled = false; + btnSave.Enabled = true; + btnDel.Enabled = false; + btnCanel.Enabled = true; + SetControlStatus(this.groupBox1, true); + break; + } + case FormStatus.View: + { + btnAdd.Enabled = true; + btnEdit.Enabled = true; + btnSave.Enabled = false; + btnDel.Enabled = true; + btnCanel.Enabled = false; + SetControlStatus(this.groupBox1, false); + break; + } + case FormStatus.Canel: + { + btnAdd.Enabled = true; + btnEdit.Enabled = true; + btnSave.Enabled = false; + btnDel.Enabled = false; + btnCanel.Enabled = false; + SetControlStatus(this.groupBox1, false); + break; + } + case FormStatus.First: + { + btnAdd.Enabled = true; + btnEdit.Enabled = false; + btnSave.Enabled = false; + btnDel.Enabled = false; + btnCanel.Enabled = false; + SetControlStatus(this.groupBox1, false); + break; + } + case FormStatus.Save: + { + btnAdd.Enabled = true; + btnEdit.Enabled = true; + btnSave.Enabled = false; + btnDel.Enabled = true; + btnCanel.Enabled = false; + SetControlStatus(this.groupBox1, false); + break; + } + case FormStatus.Del: + { + btnAdd.Enabled = true; + btnEdit.Enabled = false; + btnSave.Enabled = false; + btnDel.Enabled = false; + btnCanel.Enabled = false; + SetControlStatus(this.groupBox1, false); + ClearControlsText(this.groupBox1); + break; + } + } + } + + public override bool ValidateData() + { +#foreach($info in $EntityList) +#if(!${info.isIdentity}&&${info.isCheck}) + if (string.IsNullOrEmpty(${info.controlName}.Text)) + { + MessageBox.Show("${info.controlName}不能为空!"); + return false; + } +#end +#end + return true; + } + /// + /// 获取数据 + /// + /// + private List<${tableName}> GetData() + { + List<${tableName}> data = new List<${tableName}>(); + data = _${tableName}Services.Query(); + return data; + } + } +} diff --git a/WinformDevFramework/Template/FormDesigner.vm b/WinformDevFramework/Template/FormDesigner.vm new file mode 100644 index 0000000000000000000000000000000000000000..004a9d94bf84170c9e77318e4eb9ec0417d7cead --- /dev/null +++ b/WinformDevFramework/Template/FormDesigner.vm @@ -0,0 +1,106 @@ +namespace ${NameSpace} +{ + partial class Frm${tableName} + { + /// + /// 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() + { +#foreach($info in $EntityList) +#if(!${info.isIdentity}) + this.${info.labelName}= new System.Windows.Forms.Label(); + this.${info.controlName}=new System.Windows.Forms.${info.controlType}(); +#end +#end + this.palTools.SuspendLayout(); + this.tabControl1.SuspendLayout(); + this.tabDataEdit.SuspendLayout(); + this.groupBox1.SuspendLayout(); + this.flowLayoutPanelTools.SuspendLayout(); + this.SuspendLayout(); + // + // groupBox1 + // +#foreach($info in $EntityList) +#if(!${info.isIdentity}) + this.${info.labelName} = new System.Windows.Forms.Label(); + this.${info.controlName}=new System.Windows.Forms.${info.controlType}(); + this.groupBox1.Controls.Add(this.${info.controlName}); + this.groupBox1.Controls.Add(this.${info.labelName}); + this.groupBox1.Controls.SetChildIndex(${info.labelName}, 0); + this.groupBox1.Controls.SetChildIndex(${info.controlName}, 0); +#end +#end + this.groupBox1.Controls.SetChildIndex(this.txtID, 0); + +#set($y = 35) +#set($x = 220) +#set($ylocation = 0) +#set($xlocation = 0) +#set($count = 0) +#foreach($info in $EntityList) +#if(!${info.isIdentity}) +#set($xlocation = $x*($count%3) + 10) +#set($ylocation = $y*($count/3)+10) +#set($count = $count + 1) + this.${info.labelName}.Location = new System.Drawing.Point($xlocation, $ylocation); + this.${info.labelName}.Name = "${info.labelName}"; + this.${info.labelName}.Size = new System.Drawing.Size(85, 23); + this.${info.labelName}.Text = "${info.labelText}"; + this.${info.labelName}.TextAlign = System.Drawing.ContentAlignment.MiddleRight; +#set($xx = $xlocation+90) + this.${info.controlName}.Location = new System.Drawing.Point($xx, $ylocation); + this.${info.controlName}.Name = "${info.controlName}"; + this.${info.controlName}.Size = new System.Drawing.Size(130, 23); +#end +#end + + // + // FrmDicData + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(800, 450); + this.Name = "Frm${tableName}"; + this.Text = "Frm${tableName}"; + this.palTools.ResumeLayout(false); + this.tabControl1.ResumeLayout(false); + this.tabDataEdit.ResumeLayout(false); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.flowLayoutPanelTools.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion +#foreach($info in $EntityList) +#if(!${info.isIdentity}) + private ${info.controlType} ${info.controlName}; + private Label ${info.labelName}; +#end +#end + } +} \ No newline at end of file diff --git a/WinformDevFramework/Template/IRepositoryCreate.cs b/WinformDevFramework/Template/IRepositoryCreate.cs index 9182306bb1f30039d0c31c926975f13c3f78f0a5..cadc708aaeb91f014cfba76795eb533d5b565dc9 100644 --- a/WinformDevFramework/Template/IRepositoryCreate.cs +++ b/WinformDevFramework/Template/IRepositoryCreate.cs @@ -8,7 +8,7 @@ using NVelocity; using NVelocity.App; using NVelocity.Runtime; -namespace WinformDevFramework.Models +namespace WinformDevFramework { public class IRepositoryCreate { @@ -32,7 +32,7 @@ namespace WinformDevFramework.Models context.Put("NameSpace", NameSpace); context.Put("outdir", outdir); //从文件中读取模板 - Template template = velocityEngine.GetTemplate(@"\IRepository.vm"); + NVelocity.Template template = velocityEngine.GetTemplate(@"\IRepository.vm"); if (!Directory.Exists(outdir + "\\IRepository")) { Directory.CreateDirectory(outdir + "\\IRepository"); diff --git a/WinformDevFramework/Template/IServicesCreate.cs b/WinformDevFramework/Template/IServicesCreate.cs index f686a2e5c3b1ed1bcdb0a883e0ac65beece8e362..eb9b5b64f1c5866155c14a181ff51f3e83381746 100644 --- a/WinformDevFramework/Template/IServicesCreate.cs +++ b/WinformDevFramework/Template/IServicesCreate.cs @@ -8,7 +8,7 @@ using NVelocity; using NVelocity.App; using NVelocity.Runtime; -namespace WinformDevFramework.Models +namespace WinformDevFramework { public class IServicesCreate { @@ -32,7 +32,7 @@ namespace WinformDevFramework.Models context.Put("NameSpace", NameSpace); context.Put("outdir", outdir); //从文件中读取模板 - Template template = velocityEngine.GetTemplate(@"\IServices.vm"); + NVelocity.Template template = velocityEngine.GetTemplate(@"\IServices.vm"); if (!Directory.Exists(outdir + "\\IServices")) { Directory.CreateDirectory(outdir + "\\IServices"); diff --git a/WinformDevFramework/Template/RepositoryCreate.cs b/WinformDevFramework/Template/RepositoryCreate.cs index c19249ba7a5b8d2e05e871f754c6190f5ba3881d..2d69168b8cf68b56ddb3277f8da9c481d1483fb1 100644 --- a/WinformDevFramework/Template/RepositoryCreate.cs +++ b/WinformDevFramework/Template/RepositoryCreate.cs @@ -8,7 +8,7 @@ using NVelocity; using NVelocity.App; using NVelocity.Runtime; -namespace WinformDevFramework.Models +namespace WinformDevFramework { public class RepositoryCreate { @@ -32,7 +32,7 @@ namespace WinformDevFramework.Models context.Put("NameSpace", NameSpace); context.Put("outdir", outdir); //从文件中读取模板 - Template template = velocityEngine.GetTemplate(@"\Repository.vm"); + NVelocity.Template template = velocityEngine.GetTemplate(@"\Repository.vm"); if (!Directory.Exists(outdir + "\\Repository")) { Directory.CreateDirectory(outdir + "\\Repository"); diff --git a/WinformDevFramework/Template/ServicesCreate.cs b/WinformDevFramework/Template/ServicesCreate.cs index 29600d71fb67e1010cde556719b1f636c905e565..6c3ab28fa92bd8b0cdc5794594c45039bf70c633 100644 --- a/WinformDevFramework/Template/ServicesCreate.cs +++ b/WinformDevFramework/Template/ServicesCreate.cs @@ -8,7 +8,7 @@ using NVelocity; using NVelocity.App; using NVelocity.Runtime; -namespace WinformDevFramework.Models +namespace WinformDevFramework { public class ServicesCreate { @@ -32,7 +32,7 @@ namespace WinformDevFramework.Models context.Put("NameSpace", NameSpace); context.Put("outdir", outdir); //从文件中读取模板 - Template template = velocityEngine.GetTemplate(@"\Services.vm"); + NVelocity.Template template = velocityEngine.GetTemplate(@"\Services.vm"); if (!Directory.Exists(outdir + "\\Services")) { Directory.CreateDirectory(outdir + "\\Services"); diff --git a/WinformDevFramework/Template/WinformCreate.cs b/WinformDevFramework/Template/WinformCreate.cs new file mode 100644 index 0000000000000000000000000000000000000000..373c9427e9c6532f365dfed56a63711cbf1dc812 --- /dev/null +++ b/WinformDevFramework/Template/WinformCreate.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Commons.Collections; +using NVelocity; +using NVelocity.App; +using NVelocity.Runtime; + +namespace WinformDevFramework +{ + public class WinformCreate + { + private static readonly string templateDir = AppDomain.CurrentDomain.BaseDirectory + @"\Template\"; + public bool Create(string tableName, string NameSpace, string outdir, List EntityList) + { + + VelocityEngine velocityEngine = new VelocityEngine(); + ExtendedProperties props = new ExtendedProperties(); + props.AddProperty(RuntimeConstants.RESOURCE_LOADER, @"file"); + props.AddProperty(RuntimeConstants.FILE_RESOURCE_LOADER_PATH, templateDir); + props.AddProperty(RuntimeConstants.INPUT_ENCODING, "utf-8"); + props.AddProperty(RuntimeConstants.OUTPUT_ENCODING, "utf-8"); + //模板的缓存设置 + props.AddProperty(RuntimeConstants.FILE_RESOURCE_LOADER_CACHE, true); //是否缓存 + props.AddProperty("file.resource.loader.modificationCheckInterval", (Int64)30); //缓存时间(秒) + velocityEngine.Init(props); + //为模板变量赋值 + VelocityContext context = new VelocityContext(); + context.Put("tableName", tableName); + context.Put("NameSpace", NameSpace); + context.Put("outdir", outdir); + context.Put("EntityList", EntityList); + //从文件中读取模板 + NVelocity.Template template = velocityEngine.GetTemplate(@"\Form.vm"); + NVelocity.Template template2 = velocityEngine.GetTemplate(@"\FormDesigner.vm"); + + if (!Directory.Exists(outdir + "\\From")) + { + Directory.CreateDirectory(outdir + "\\From"); + } + //合并模板 + using (StreamWriter writer = new StreamWriter(outdir + $"\\From\\Frm{tableName.Substring(0, 1).ToUpper()}{tableName.Substring(1)}.Designer.cs", false)) + { + template2.Merge(context, writer); + } + using (StreamWriter writer = new StreamWriter(outdir + $"\\From\\Frm{tableName.Substring(0, 1).ToUpper()}{tableName.Substring(1)}.cs", false)) + { + template.Merge(context, writer); + } + return true; + } + } +} diff --git a/WinformDevFramework/WinformDevFramework.csproj b/WinformDevFramework/WinformDevFramework.csproj index d164eeca9035b45221a829b00fd16ceb4203a4fe..e929ef9e911f47ccc936e38cc1cedbd86cc2a011 100644 --- a/WinformDevFramework/WinformDevFramework.csproj +++ b/WinformDevFramework/WinformDevFramework.csproj @@ -15,6 +15,7 @@ + @@ -36,6 +37,12 @@ ..\..\..\..\新建文件夹\SunnyUI\Bin\net6.0-windows\SunnyUI.dll + + ..\..\..\..\Documents\TreeListView\System.Runtime.InteropServices.APIs.dll + + + ..\..\..\..\Documents\TreeListView\System.Windows.Forms.TreeListView.dll + @@ -108,6 +115,9 @@ Always + + Always + Always @@ -195,6 +205,12 @@ Always + + Always + + + Always + Always diff --git a/WinformDevFramework/appsettings.json b/WinformDevFramework/appsettings.json index d26d100591d1fee04d06434aa2c7ae30f649a157..16d9978df7b772d1c93ff6748f0ad56cbcf153fa 100644 --- a/WinformDevFramework/appsettings.json +++ b/WinformDevFramework/appsettings.json @@ -4,7 +4,7 @@ "SqlConnection": "Server=localhost;Database=winformdevframework;User Id = sa; Password=123456;Connect Timeout = 2" }, "Update": { - "AtuoUpdate": "true", + "AtuoUpdate": "false", "Version": "1.1.0.1", "Url": "http://121.4.95.243:8090/Updates/AutoUpdaterStarter.xml"//更新服务器地址 }, diff --git "a/\346\225\260\346\215\256\345\272\223\345\244\207\344\273\275/DB.sql" "b/\346\225\260\346\215\256\345\272\223\345\244\207\344\273\275/DB.sql" new file mode 100644 index 0000000000000000000000000000000000000000..28adf292e590d7b689e8f92324638c056057bd4b --- /dev/null +++ "b/\346\225\260\346\215\256\345\272\223\345\244\207\344\273\275/DB.sql" @@ -0,0 +1,1605 @@ +/* + Navicat Premium Data Transfer + + Source Server : 1 + Source Server Type : SQL Server + Source Server Version : 13004001 + Source Host : 127.0.0.1:1433 + Source Catalog : winformdevframework + Source Schema : dbo + + Target Server Type : SQL Server + Target Server Version : 13004001 + File Encoding : 65001 + + Date: 28/08/2023 17:58:11 +*/ + + +-- ---------------------------- +-- Table structure for sysDataSource +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[sysDataSource]') AND type IN ('U')) + DROP TABLE [dbo].[sysDataSource] +GO + +CREATE TABLE [dbo].[sysDataSource] ( + [ID] int IDENTITY(1,1) NOT NULL, + [ConnectName] varchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [Host] varchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [DataBaseName] varchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [Username] varchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [Password] varchar(255) COLLATE Chinese_PRC_CI_AS NULL +) +GO + +ALTER TABLE [dbo].[sysDataSource] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'连接名', +'SCHEMA', N'dbo', +'TABLE', N'sysDataSource', +'COLUMN', N'ConnectName' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'主机', +'SCHEMA', N'dbo', +'TABLE', N'sysDataSource', +'COLUMN', N'Host' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'数据库', +'SCHEMA', N'dbo', +'TABLE', N'sysDataSource', +'COLUMN', N'DataBaseName' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户名', +'SCHEMA', N'dbo', +'TABLE', N'sysDataSource', +'COLUMN', N'Username' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'密码', +'SCHEMA', N'dbo', +'TABLE', N'sysDataSource', +'COLUMN', N'Password' +GO + + +-- ---------------------------- +-- Records of sysDataSource +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[sysDataSource] ON +GO + +INSERT INTO [dbo].[sysDataSource] ([ID], [ConnectName], [Host], [DataBaseName], [Username], [Password]) VALUES (N'1', N'本机', N'localhost', N'winformdevframework', N'sa', N'123456') +GO + +SET IDENTITY_INSERT [dbo].[sysDataSource] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for sysDicData +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[sysDicData]') AND type IN ('U')) + DROP TABLE [dbo].[sysDicData] +GO + +CREATE TABLE [dbo].[sysDicData] ( + [ID] int IDENTITY(1,1) NOT NULL, + [DicTypeID] int NULL, + [DicData] varchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [Remark] varchar(255) COLLATE Chinese_PRC_CI_AS NULL +) +GO + +ALTER TABLE [dbo].[sysDicData] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'字典类型ID', +'SCHEMA', N'dbo', +'TABLE', N'sysDicData', +'COLUMN', N'DicTypeID' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'内容', +'SCHEMA', N'dbo', +'TABLE', N'sysDicData', +'COLUMN', N'DicData' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'备注', +'SCHEMA', N'dbo', +'TABLE', N'sysDicData', +'COLUMN', N'Remark' +GO + + +-- ---------------------------- +-- Records of sysDicData +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[sysDicData] ON +GO + +INSERT INTO [dbo].[sysDicData] ([ID], [DicTypeID], [DicData], [Remark]) VALUES (N'1', N'1', N'Menu', N''), (N'2', N'1', N'Form', N''), (N'3', N'1', N'Button', N'') +GO + +SET IDENTITY_INSERT [dbo].[sysDicData] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for sysDicType +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[sysDicType]') AND type IN ('U')) + DROP TABLE [dbo].[sysDicType] +GO + +CREATE TABLE [dbo].[sysDicType] ( + [ID] int IDENTITY(1,1) NOT NULL, + [DicTypeName] varchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [Remark] varchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [DicTypeCode] varchar(255) COLLATE Chinese_PRC_CI_AS NULL +) +GO + +ALTER TABLE [dbo].[sysDicType] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'字典类型名称', +'SCHEMA', N'dbo', +'TABLE', N'sysDicType', +'COLUMN', N'DicTypeName' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'备注', +'SCHEMA', N'dbo', +'TABLE', N'sysDicType', +'COLUMN', N'Remark' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'字典类型编码', +'SCHEMA', N'dbo', +'TABLE', N'sysDicType', +'COLUMN', N'DicTypeCode' +GO + + +-- ---------------------------- +-- Records of sysDicType +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[sysDicType] ON +GO + +INSERT INTO [dbo].[sysDicType] ([ID], [DicTypeName], [Remark], [DicTypeCode]) VALUES (N'1', N'菜单类型', N'', N'MenuType') +GO + +SET IDENTITY_INSERT [dbo].[sysDicType] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for sysMenu +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[sysMenu]') AND type IN ('U')) + DROP TABLE [dbo].[sysMenu] +GO + +CREATE TABLE [dbo].[sysMenu] ( + [ID] int IDENTITY(1,1) NOT NULL, + [ParentID] int NULL, + [Title] varchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [URL] varchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [Icon] varchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [SortOrder] int NULL, + [MenuType] varchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [CreatedBy] int NULL, + [CreatedDate] datetime NULL, + [UpdatedBy] int NULL, + [UpdatedDate] datetime NULL, + [MenuCode] varchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [PermissionCode] varchar(255) COLLATE Chinese_PRC_CI_AS NULL +) +GO + +ALTER TABLE [dbo].[sysMenu] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'菜单ID', +'SCHEMA', N'dbo', +'TABLE', N'sysMenu', +'COLUMN', N'ID' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'父菜单ID', +'SCHEMA', N'dbo', +'TABLE', N'sysMenu', +'COLUMN', N'ParentID' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'菜单标题', +'SCHEMA', N'dbo', +'TABLE', N'sysMenu', +'COLUMN', N'Title' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'菜单链接地址', +'SCHEMA', N'dbo', +'TABLE', N'sysMenu', +'COLUMN', N'URL' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'菜单图标', +'SCHEMA', N'dbo', +'TABLE', N'sysMenu', +'COLUMN', N'Icon' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'菜单排序顺序', +'SCHEMA', N'dbo', +'TABLE', N'sysMenu', +'COLUMN', N'SortOrder' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'菜单类型', +'SCHEMA', N'dbo', +'TABLE', N'sysMenu', +'COLUMN', N'MenuType' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建人', +'SCHEMA', N'dbo', +'TABLE', N'sysMenu', +'COLUMN', N'CreatedBy' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'sysMenu', +'COLUMN', N'CreatedDate' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新者', +'SCHEMA', N'dbo', +'TABLE', N'sysMenu', +'COLUMN', N'UpdatedBy' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'更新时间', +'SCHEMA', N'dbo', +'TABLE', N'sysMenu', +'COLUMN', N'UpdatedDate' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'菜单编码', +'SCHEMA', N'dbo', +'TABLE', N'sysMenu', +'COLUMN', N'MenuCode' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'权限标识', +'SCHEMA', N'dbo', +'TABLE', N'sysMenu', +'COLUMN', N'PermissionCode' +GO + + +-- ---------------------------- +-- Records of sysMenu +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[sysMenu] ON +GO + +INSERT INTO [dbo].[sysMenu] ([ID], [ParentID], [Title], [URL], [Icon], [SortOrder], [MenuType], [CreatedBy], [CreatedDate], [UpdatedBy], [UpdatedDate], [MenuCode], [PermissionCode]) VALUES (N'1', N'0', N'WinformDevFramework', N'', N'Resources\设置.png', N'1', N'Menu', NULL, N'2023-08-12 13:23:34.000', N'8', N'2023-08-12 13:23:34.000', N'SystemSetup', N'SystemSetup'), (N'2', N'1034', N'菜单设置', N'FrmMenu', N'Resources\菜单.png', N'1', N'Form', NULL, N'2023-08-12 13:24:06.000', N'8', N'2023-08-12 13:24:06.000', N'FrmMenu', N'FrmMenu'), (N'3', N'1034', N'用户设置', N'FrmUser', N'Resources\用户管理.png', N'2', N'Form', NULL, N'2023-08-12 13:44:33.000', N'8', N'2023-08-12 13:44:33.000', N'FrmUser', N'FrmUser'), (N'4', N'2', N'新增', NULL, NULL, NULL, N'Button', NULL, N'2023-08-12 13:45:06.000', NULL, NULL, N'btnAdd', N'FrmMenu:btnAdd'), (N'10', N'1034', N'角色管理', N'FrmRole', N'Resources\角色管理.png', N'4', N'Form', N'8', N'2023-08-15 23:43:10.000', N'8', N'2023-08-15 23:43:10.000', N'FrmRole', N'FrmRole'), (N'11', N'2', N'保存', NULL, NULL, NULL, N'Button', NULL, N'2023-08-16 13:47:57.000', NULL, NULL, N'btnSave', N'FrmMenu:btnSave'), (N'12', N'2', N'关闭', N'', N'', N'1', N'Button', N'8', N'2023-08-16 13:58:39.000', NULL, NULL, N'btnClose', N'FrmMenu:btnClose'), (N'13', N'2', N'编辑', N'', N'', N'1', N'Button', N'8', N'2023-08-16 13:59:15.000', NULL, NULL, N'btnEdit', N'FrmMenu:btnEdit'), (N'14', N'2', N'撤销', N'', N'', N'1', N'Button', N'8', N'2023-08-16 14:02:19.000', NULL, NULL, N'btnCanel', N'FrmMenu:btnCanel'), (N'15', N'2', N'删除', N'', N'', N'1', N'Button', N'8', N'2023-08-16 14:03:13.000', NULL, NULL, N'btnDel', N'FrmMenu:btnDel'), (N'16', N'3', N'新增', N'', N'', N'1', N'Button', N'8', N'2023-08-16 14:04:50.000', NULL, NULL, N'btnAdd', N'FrmUser:btnAdd'), (N'17', N'3', N'保存', N'', N'', N'1', N'Button', N'8', N'2023-08-16 14:06:47.000', NULL, NULL, N'btnSave', N'FrmUser:btnSave'), (N'18', N'3', N'关闭', N'', N'', N'1', N'Button', N'8', N'2023-08-16 14:07:39.000', NULL, NULL, N'btnClose', N'FrmUser:btnClose'), (N'19', N'3', N'编辑', N'', N'', N'1', N'Button', N'8', N'2023-08-16 14:08:10.000', NULL, NULL, N'btnEdit', N'FrmUser:btnEdit'), (N'20', N'3', N'撤销', N'', N'', N'1', N'Button', N'8', N'2023-08-16 14:08:41.000', NULL, NULL, N'btnCanel', N'FrmUser:btnCanel'), (N'21', N'3', N'删除', N'', N'', N'1', N'Button', N'8', N'2023-08-16 14:09:16.000', NULL, NULL, N'btnDel', N'FrmUser:btnDel'), (N'22', N'3', N'重置密码', N'', N'', N'1', N'Button', N'8', N'2023-08-16 14:10:16.000', NULL, NULL, N'btnResetPW', N'FrmUser:btnResetPW'), (N'23', N'1034', N'数据源维护', N'FrmDataSource', N'Resources\数据源.png', N'5', N'Form', N'8', N'2023-08-16 17:21:20.000', N'8', N'2023-08-16 17:21:20.000', N'FrmDataSource', N'FrmDataSource'), (N'24', N'23', N'新增', N'', N'', N'1', N'Button', N'8', N'2023-08-16 17:49:00.000', NULL, NULL, N'btnAdd', N'FrmDataSource:btnAdd'), (N'25', N'23', N'保存', N'', N'', N'1', N'Button', N'8', N'2023-08-16 17:49:42.000', NULL, NULL, N'btnSave', N'FrmDataSource:btnSave'), (N'26', N'1034', N'生成代码', N'FrmCreateCode', N'Resources\生成代码.png', N'1', N'Form', N'8', N'2023-08-16 18:18:51.000', N'8', N'2023-08-16 18:18:51.000', N'FrmCreateCode', N'FrmCreateCode'), (N'27', N'10', N'新增', N'', N'', N'1', N'Button', N'8', N'2023-08-17 10:24:18.000', NULL, NULL, N'btnAdd', N'FrmRole:btnAdd'), (N'28', N'10', N'保存', N'', N'', N'1', N'Button', N'8', N'2023-08-17 11:02:07.000', NULL, NULL, N'btnSave', N'FrmRole:btnSave'), (N'29', N'10', N'关闭', N'', N'', N'1', N'Button', N'8', N'2023-08-17 12:26:28.000', NULL, NULL, N'btnClose', N'FrmRole:btnClose'), (N'30', N'10', N'编辑', N'', N'', N'1', N'Button', N'8', N'2023-08-17 14:12:53.000', NULL, NULL, N'btnEdit', N'FrmRole:btnEdit'), (N'31', N'10', N'撤销', N'', N'', N'1', N'Button', N'8', N'2023-08-17 14:13:29.000', NULL, NULL, N'btnCanel', N'FrmRole:btnCanel'), (N'32', N'10', N'删除', N'', N'', N'1', N'Button', N'8', N'2023-08-17 14:14:26.000', NULL, NULL, N'btnDel', N'FrmRole:btnDel'), (N'33', N'1034', N'消息通知', N'FrmMessage', N'Resources\消息.png', N'1', N'Form', N'8', N'2023-08-17 16:10:11.000', N'8', N'2023-08-17 16:10:11.000', N'FrmMessage', N'FrmMessage'), (N'34', N'1034', N'测试', N'Form1', N'Resources\测试.png', N'1', N'Form', N'8', N'2023-08-17 23:55:07.000', N'8', N'2023-08-17 23:55:07.000', N'Form1', N'Form1'), (N'1033', N'1', N'基础资料', N'', N'Resources\基础资料.png', N'1', N'Menu', N'8', N'2023-08-18 12:39:01.000', N'8', N'2023-08-18 12:39:01.000', N'BaseData', N'BaseData'), (N'1034', N'1', N'系统设置', N'', N'Resources\设置.png', N'1', N'Menu', NULL, N'2023-08-12 13:23:34.000', N'8', N'2023-08-12 13:23:34.000', N'SystemSetup', N'SystemSetup'), (N'1035', N'1034', N'字典类型', N'FrmDicType', N'Resources\字典类型.png', N'1', N'Form', N'8', N'2023-08-18 14:30:07.000', N'8', N'2023-08-18 14:30:07.000', N'FrmDicType', N'FrmDicType'), (N'1036', N'1034', N'字典内容', N'FrmDicData', N'Resources\字典内容.png', N'1', N'Form', N'8', N'2023-08-18 15:42:05.000', NULL, NULL, N'FrmDicData', N'FrmDicData'), (N'1037', N'23', N'编辑', N'', N'', N'1', N'Button', N'8', N'2023-08-18 19:12:01.000', N'8', N'2023-08-18 19:12:01.000', N'btnEdit', N'FrmDataSource:btnEdit'), (N'1038', N'23', N'撤销', N'', N'', N'1', N'Button', N'8', N'2023-08-18 19:15:03.000', NULL, NULL, N'btnCanel', N'FrmDataSource:btnCanel'), (N'1039', N'23', N'删除', N'', N'', N'1', N'Button', N'8', N'2023-08-18 19:16:07.000', NULL, NULL, N'btnDel', N'FrmDataSource:btnDel'), (N'1040', N'23', N'关闭', N'', N'', N'1', N'Button', N'8', N'2023-08-18 19:16:42.000', NULL, NULL, N'btnClose', N'FrmDataSource:btnClose'), (N'2033', N'1033', N'供应商信息', N'FrmSupplier', N'C:\Users\64842\Desktop\代码开发框架\WinformGeneralDeveloperFrame\WinformDevFramework\Resources\供应商.png', N'1', N'Form', N'8', N'2023-08-22 12:12:21.000', NULL, NULL, N'FrmSupplier', N'FrmSupplier') +GO + +SET IDENTITY_INSERT [dbo].[sysMenu] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for sysMessage +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[sysMessage]') AND type IN ('U')) + DROP TABLE [dbo].[sysMessage] +GO + +CREATE TABLE [dbo].[sysMessage] ( + [ID] int IDENTITY(1,1) NOT NULL, + [Title] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [Content] nvarchar(2000) COLLATE Chinese_PRC_CI_AS NULL, + [FromUserID] int NULL, + [ToUserID] int NULL, + [IsSend] bit NULL, + [CreateTime] datetime NULL, + [SendTime] datetime NULL +) +GO + +ALTER TABLE [dbo].[sysMessage] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'消息标题', +'SCHEMA', N'dbo', +'TABLE', N'sysMessage', +'COLUMN', N'Title' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'消息内容', +'SCHEMA', N'dbo', +'TABLE', N'sysMessage', +'COLUMN', N'Content' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'发送人', +'SCHEMA', N'dbo', +'TABLE', N'sysMessage', +'COLUMN', N'FromUserID' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'接收人', +'SCHEMA', N'dbo', +'TABLE', N'sysMessage', +'COLUMN', N'ToUserID' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'是否发送', +'SCHEMA', N'dbo', +'TABLE', N'sysMessage', +'COLUMN', N'IsSend' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'sysMessage', +'COLUMN', N'CreateTime' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'发送时间', +'SCHEMA', N'dbo', +'TABLE', N'sysMessage', +'COLUMN', N'SendTime' +GO + + +-- ---------------------------- +-- Records of sysMessage +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[sysMessage] ON +GO + +INSERT INTO [dbo].[sysMessage] ([ID], [Title], [Content], [FromUserID], [ToUserID], [IsSend], [CreateTime], [SendTime]) VALUES (N'3', N'测试', N'这是一条测试消息', N'8', N'8', N'1', N'2023-08-17 21:35:50.350', N'2023-08-17 21:52:55.763'), (N'4', N'11', N'11发发', N'8', N'8', N'1', N'2023-08-17 21:53:11.437', N'2023-08-17 21:53:11.743'), (N'5', N'11', N'11发发', N'8', N'8', N'1', N'2023-08-17 21:53:21.113', N'2023-08-17 21:53:21.773'), (N'6', N'11', N'11发发', N'8', N'8', N'1', N'2023-08-17 21:53:24.437', N'2023-08-17 21:53:24.757'), (N'7', N'11', N'11发发', N'8', N'8', N'1', N'2023-08-17 21:53:25.947', N'2023-08-17 21:53:26.757'), (N'8', N'11', N'11发发', N'8', N'8', N'1', N'2023-08-17 21:53:27.603', N'2023-08-17 21:53:27.763'), (N'9', N'11', N'11发发', N'8', N'10', N'1', N'2023-08-17 21:53:59.210', N'2023-08-17 21:55:16.433'), (N'10', N'11', N'11发发', N'8', N'10', N'1', N'2023-08-17 21:54:01.153', N'2023-08-17 21:55:16.443'), (N'11', N'11', N'11发发', N'8', N'10', N'1', N'2023-08-17 21:54:02.507', N'2023-08-17 21:55:16.457'), (N'12', N'11', N'11发发', N'8', N'10', N'1', N'2023-08-17 21:54:03.763', N'2023-08-17 21:55:16.463'), (N'13', N'11', N'11发发', N'8', N'10', N'1', N'2023-08-17 21:54:05.260', N'2023-08-17 21:55:16.473'), (N'14', N'11', N'11发发', N'8', N'10', N'1', N'2023-08-17 21:54:06.507', N'2023-08-17 21:55:16.480'), (N'15', N'11', N'11发发', N'8', N'10', N'1', N'2023-08-17 21:54:08.860', N'2023-08-17 21:55:16.487'), (N'16', N'来自王凯的消息', N'达瓦达瓦服务器服务器', N'8', N'10', N'1', N'2023-08-17 21:57:55.237', N'2023-08-17 21:57:55.443'), (N'17', N'来自王凯的消息', N'达瓦达瓦服务器服务器', N'8', N'8', N'1', N'2023-08-17 22:02:39.193', N'2023-08-17 22:02:40.063'), (N'18', N'来自王凯的消息', N'达瓦达瓦服务器服务器', N'8', N'10', N'1', N'2023-08-17 22:02:39.193', N'2023-08-17 22:02:39.477'), (N'19', N'来自王凯的消息', N'达瓦达瓦服务器服务器', N'8', N'11', N'1', N'2023-08-17 22:02:39.193', N'2023-08-18 00:29:46.680'), (N'1003', N'来自王凯的消息', N'这是一条测试消息', N'8', N'11', N'1', N'2023-08-18 00:30:44.810', N'2023-08-18 00:30:26.650'), (N'2003', N'111', N'111', N'8', N'8', N'1', N'2023-08-18 10:21:21.503', N'2023-08-18 10:21:22.153'), (N'2004', N'111', N'111', N'8', N'10', N'0', N'2023-08-18 10:21:21.503', NULL), (N'2005', N'111', N'111', N'8', N'11', N'0', N'2023-08-18 10:21:21.503', NULL), (N'2006', N'111', N'速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给', N'8', N'8', N'1', N'2023-08-18 12:38:28.083', N'2023-08-18 12:38:28.257'), (N'2007', N'111', N'速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给', N'8', N'8', N'1', N'2023-08-18 12:38:37.363', N'2023-08-18 12:38:38.257'), (N'2008', N'111', N'速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给', N'8', N'10', N'0', N'2023-08-18 12:38:37.363', NULL), (N'2009', N'111', N'速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给速度跟不上的过半数的根本VS的改变VS E给', N'8', N'11', N'0', N'2023-08-18 12:38:37.363', NULL), (N'2010', N'程序更新', N'程序有新版本了,重新启动即可自动更新', N'8', N'8', N'1', N'2023-08-19 01:13:45.923', N'2023-08-19 01:13:46.293'), (N'3003', N'测试', N'我是一条测试消息', N'8', N'8', N'1', N'2023-08-19 22:53:06.130', N'2023-08-19 22:53:06.587'), (N'3004', N'测试', N'我是一条测试消息', N'8', N'8', N'1', N'2023-08-20 00:27:17.673', N'2023-08-20 00:27:18.430'), (N'3005', N'1', N'1', N'8', N'8', N'1', N'2023-08-22 10:46:57.417', N'2023-08-22 10:46:57.710'), (N'3006', N'333', N'333', N'8', N'8', N'1', N'2023-08-22 19:03:16.177', N'2023-08-22 19:03:17.040'), (N'3007', N'333', N'333', N'8', N'10', N'0', N'2023-08-22 19:03:16.177', NULL), (N'3008', N'333', N'333', N'8', N'11', N'0', N'2023-08-22 19:03:16.177', NULL), (N'4005', N'1', N'1', N'8', N'8', N'1', N'2023-08-28 15:06:02.040', N'2023-08-28 15:06:02.167') +GO + +SET IDENTITY_INSERT [dbo].[sysMessage] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for sysRole +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[sysRole]') AND type IN ('U')) + DROP TABLE [dbo].[sysRole] +GO + +CREATE TABLE [dbo].[sysRole] ( + [ID] int IDENTITY(1,1) NOT NULL, + [RoleName] varchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [Remark] varchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [CreateBy] int NULL, + [CreateTime] datetime NULL, + [UpdateBy] int NULL, + [UpdateTime] datetime NULL +) +GO + +ALTER TABLE [dbo].[sysRole] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'角色名称', +'SCHEMA', N'dbo', +'TABLE', N'sysRole', +'COLUMN', N'RoleName' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'备注', +'SCHEMA', N'dbo', +'TABLE', N'sysRole', +'COLUMN', N'Remark' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建人', +'SCHEMA', N'dbo', +'TABLE', N'sysRole', +'COLUMN', N'CreateBy' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'创建时间', +'SCHEMA', N'dbo', +'TABLE', N'sysRole', +'COLUMN', N'CreateTime' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'修改人', +'SCHEMA', N'dbo', +'TABLE', N'sysRole', +'COLUMN', N'UpdateBy' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'修改时间', +'SCHEMA', N'dbo', +'TABLE', N'sysRole', +'COLUMN', N'UpdateTime' +GO + + +-- ---------------------------- +-- Records of sysRole +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[sysRole] ON +GO + +INSERT INTO [dbo].[sysRole] ([ID], [RoleName], [Remark], [CreateBy], [CreateTime], [UpdateBy], [UpdateTime]) VALUES (N'1', N'管理员', N'', N'1', N'2023-08-17 10:21:56.000', N'8', N'2023-08-22 12:15:55.800'), (N'9', N'开发', N'', N'8', N'2023-08-17 15:16:33.253', NULL, NULL) +GO + +SET IDENTITY_INSERT [dbo].[sysRole] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for sysRoleMenu +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[sysRoleMenu]') AND type IN ('U')) + DROP TABLE [dbo].[sysRoleMenu] +GO + +CREATE TABLE [dbo].[sysRoleMenu] ( + [RoleID] int NULL, + [MenuID] int NULL +) +GO + +ALTER TABLE [dbo].[sysRoleMenu] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'角色ID', +'SCHEMA', N'dbo', +'TABLE', N'sysRoleMenu', +'COLUMN', N'RoleID' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'菜单ID', +'SCHEMA', N'dbo', +'TABLE', N'sysRoleMenu', +'COLUMN', N'MenuID' +GO + + +-- ---------------------------- +-- Records of sysRoleMenu +-- ---------------------------- +BEGIN TRANSACTION +GO + +INSERT INTO [dbo].[sysRoleMenu] ([RoleID], [MenuID]) VALUES (N'1', N'1'), (N'1', N'1033'), (N'1', N'2033'), (N'1', N'1034'), (N'1', N'2'), (N'1', N'4'), (N'1', N'11'), (N'1', N'12'), (N'1', N'13'), (N'1', N'14'), (N'1', N'15'), (N'1', N'3'), (N'1', N'16'), (N'1', N'17'), (N'1', N'18'), (N'1', N'19'), (N'1', N'20'), (N'1', N'21'), (N'1', N'22'), (N'1', N'10'), (N'1', N'27'), (N'1', N'28'), (N'1', N'29'), (N'1', N'30'), (N'1', N'31'), (N'9', N'1'), (N'9', N'2'), (N'9', N'4'), (N'9', N'11'), (N'9', N'12'), (N'9', N'13'), (N'9', N'14'), (N'9', N'15'), (N'9', N'23'), (N'9', N'24'), (N'9', N'25'), (N'9', N'26'), (N'1', N'32'), (N'1', N'23'), (N'1', N'24'), (N'1', N'25'), (N'1', N'1037'), (N'1', N'1038'), (N'1', N'1039'), (N'1', N'1040'), (N'1', N'26'), (N'1', N'33'), (N'1', N'34'), (N'1', N'1035'), (N'1', N'1036') +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for sysUser +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[sysUser]') AND type IN ('U')) + DROP TABLE [dbo].[sysUser] +GO + +CREATE TABLE [dbo].[sysUser] ( + [ID] int IDENTITY(1,1) NOT NULL, + [Username] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [Password] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [Fullname] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [Email] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [PhoneNumber] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [CreateTime] datetime NULL, + [LastLoginTime] datetime NULL, + [Status] bit NULL, + [Sex] nvarchar(10) COLLATE Chinese_PRC_CI_AS NULL +) +GO + +ALTER TABLE [dbo].[sysUser] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'唯一标识用户的主键', +'SCHEMA', N'dbo', +'TABLE', N'sysUser', +'COLUMN', N'ID' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户登录名', +'SCHEMA', N'dbo', +'TABLE', N'sysUser', +'COLUMN', N'Username' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户登录密码', +'SCHEMA', N'dbo', +'TABLE', N'sysUser', +'COLUMN', N'Password' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户姓名', +'SCHEMA', N'dbo', +'TABLE', N'sysUser', +'COLUMN', N'Fullname' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户电子邮件', +'SCHEMA', N'dbo', +'TABLE', N'sysUser', +'COLUMN', N'Email' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户手机号码', +'SCHEMA', N'dbo', +'TABLE', N'sysUser', +'COLUMN', N'PhoneNumber' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'账号创建时间', +'SCHEMA', N'dbo', +'TABLE', N'sysUser', +'COLUMN', N'CreateTime' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'最后登陆时间', +'SCHEMA', N'dbo', +'TABLE', N'sysUser', +'COLUMN', N'LastLoginTime' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户状态 启用 禁用', +'SCHEMA', N'dbo', +'TABLE', N'sysUser', +'COLUMN', N'Status' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'性别', +'SCHEMA', N'dbo', +'TABLE', N'sysUser', +'COLUMN', N'Sex' +GO + + +-- ---------------------------- +-- Records of sysUser +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[sysUser] ON +GO + +INSERT INTO [dbo].[sysUser] ([ID], [Username], [Password], [Fullname], [Email], [PhoneNumber], [CreateTime], [LastLoginTime], [Status], [Sex]) VALUES (N'8', N'wangkai', N'123456', N'王凯', N'648428741@qq.com', N'15029367414', N'2023-08-11 15:14:08.000', N'2023-08-28 17:37:27.070', N'1', N'男'), (N'10', N'admin', N'123456', N'管理员', N'', N'', N'2023-08-17 12:44:51.000', N'2023-08-17 21:55:15.390', N'1', N'男'), (N'11', N'test', N'123456', N'测试', N'', N'', N'2023-08-17 12:46:24.000', N'2023-08-18 00:29:45.600', N'1', N'男') +GO + +SET IDENTITY_INSERT [dbo].[sysUser] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for sysUserRole +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[sysUserRole]') AND type IN ('U')) + DROP TABLE [dbo].[sysUserRole] +GO + +CREATE TABLE [dbo].[sysUserRole] ( + [UserID] int NULL, + [RoleID] int NULL +) +GO + +ALTER TABLE [dbo].[sysUserRole] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'用户ID', +'SCHEMA', N'dbo', +'TABLE', N'sysUserRole', +'COLUMN', N'UserID' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'角色ID', +'SCHEMA', N'dbo', +'TABLE', N'sysUserRole', +'COLUMN', N'RoleID' +GO + + +-- ---------------------------- +-- Records of sysUserRole +-- ---------------------------- +BEGIN TRANSACTION +GO + +INSERT INTO [dbo].[sysUserRole] ([UserID], [RoleID]) VALUES (N'8', N'1'), (N'11', N'9') +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for w_Customer +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[w_Customer]') AND type IN ('U')) + DROP TABLE [dbo].[w_Customer] +GO + +CREATE TABLE [dbo].[w_Customer] ( + [ID] int IDENTITY(1,1) NOT NULL, + [SupplierName] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [ContactPerson] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [PhoneNumber] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [Email] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [BeginCollect] decimal(18,2) NULL, + [EndPayCollect] decimal(18,2) NULL, + [TaxtRate] decimal(18,4) NULL, + [SortOrder] int NULL, + [Status] bit NULL, + [Remark] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [Faxing] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [Address] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [Bank] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [TaxpayerNumber] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [BankAccount] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [LandlinePhone] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL +) +GO + +ALTER TABLE [dbo].[w_Customer] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'名称', +'SCHEMA', N'dbo', +'TABLE', N'w_Customer', +'COLUMN', N'SupplierName' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'联系人', +'SCHEMA', N'dbo', +'TABLE', N'w_Customer', +'COLUMN', N'ContactPerson' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'手机号码', +'SCHEMA', N'dbo', +'TABLE', N'w_Customer', +'COLUMN', N'PhoneNumber' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'邮箱', +'SCHEMA', N'dbo', +'TABLE', N'w_Customer', +'COLUMN', N'Email' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'期初应收', +'SCHEMA', N'dbo', +'TABLE', N'w_Customer', +'COLUMN', N'BeginCollect' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'期末应收', +'SCHEMA', N'dbo', +'TABLE', N'w_Customer', +'COLUMN', N'EndPayCollect' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'税率', +'SCHEMA', N'dbo', +'TABLE', N'w_Customer', +'COLUMN', N'TaxtRate' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'排序', +'SCHEMA', N'dbo', +'TABLE', N'w_Customer', +'COLUMN', N'SortOrder' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'状态', +'SCHEMA', N'dbo', +'TABLE', N'w_Customer', +'COLUMN', N'Status' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'备注', +'SCHEMA', N'dbo', +'TABLE', N'w_Customer', +'COLUMN', N'Remark' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'传真', +'SCHEMA', N'dbo', +'TABLE', N'w_Customer', +'COLUMN', N'Faxing' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'地址', +'SCHEMA', N'dbo', +'TABLE', N'w_Customer', +'COLUMN', N'Address' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'开户行', +'SCHEMA', N'dbo', +'TABLE', N'w_Customer', +'COLUMN', N'Bank' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'纳税人识别号', +'SCHEMA', N'dbo', +'TABLE', N'w_Customer', +'COLUMN', N'TaxpayerNumber' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'银行账号', +'SCHEMA', N'dbo', +'TABLE', N'w_Customer', +'COLUMN', N'BankAccount' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'固定电话', +'SCHEMA', N'dbo', +'TABLE', N'w_Customer', +'COLUMN', N'LandlinePhone' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'客户', +'SCHEMA', N'dbo', +'TABLE', N'w_Customer' +GO + + +-- ---------------------------- +-- Records of w_Customer +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[w_Customer] ON +GO + +SET IDENTITY_INSERT [dbo].[w_Customer] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for w_HandlerManger +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[w_HandlerManger]') AND type IN ('U')) + DROP TABLE [dbo].[w_HandlerManger] +GO + +CREATE TABLE [dbo].[w_HandlerManger] ( + [ID] int IDENTITY(1,1) NOT NULL, + [UserID] int NULL, + [Type] varchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [Status] bit NULL, + [SortOrder] int NULL +) +GO + +ALTER TABLE [dbo].[w_HandlerManger] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'人员ID', +'SCHEMA', N'dbo', +'TABLE', N'w_HandlerManger', +'COLUMN', N'UserID' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'类型', +'SCHEMA', N'dbo', +'TABLE', N'w_HandlerManger', +'COLUMN', N'Type' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'状态', +'SCHEMA', N'dbo', +'TABLE', N'w_HandlerManger', +'COLUMN', N'Status' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'排序', +'SCHEMA', N'dbo', +'TABLE', N'w_HandlerManger', +'COLUMN', N'SortOrder' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'经手人管理', +'SCHEMA', N'dbo', +'TABLE', N'w_HandlerManger' +GO + + +-- ---------------------------- +-- Records of w_HandlerManger +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[w_HandlerManger] ON +GO + +SET IDENTITY_INSERT [dbo].[w_HandlerManger] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for w_Project +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[w_Project]') AND type IN ('U')) + DROP TABLE [dbo].[w_Project] +GO + +CREATE TABLE [dbo].[w_Project] ( + [ID] int IDENTITY(1,1) NOT NULL, + [ProjectName] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [ProjectType] varchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [SortOrder] int NULL, + [Remark] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL +) +GO + +ALTER TABLE [dbo].[w_Project] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'收支项目', +'SCHEMA', N'dbo', +'TABLE', N'w_Project', +'COLUMN', N'ProjectName' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'类型', +'SCHEMA', N'dbo', +'TABLE', N'w_Project', +'COLUMN', N'ProjectType' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'排序', +'SCHEMA', N'dbo', +'TABLE', N'w_Project', +'COLUMN', N'SortOrder' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'备注', +'SCHEMA', N'dbo', +'TABLE', N'w_Project', +'COLUMN', N'Remark' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'收支项目', +'SCHEMA', N'dbo', +'TABLE', N'w_Project' +GO + + +-- ---------------------------- +-- Records of w_Project +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[w_Project] ON +GO + +SET IDENTITY_INSERT [dbo].[w_Project] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for w_SettlementAccount +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[w_SettlementAccount]') AND type IN ('U')) + DROP TABLE [dbo].[w_SettlementAccount] +GO + +CREATE TABLE [dbo].[w_SettlementAccount] ( + [ID] int IDENTITY(1,1) NOT NULL, + [Code] varchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [Name] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [BeginAmount] decimal(18,2) NULL, + [NowAmount] decimal(18,2) NULL, + [SortOrder] int NULL, + [Remark] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL +) +GO + +ALTER TABLE [dbo].[w_SettlementAccount] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'编号', +'SCHEMA', N'dbo', +'TABLE', N'w_SettlementAccount', +'COLUMN', N'Code' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'名称', +'SCHEMA', N'dbo', +'TABLE', N'w_SettlementAccount', +'COLUMN', N'Name' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'期初金额', +'SCHEMA', N'dbo', +'TABLE', N'w_SettlementAccount', +'COLUMN', N'BeginAmount' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'当前余额', +'SCHEMA', N'dbo', +'TABLE', N'w_SettlementAccount', +'COLUMN', N'NowAmount' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'排序', +'SCHEMA', N'dbo', +'TABLE', N'w_SettlementAccount', +'COLUMN', N'SortOrder' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'备注', +'SCHEMA', N'dbo', +'TABLE', N'w_SettlementAccount', +'COLUMN', N'Remark' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'结算账户', +'SCHEMA', N'dbo', +'TABLE', N'w_SettlementAccount' +GO + + +-- ---------------------------- +-- Records of w_SettlementAccount +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[w_SettlementAccount] ON +GO + +SET IDENTITY_INSERT [dbo].[w_SettlementAccount] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for w_Supplier +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[w_Supplier]') AND type IN ('U')) + DROP TABLE [dbo].[w_Supplier] +GO + +CREATE TABLE [dbo].[w_Supplier] ( + [ID] int IDENTITY(1,1) NOT NULL, + [SupplierName] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [ContactPerson] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [PhoneNumber] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [Email] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [BeginPay] decimal(18,2) NULL, + [EndPay] decimal(18,2) NULL, + [TaxtRate] decimal(18,4) NULL, + [SortOrder] int NULL, + [Status] bit NULL, + [Remark] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [Faxing] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [Address] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [Bank] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [TaxpayerNumber] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [BankAccount] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [LandlinePhone] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL +) +GO + +ALTER TABLE [dbo].[w_Supplier] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'名称', +'SCHEMA', N'dbo', +'TABLE', N'w_Supplier', +'COLUMN', N'SupplierName' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'联系人', +'SCHEMA', N'dbo', +'TABLE', N'w_Supplier', +'COLUMN', N'ContactPerson' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'手机号码', +'SCHEMA', N'dbo', +'TABLE', N'w_Supplier', +'COLUMN', N'PhoneNumber' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'邮箱', +'SCHEMA', N'dbo', +'TABLE', N'w_Supplier', +'COLUMN', N'Email' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'期初应付', +'SCHEMA', N'dbo', +'TABLE', N'w_Supplier', +'COLUMN', N'BeginPay' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'期末应付', +'SCHEMA', N'dbo', +'TABLE', N'w_Supplier', +'COLUMN', N'EndPay' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'税率', +'SCHEMA', N'dbo', +'TABLE', N'w_Supplier', +'COLUMN', N'TaxtRate' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'排序', +'SCHEMA', N'dbo', +'TABLE', N'w_Supplier', +'COLUMN', N'SortOrder' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'状态', +'SCHEMA', N'dbo', +'TABLE', N'w_Supplier', +'COLUMN', N'Status' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'备注', +'SCHEMA', N'dbo', +'TABLE', N'w_Supplier', +'COLUMN', N'Remark' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'传真', +'SCHEMA', N'dbo', +'TABLE', N'w_Supplier', +'COLUMN', N'Faxing' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'地址', +'SCHEMA', N'dbo', +'TABLE', N'w_Supplier', +'COLUMN', N'Address' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'开户行', +'SCHEMA', N'dbo', +'TABLE', N'w_Supplier', +'COLUMN', N'Bank' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'纳税人识别号', +'SCHEMA', N'dbo', +'TABLE', N'w_Supplier', +'COLUMN', N'TaxpayerNumber' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'银行账号', +'SCHEMA', N'dbo', +'TABLE', N'w_Supplier', +'COLUMN', N'BankAccount' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'固定电话', +'SCHEMA', N'dbo', +'TABLE', N'w_Supplier', +'COLUMN', N'LandlinePhone' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'供应商', +'SCHEMA', N'dbo', +'TABLE', N'w_Supplier' +GO + + +-- ---------------------------- +-- Records of w_Supplier +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[w_Supplier] ON +GO + +SET IDENTITY_INSERT [dbo].[w_Supplier] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- Table structure for w_Warehourses +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[w_Warehourses]') AND type IN ('U')) + DROP TABLE [dbo].[w_Warehourses] +GO + +CREATE TABLE [dbo].[w_Warehourses] ( + [ID] int IDENTITY(1,1) NOT NULL, + [WarehousesName] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [Address] nvarchar(255) COLLATE Chinese_PRC_CI_AS NULL, + [StorageFee] decimal(18,2) NULL, + [ChargePersonID] int NULL, + [SortOrder] int NULL, + [Remark] varchar(255) COLLATE Chinese_PRC_CI_AS NULL +) +GO + +ALTER TABLE [dbo].[w_Warehourses] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'仓库名称', +'SCHEMA', N'dbo', +'TABLE', N'w_Warehourses', +'COLUMN', N'WarehousesName' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'地址', +'SCHEMA', N'dbo', +'TABLE', N'w_Warehourses', +'COLUMN', N'Address' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'仓储费', +'SCHEMA', N'dbo', +'TABLE', N'w_Warehourses', +'COLUMN', N'StorageFee' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'负责人ID', +'SCHEMA', N'dbo', +'TABLE', N'w_Warehourses', +'COLUMN', N'ChargePersonID' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'排序', +'SCHEMA', N'dbo', +'TABLE', N'w_Warehourses', +'COLUMN', N'SortOrder' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'备注', +'SCHEMA', N'dbo', +'TABLE', N'w_Warehourses', +'COLUMN', N'Remark' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'仓库', +'SCHEMA', N'dbo', +'TABLE', N'w_Warehourses' +GO + + +-- ---------------------------- +-- Records of w_Warehourses +-- ---------------------------- +BEGIN TRANSACTION +GO + +SET IDENTITY_INSERT [dbo].[w_Warehourses] ON +GO + +SET IDENTITY_INSERT [dbo].[w_Warehourses] OFF +GO + +COMMIT +GO + + +-- ---------------------------- +-- View structure for ViewSysMenu +-- ---------------------------- +IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[ViewSysMenu]') AND type IN ('V')) + DROP VIEW [dbo].[ViewSysMenu] +GO + +CREATE VIEW [dbo].[ViewSysMenu] AS SELECT + menu.*, + pmenu.Title AS PMenuName, + [user].Fullname AS CreateByName, + user1.Fullname AS UpdateByName +FROM + dbo.sysMenu AS menu + LEFT JOIN + dbo.sysMenu AS pmenu + ON + menu.ParentID = pmenu.ID + LEFT JOIN + dbo.sysUser AS [user] + ON + menu.CreatedBy = [user].ID + LEFT JOIN + dbo.sysUser AS user1 + ON + menu.UpdatedBy = user1.ID +GO + + +-- ---------------------------- +-- Auto increment value for sysDataSource +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[sysDataSource]', RESEED, 1) +GO + + +-- ---------------------------- +-- Primary Key structure for table sysDataSource +-- ---------------------------- +ALTER TABLE [dbo].[sysDataSource] ADD CONSTRAINT [PK__sysDataS__3214EC278CD3C1D5] PRIMARY KEY CLUSTERED ([ID]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for sysDicData +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[sysDicData]', RESEED, 1001) +GO + + +-- ---------------------------- +-- Primary Key structure for table sysDicData +-- ---------------------------- +ALTER TABLE [dbo].[sysDicData] ADD CONSTRAINT [PK__sysDicDa__3214EC27BB670471] PRIMARY KEY CLUSTERED ([ID]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for sysDicType +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[sysDicType]', RESEED, 1001) +GO + + +-- ---------------------------- +-- Primary Key structure for table sysDicType +-- ---------------------------- +ALTER TABLE [dbo].[sysDicType] ADD CONSTRAINT [PK__sysDicTy__3214EC272718E4DB] PRIMARY KEY CLUSTERED ([ID]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for sysMenu +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[sysMenu]', RESEED, 3032) +GO + + +-- ---------------------------- +-- Primary Key structure for table sysMenu +-- ---------------------------- +ALTER TABLE [dbo].[sysMenu] ADD CONSTRAINT [PK__sysMenu__3214EC274164A6D3] PRIMARY KEY CLUSTERED ([ID]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for sysMessage +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[sysMessage]', RESEED, 4005) +GO + + +-- ---------------------------- +-- Primary Key structure for table sysMessage +-- ---------------------------- +ALTER TABLE [dbo].[sysMessage] ADD CONSTRAINT [PK__sysMessa__3214EC27D3539EA3] PRIMARY KEY CLUSTERED ([ID]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for sysRole +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[sysRole]', RESEED, 9) +GO + + +-- ---------------------------- +-- Primary Key structure for table sysRole +-- ---------------------------- +ALTER TABLE [dbo].[sysRole] ADD CONSTRAINT [PK__sysRole__3214EC27E20F2FDE] PRIMARY KEY CLUSTERED ([ID]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for sysUser +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[sysUser]', RESEED, 12) +GO + + +-- ---------------------------- +-- Primary Key structure for table sysUser +-- ---------------------------- +ALTER TABLE [dbo].[sysUser] ADD CONSTRAINT [PK__sysUser__3214EC275A91AA4C] PRIMARY KEY CLUSTERED ([ID]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for w_Customer +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[w_Customer]', RESEED, 1) +GO + + +-- ---------------------------- +-- Primary Key structure for table w_Customer +-- ---------------------------- +ALTER TABLE [dbo].[w_Customer] ADD CONSTRAINT [PK__w_Suppli__3214EC27CD6521CC] PRIMARY KEY CLUSTERED ([ID]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for w_HandlerManger +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[w_HandlerManger]', RESEED, 1) +GO + + +-- ---------------------------- +-- Primary Key structure for table w_HandlerManger +-- ---------------------------- +ALTER TABLE [dbo].[w_HandlerManger] ADD CONSTRAINT [PK__w_Handle__3214EC275590B6DA] PRIMARY KEY CLUSTERED ([ID]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for w_Project +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[w_Project]', RESEED, 1) +GO + + +-- ---------------------------- +-- Primary Key structure for table w_Project +-- ---------------------------- +ALTER TABLE [dbo].[w_Project] ADD CONSTRAINT [PK__w_Projec__3214EC27D8EEED0B] PRIMARY KEY CLUSTERED ([ID]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for w_SettlementAccount +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[w_SettlementAccount]', RESEED, 1) +GO + + +-- ---------------------------- +-- Primary Key structure for table w_SettlementAccount +-- ---------------------------- +ALTER TABLE [dbo].[w_SettlementAccount] ADD CONSTRAINT [PK__w_Settle__3214EC27E9E8C949] PRIMARY KEY CLUSTERED ([ID]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for w_Supplier +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[w_Supplier]', RESEED, 1) +GO + + +-- ---------------------------- +-- Primary Key structure for table w_Supplier +-- ---------------------------- +ALTER TABLE [dbo].[w_Supplier] ADD CONSTRAINT [PK__w_Suppli__3214EC27E84A5418] PRIMARY KEY CLUSTERED ([ID]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO + + +-- ---------------------------- +-- Auto increment value for w_Warehourses +-- ---------------------------- +DBCC CHECKIDENT ('[dbo].[w_Warehourses]', RESEED, 1) +GO + + +-- ---------------------------- +-- Primary Key structure for table w_Warehourses +-- ---------------------------- +ALTER TABLE [dbo].[w_Warehourses] ADD CONSTRAINT [PK__w_Wareho__3214EC27CA6E2E4E] PRIMARY KEY CLUSTERED ([ID]) +WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) +ON [PRIMARY] +GO +