我写代码一直是这个风格,废话不多,直接给大家贴代码,现在还是老规矩,具体代码如下所示:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
|
using system;
using system.collections.generic;
using system.componentmodel;
using system.data;
using system.drawing;
using system.drawing.imaging;
using system.linq;
using system.text;
using system.threading.tasks;
using system.windows.forms;
using system.data.sqlclient;
using system.collections;
using system.io;
namespace check_ticket
{
public partial class btn_uploadfile : form
{
string conn = "server=win-oudrehch;database=xtf;uid=sa;pwd=" ;
string sql = "" ;
int curnum = ; //奖项人数
int second = ; //防止二次被抽取
hashtable hashtable = new hashtable(); //存储编号
hashtable hashtable = new hashtable(); //存储获奖名单
hashtable hashtable = new hashtable(); //避免二次抽奖
dictionary< int , string > dict = new dictionary< int , string >(); //词典存储所有参赛者
random rd = new random();
int time = ;
label[] label = new label[];
int index = ; //词典key键值
int total = ; //label个数
int num = ; //获奖总数
string s = "" ;
int end = ; //抽奖结束
public btn_uploadfile()
{
initializecomponent();
}
private void form_load( object sender, eventargs e)
{
datagridview.forecolor = color.blue;
menu.visible = false ;
combobox.selectedindex = ;
this .timer.interval = ;
this .timer.interval = ;
this .timer.enabled = true ;
this .windowstate = formwindowstate.maximized;
}
private void getnumber( string s)
{
sqlconnection myconn = new sqlconnection(conn);
myconn.open();
sql = "select *from sumprize" ;
sqldataadapter da = new sqldataadapter(sql, myconn);
dataset ds = new dataset();
da.fill(ds);
switch (s)
{
case "一等奖" :
second = ;
curnum = convert.toint(ds.tables[].rows[][ "prizenum" ].tostring());
break ;
case "二等奖" :
second = ;
curnum = convert.toint(ds.tables[].rows[][ "prizenum" ].tostring());
break ;
case "三等奖" :
second = ;
curnum = convert.toint(ds.tables[].rows[][ "prizenum" ].tostring());
break ;
case "四等奖" :
second = ;
curnum = convert.toint(ds.tables[].rows[][ "prizenum" ].tostring());
break ;
case "五等奖" :
second = ;
curnum = convert.toint(ds.tables[].rows[][ "prizenum" ].tostring());
break ;
case "六等奖" :
second = ;
curnum = convert.toint(ds.tables[].rows[][ "prizenum" ].tostring());
break ;
case "请选择" :
curnum = ;
break ;
default :
break ;
}
}
private void button_click( object sender, eventargs e)
{
sqlconnection myconn = new sqlconnection(conn);
myconn.open();
//未选择抽奖项
if (curnum == )
{
messagebox.show( "未设置该奖项或未选择奖项,抽奖没有意义!!!" );
return ;
}
//处理已经被抽奖项
if (!hashtable.containsvalue(second))
{
combobox.enabled = true ;
hashtable.add(second, second);
}
else
{
messagebox.show( "此奖项已经被抽过,换个奖项吧?" );
return ;
}
string prize = combobox.text.tostring();
string sqlcount = "select sum(prizenum) as num from sumprize" ;
sqldataadapter sda = new sqldataadapter(sqlcount, myconn);
dataset ds = new dataset();
sda.fill(ds);
//设置有奖总人数
num = convert.toint(ds.tables[].rows[][ "num" ].tostring());
for ( int i = ; i < datagridview.rowcount-; i++)
{
dict.add(index, datagridview.rows[i].cells[ "workerid" ].value.tostring() + " " + datagridview.rows[i].cells[ "name" ].value.tostring());
index++;
}
myconn.close();
timer.start();
clearlabel();
bornlabel();
timer.enabled = true ;
combobox.enabled = false ;
}
private void button_click( object sender, eventargs e)
{
end = ;
menu.text = "" ;
hashtable.clear();
clearlabel();
button.enabled = true ;
button.enabled = true ;
button.enabled = false ;
menu.visible = false ;
btnadd.visible = false ;
tbnum.visible = false ;
ge.visible = false ;
addend.visible = false ;
lab.text = "中奖名单" ;
datagridview.visible = false ;
string sqlchecked = "delete from checked" ;
sql = "select *from ticket" ;
sqlconnection myconn = new sqlconnection(conn);
myconn.open();
sqldataadapter sda = new sqldataadapter(sql, myconn);
dataset ds = new dataset();
sda.fill(ds, "ticket" );
datagridview.datasource = ds;
datagridview.datamember = "ticket" ;
sqlcommand mycomm = new sqlcommand(sqlchecked, myconn);
mycomm.executenonquery();
myconn.close();
}
private void button_click( object sender, eventargs e)
{
menu.visible = false ;
clearlabel();
sql = "select workeridandname,prize from checked order by prizeid" ;
sqlconnection myconn = new sqlconnection(conn);
myconn.open();
sqldataadapter sda = new sqldataadapter(sql, myconn);
dataset ds = new dataset();
sda.fill(ds, "checked" );
datagridview.datasource = ds;
datagridview.datamember = "checked" ;
datagridview.visible = true ;
menu.text += "恭喜:\n" ;
for ( int i=;i<datagridview.rowcount-;i++)
{
menu.text += datagridview.rows[i].cells[ "workeridandname" ].value.tostring() + " 获得" + datagridview.rows[i].cells[ "prize" ].value.tostring() + "\n" ;
}
menu.visible = true ;
timer.start();
myconn.close();
}
private void button_click( object sender, eventargs e)
{
new setpeople().showdialog();
}
private void combobox_selectedvaluechanged( object sender, eventargs e)
{
getnumber(combobox.text.tostring());
}
private void timer_tick( object sender, eventargs e)
{
lab.left = lab.left - ;
if (lab.right < )
{
lab.left = this .width;
}
}
//创建labels
private void bornlabel()
{
int i = ;
for (i = ; i < curnum; i++)
{
label[i] = new label();
label[i].forecolor = color.blue;
label[i].location = new system.drawing.point(, + (i * ));
label[i].size = new system.drawing.size(, );
label[i].backcolor = color.transparent;
label[i].anchor = (anchorstyles.top);
label[i].font = new system.drawing.font( "simsun" , , fontstyle.bold);
this .controls.add(label[i]);
}
total = i;
}
//清除labels
private void clearlabel()
{
for ( int i = ; i < total; i++)
{
this .controls.remove(label[i]);
}
}
private void timer_tick( object sender, eventargs e)
{
hashtable.clear();
hashtable.clear();
sqlconnection con = new sqlconnection(conn);
string sql = "select count(*) from ticket" ;
sqlcommand com = new sqlcommand(sql, con);
con.open();
int emcount = convert.toint(com.executescalar());
con.close();
timer.enabled = true ;
timer.interval = time;
int i;
for (i = ; i < curnum; i++)
{
int random = convert.toint(rd.next(, emcount));
if (datagridview.rows[random].cells[ "checked" ].value.tostring().trim()== ""
&& !hashtable.containsvalue(dict[random]))
{
hashtable.add(random,random);
hashtable.add(dict[random], dict[random]);
label[i].text = dict[random];
}
else
{
i--;
}
}
}
private void button_click( object sender, eventargs e)
{
combobox.enabled = true ;
sqlconnection con = new sqlconnection(conn);
con.open();
string sql = "" ;
s = "" ;
timer.stop();
foreach (dictionaryentry de in hashtable)
{
sql = string .format( "insert into checked(workeridandname,prize,prizeid) values('{}','{}','{}')" , de.value.tostring(), combobox.text.tostring(),second.tostring());
sqlcommand com = new sqlcommand(sql, con);
com.executenonquery();
s += de.value.tostring() + " " ;
}
foreach (dictionaryentry de in hashtable)
{
datagridview.rows[convert.toint(de.key)].cells[ "checked" ].value = "" ;
}
lab.text = "恭喜: " + s + "获得" + combobox.text.tostring();
//判断抽奖结束
end = end + curnum;
if (end == num)
{
button.enabled = false ;
//button.enabled = false;
button.enabled = true ;
if (messagebox.show( "抽奖结束,是否进行补抽,点击确定进行补抽,取消结束此次抽奖!" , "温馨提示" , messageboxbuttons.yesno, messageboxicon.question) == dialogresult.yes)
{
btnadd.visible = true ;
tbnum.visible = true ;
ge.visible = true ;
addend.visible = true ;
}
}
}
private void timer_tick( object sender, eventargs e)
{
menu.top = menu.top - ;
if (menu.bottom < )
{
menu.top = this .height-;
}
}
private void 关闭窗口toolstripmenuitem_click( object sender, eventargs e)
{
this .close();
}
private void btnadd_click( object sender, eventargs e)
{
curnum = convert.toint(tbnum.text.tostring());
if (curnum == )
{
messagebox.show( "请输入补抽个数!!!" , "温馨提示" );
return ;
}
end = end + curnum;
if (end > convert.toint(datagridview.rowcount))
{
button.enabled = false ;
messagebox.show( "抽奖超过参与人数无法进行补抽!" , "温馨提示" );
return ;
}
timer.start();
clearlabel();
bornlabel();
}
private void addend_click( object sender, eventargs e)
{
btnadd.visible = false ;
addend.visible = false ;
tbnum.visible = false ;
ge.visible = false ;
menu.visible = false ;
clearlabel();
sql = "select workeridandname,prize from checked order by prizeid" ;
sqlconnection myconn = new sqlconnection(conn);
myconn.open();
sqldataadapter sda = new sqldataadapter(sql, myconn);
dataset ds = new dataset();
sda.fill(ds, "checked" );
datagridview.datasource = ds;
datagridview.datamember = "checked" ;
menu.text += "恭喜:\n" ;
for ( int i = ; i < datagridview.rowcount - ; i++)
{
menu.text += datagridview.rows[i].cells[ "workeridandname" ].value.tostring() + " 获得" + datagridview.rows[i].cells[ "prize" ].value.tostring() + "\n" ;
}
menu.visible = true ;
timer.start();
myconn.close();
}
//先导入到dataset
public dataset getxsldata( string filepath)
{
string strcon = "provider=microsoft.ace.oledb..;data source=" + filepath + ";extended properties=\"excel .;hdr=yes;\"" ;
system.data.oledb.oledbconnection conn = new system.data.oledb.oledbconnection(strcon);
string strcom = "select * from [sheet$]" ;
conn.open();
system.data.oledb.oledbdataadapter mycommand = new system.data.oledb.oledbdataadapter(strcom, conn);
dataset ds = new dataset();
mycommand.fill(ds, "[sheet$]" );
conn.close();
return ds;
}
public static int errorcount = ; //记录错误信息条数
public static int insertcount = ; //记录插入成功条数
public static int updatecount = ; //记录更新信息条数
public bool importxsl( string home)
{
try
{
dataset ds = new dataset();
//取得数据集
//调用上面的函数
ds = getxsldata(@home);
sqlconnection con = new sqlconnection(conn);
con.open();
for ( int i = ; i < ds.tables[].rows.count; i++)
{
string workerid = ds.tables[].rows[i][].tostring();
string name = ds.tables[].rows[i][].tostring();
string checked = ds.tables[].rows[i][].tostring();
if (workerid != "" && name != "" )
{
string sq = string .format( "select * from ticket where workerid='{}' and name='{}'" , workerid, name);
sqlcommand selectcom = new sqlcommand(sq, con);
int count = convert.toint(selectcom.executescalar());
if (count > )
{
updatecount++;
}
else
{
string s = string .format( "insert into ticket(workerid,name,checked) values('{}','{}','{}')" , workerid, name, checked );
sqlcommand insertcom = new sqlcommand(s, con);
int result = insertcom.executenonquery();
insertcount++;
}
}
}
if (updatecount + insertcount == ds.tables[].rows.count)
{
return true ;
}
else
{
return false ;
}
}
catch (exception e)
{
return false ;
}
}
//导入excle
private void button_click( object sender, eventargs e)
{
openfiledialog ofd = new openfiledialog();
ofd.filter = "microsoft excel files(*.xls)|*.xls;*.xlsx" ; //过滤一下,只要表格格式的
ofd.restoredirectory = true ;
ofd.filterindex = ;
ofd.addextension = true ;
ofd.checkfileexists = true ;
ofd.checkpathexists = true ;
ofd.showhelp = true ; //是否显示帮助按钮
if (ofd.showdialog() == dialogresult.ok)
{
this .textbox.text = ofd.filename;
}
}
//导入excle表格
private void button_click( object sender, eventargs e)
{
sqlconnection con = new sqlconnection(conn);
con.open();
//清空主键信息,标识自增从开始
string sqlstr = "truncate table ticket" ;
sqlcommand comm = new sqlcommand(sqlstr,con);
comm.executenonquery();
con.close();
if (textbox.text == "" )
{
messagebox.show( "请选择一张表格!!!" , "温馨提示" );
return ;
}
if (importxsl(textbox.text.tostring()))
{
messagebox.show(insertcount + "条数据导入成功!" + updatecount + "条数据重复!" );
}
textbox.text = "" ;
}
namespace check_ticket
{
partial class btn_uploadfile
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private system.componentmodel.icontainer components = null ;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void dispose( bool disposing)
{
if (disposing && (components != null ))
{
components.dispose();
}
base .dispose(disposing);
}
#region windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void initializecomponent()
{
this .components = new system.componentmodel.container();
this .lab = new system.windows.forms.label();
this .combobox = new system.windows.forms.combobox();
this .button = new system.windows.forms.button();
this .datagridview = new system.windows.forms.datagridview();
this .button = new system.windows.forms.button();
this .button = new system.windows.forms.button();
this .datagridview = new system.windows.forms.datagridview();
this .button = new system.windows.forms.button();
this .lab = new system.windows.forms.label();
this .timer = new system.windows.forms.timer( this .components);
this .timer = new system.windows.forms.timer( this .components);
this .button = new system.windows.forms.button();
this .lab = new system.windows.forms.label();
this .timer = new system.windows.forms.timer( this .components);
this .menu = new system.windows.forms.label();
this .menustrip = new system.windows.forms.menustrip();
this .toolstripmenuitem = new system.windows.forms.toolstripmenuitem();
this .附加功能toolstripmenuitem = new system.windows.forms.toolstripmenuitem();
this .label = new system.windows.forms.label();
this .btnadd = new system.windows.forms.button();
this .tbnum = new system.windows.forms.textbox();
this .ge = new system.windows.forms.label();
this .补抽toolstripmenuitem = new system.windows.forms.toolstripmenuitem();
this .addend = new system.windows.forms.button();
this .openfiledialog = new system.windows.forms.openfiledialog();
this .button = new system.windows.forms.button();
this .textbox = new system.windows.forms.textbox();
this .button = new system.windows.forms.button();
((system.componentmodel.isupportinitialize)( this .datagridview)).begininit();
((system.componentmodel.isupportinitialize)( this .datagridview)).begininit();
this .menustrip.suspendlayout();
this .suspendlayout();
//
// lab
//
this .lab.autosize = true ;
this .lab.backcolor = system.drawing.color.blue;
this .lab.font = new system.drawing.font( "微软雅黑" , .f, system.drawing.fontstyle.bold, system.drawing.graphicsunit.point, (( byte )()));
this .lab.forecolor = system.drawing.color.red;
this .lab.location = new system.drawing.point(, );
this .lab.name = "lab" ;
this .lab.size = new system.drawing.size(, );
this .lab.tabindex = ;
this .lab.text = "奖项名称:" ;
//
// combobox
//
this .combobox.dropdownstyle = system.windows.forms.comboboxstyle.dropdownlist;
this .combobox.forecolor = system.drawing.color.red;
this .combobox.formattingenabled = true ;
this .combobox.items.addrange( new object [] {
"请选择" ,
"一等奖" ,
"二等奖" ,
"三等奖" ,
"四等奖" ,
"五等奖" ,
"六等奖" });
this .combobox.location = new system.drawing.point(, );
this .combobox.name = "combobox" ;
this .combobox.size = new system.drawing.size(, );
this .combobox.tabindex = ;
this .combobox.selectedvaluechanged += new system.eventhandler( this .combobox_selectedvaluechanged);
//
// button
//
this .button.enabled = false ;
this .button.font = new system.drawing.font( "宋体" , f, system.drawing.fontstyle.bold, system.drawing.graphicsunit.point, (( byte )()));
this .button.forecolor = system.drawing.color.fromargb((( int )((( byte )()))), (( int )((( byte )()))), (( int )((( byte )()))));
this .button.location = new system.drawing.point(, );
this .button.name = "button" ;
this .button.size = new system.drawing.size(, );
this .button.tabindex = ;
this .button.text = "开始抽奖" ;
this .button.usevisualstylebackcolor = true ;
this .button.click += new system.eventhandler( this .button_click);
//
// datagridview
//
this .datagridview.columnheadersheightsizemode = system.windows.forms.datagridviewcolumnheadersheightsizemode.autosize;
this .datagridview.location = new system.drawing.point(, );
this .datagridview.name = "datagridview" ;
this .datagridview.rowtemplate.height = ;
this .datagridview.size = new system.drawing.size(, );
this .datagridview.tabindex = ;
this .datagridview.visible = false ;
//
// button
//
this .button.enabled = false ;
this .button.font = new system.drawing.font( "宋体" , f, system.drawing.fontstyle.bold, system.drawing.graphicsunit.point, (( byte )()));
this .button.forecolor = system.drawing.color.fromargb((( int )((( byte )()))), (( int )((( byte )()))), (( int )((( byte )()))));
this .button.location = new system.drawing.point(, );
this .button.name = "button" ;
this .button.size = new system.drawing.size(, );
this .button.tabindex = ;
this .button.text = "查看获奖名单" ;
this .button.usevisualstylebackcolor = true ;
this .button.click += new system.eventhandler( this .button_click);
//
// button
//
this .button.font = new system.drawing.font( "宋体" , f, system.drawing.fontstyle.bold, system.drawing.graphicsunit.point, (( byte )()));
this .button.forecolor = system.drawing.color.fromargb((( int )((( byte )()))), (( int )((( byte )()))), (( int )((( byte )()))));
this .button.location = new system.drawing.point(, );
this .button.name = "button" ;
this .button.size = new system.drawing.size(, );
this .button.tabindex = ;
this .button.text = "人员加载" ;
this .button.usevisualstylebackcolor = true ;
this .button.click += new system.eventhandler( this .button_click);
//
// datagridview
//
this .datagridview.autosizecolumnsmode = system.windows.forms.datagridviewautosizecolumnsmode.allcells;
this .datagridview.columnheadersheightsizemode = system.windows.forms.datagridviewcolumnheadersheightsizemode.autosize;
this .datagridview.gridcolor = system.drawing.color.black;
this .datagridview.location = new system.drawing.point(, );
this .datagridview.name = "datagridview" ;
this .datagridview.rowheadersvisible = false ;
this .datagridview.rowtemplate.height = ;
this .datagridview.size = new system.drawing.size(, );
this .datagridview.tabindex = ;
this .datagridview.visible = false ;
//
// button
//
this .button.font = new system.drawing.font( "宋体" , f, system.drawing.fontstyle.bold, system.drawing.graphicsunit.point, (( byte )()));
this .button.forecolor = system.drawing.color.fromargb((( int )((( byte )()))), (( int )((( byte )()))), (( int )((( byte )()))));
this .button.location = new system.drawing.point(, );
this .button.name = "button" ;
this .button.size = new system.drawing.size(, );
this .button.tabindex = ;
this .button.text = "设置奖项对应人数" ;
this .button.usevisualstylebackcolor = true ;
this .button.click += new system.eventhandler( this .button_click);
//
// lab
//
this .lab.autosize = true ;
this .lab.backcolor = system.drawing.color.transparent;
this .lab.font = new system.drawing.font( "宋体" , f, system.drawing.fontstyle.regular, system.drawing.graphicsunit.point, (( byte )()));
this .lab.forecolor = system.drawing.color.blue;
this .lab.location = new system.drawing.point(, );
this .lab.name = "lab" ;
this .lab.size = new system.drawing.size(, );
this .lab.tabindex = ;
this .lab.text = "获奖名单" ;
//
// timer
//
this .timer.tick += new system.eventhandler( this .timer_tick);
//
// timer
//
this .timer.tick += new system.eventhandler( this .timer_tick);
//
// button
//
this .button.enabled = false ;
this .button.forecolor = system.drawing.color.red;
this .button.location = new system.drawing.point(, );
this .button.name = "button" ;
this .button.size = new system.drawing.size(, );
this .button.tabindex = ;
this .button.text = "停止抽奖" ;
this .button.usevisualstylebackcolor = true ;
this .button.click += new system.eventhandler( this .button_click);
//
// lab
//
this .lab.anchor = system.windows.forms.anchorstyles.top;
this .lab.autosize = true ;
this .lab.backcolor = system.drawing.color.transparent;
this .lab.font = new system.drawing.font( "华文新魏" , f, system.drawing.fontstyle.bold, system.drawing.graphicsunit.point, (( byte )()));
this .lab.forecolor = system.drawing.color.fromargb((( int )((( byte )()))), (( int )((( byte )()))), (( int )((( byte )()))));
this .lab.location = new system.drawing.point(, );
this .lab.name = "lab" ;
this .lab.size = new system.drawing.size(, );
this .lab.tabindex = ;
this .lab.text = "善林商务年会抽奖活动" ;
//
// timer
//
this .timer.tick += new system.eventhandler( this .timer_tick);
//
// menu
//
this .menu.autosize = true ;
this .menu.backcolor = system.drawing.color.transparent;
this .menu.font = new system.drawing.font( "宋体" , f, system.drawing.fontstyle.regular, system.drawing.graphicsunit.point, (( byte )()));
this .menu.forecolor = system.drawing.color.blue;
this .menu.location = new system.drawing.point(, );
this .menu.name = "menu" ;
this .menu.size = new system.drawing.size(, );
this .menu.tabindex = ;
//
// menustrip
//
this .menustrip.backcolor = system.drawing.color.transparent;
this .menustrip.items.addrange( new system.windows.forms.toolstripitem[] {
this .toolstripmenuitem,
this .附加功能toolstripmenuitem});
this .menustrip.location = new system.drawing.point(, );
this .menustrip.name = "menustrip" ;
this .menustrip.size = new system.drawing.size(, );
this .menustrip.tabindex = ;
this .menustrip.text = "menustrip" ;
//
// toolstripmenuitem
//
this .toolstripmenuitem.backcolor = system.drawing.color.transparent;
this .toolstripmenuitem.forecolor = system.drawing.color.blue;
this .toolstripmenuitem.name = "toolstripmenuitem" ;
this .toolstripmenuitem.size = new system.drawing.size(, );
this .toolstripmenuitem.text = "关闭窗口" ;
this .toolstripmenuitem.click += new system.eventhandler( this .关闭窗口toolstripmenuitem_click);
//
// 附加功能toolstripmenuitem
//
this .附加功能toolstripmenuitem.name = "附加功能toolstripmenuitem" ;
this .附加功能toolstripmenuitem.size = new system.drawing.size(, );
//
// label
//
this .label.anchor = system.windows.forms.anchorstyles.top;
this .label.autosize = true ;
this .label.forecolor = system.drawing.color.yellow;
this .label.location = new system.drawing.point(, );
this .label.name = "label" ;
this .label.size = new system.drawing.size(, );
this .label.tabindex = ;
this .label.text = "---------------------------------------------------------------------------------" +
"------" ;
//
// btnadd
//
this .btnadd.forecolor = system.drawing.color.indigo;
this .btnadd.location = new system.drawing.point(, );
this .btnadd.name = "btnadd" ;
this .btnadd.size = new system.drawing.size(, );
this .btnadd.tabindex = ;
this .btnadd.text = "补抽" ;
this .btnadd.usevisualstylebackcolor = true ;
this .btnadd.visible = false ;
this .btnadd.click += new system.eventhandler( this .btnadd_click);
//
// tbnum
//
this .tbnum.location = new system.drawing.point(, );
this .tbnum.name = "tbnum" ;
this .tbnum.size = new system.drawing.size(, );
this .tbnum.tabindex = ;
this .tbnum.text = "" ;
this .tbnum.visible = false ;
//
// ge
//
this .ge.autosize = true ;
this .ge.font = new system.drawing.font( "宋体" , .f, system.drawing.fontstyle.bold, system.drawing.graphicsunit.point, (( byte )()));
this .ge.location = new system.drawing.point(, );
this .ge.name = "ge" ;
this .ge.size = new system.drawing.size(, );
this .ge.tabindex = ;
this .ge.text = "个" ;
this .ge.visible = false ;
//
// 补抽toolstripmenuitem
//
this .补抽toolstripmenuitem.name = "补抽toolstripmenuitem" ;
this .补抽toolstripmenuitem.size = new system.drawing.size(, );
//
// addend
//
this .addend.location = new system.drawing.point(, );
this .addend.name = "addend" ;
this .addend.size = new system.drawing.size(, );
this .addend.tabindex = ;
this .addend.text = "补抽结束" ;
this .addend.usevisualstylebackcolor = true ;
this .addend.visible = false ;
this .addend.click += new system.eventhandler( this .addend_click);
//
// openfiledialog
//
this .openfiledialog.filename = "openfiledialog" ;
//
// button
//
this .button.location = new system.drawing.point(, );
this .button.name = "button" ;
this .button.size = new system.drawing.size(, );
this .button.tabindex = ;
this .button.text = "选择文件" ;
this .button.usevisualstylebackcolor = true ;
this .button.click += new system.eventhandler( this .button_click);
//
// textbox
//
this .textbox.location = new system.drawing.point(, );
this .textbox.name = "textbox" ;
this .textbox.size = new system.drawing.size(, );
this .textbox.tabindex = ;
//
// button
//
this .button.location = new system.drawing.point(, );
this .button.name = "button" ;
this .button.size = new system.drawing.size(, );
this .button.tabindex = ;
this .button.text = "上传文件" ;
this .button.usevisualstylebackcolor = true ;
this .button.click += new system.eventhandler( this .button_click);
//
// btn_uploadfile
//
this .autoscaledimensions = new system.drawing.sizef(f, f);
this .autoscalemode = system.windows.forms.autoscalemode.font;
this .backcolor = system.drawing.color.red;
this .clientsize = new system.drawing.size(, );
this .controls.add( this .button);
this .controls.add( this .textbox);
this .controls.add( this .button);
this .controls.add( this .addend);
this .controls.add( this .ge);
this .controls.add( this .tbnum);
this .controls.add( this .btnadd);
this .controls.add( this .label);
this .controls.add( this .menu);
this .controls.add( this .lab);
this .controls.add( this .button);
this .controls.add( this .lab);
this .controls.add( this .button);
this .controls.add( this .datagridview);
this .controls.add( this .button);
this .controls.add( this .button);
this .controls.add( this .combobox);
this .controls.add( this .datagridview);
this .controls.add( this .button);
this .controls.add( this .lab);
this .controls.add( this .menustrip);
this .doublebuffered = true ;
this .font = new system.drawing.font( "宋体" , f, system.drawing.fontstyle.bold, system.drawing.graphicsunit.point, (( byte )()));
this .forecolor = system.drawing.color.purple;
this .formborderstyle = system.windows.forms.formborderstyle.none;
this .mainmenustrip = this .menustrip;
this .maximumsize = new system.drawing.size(, );
this .minimumsize = new system.drawing.size(, );
this .name = "btn_uploadfile" ;
this .showicon = false ;
this .text = "抽奖界面" ;
this .load += new system.eventhandler( this .form_load);
((system.componentmodel.isupportinitialize)( this .datagridview)).endinit();
((system.componentmodel.isupportinitialize)( this .datagridview)).endinit();
this .menustrip.resumelayout( false );
this .menustrip.performlayout();
this .resumelayout( false );
this .performlayout();
}
#endregion
private system.windows.forms.label lab;
private system.windows.forms.combobox combobox;
private system.windows.forms.button button;
private system.windows.forms.datagridview datagridview;
private system.windows.forms.button button;
private system.windows.forms.button button;
private system.windows.forms.datagridview datagridview;
private system.windows.forms.button button;
private system.windows.forms.label lab;
private system.windows.forms.timer timer;
private system.windows.forms.timer timer;
private system.windows.forms.button button;
private system.windows.forms.label lab;
private system.windows.forms.timer timer;
private system.windows.forms.label menu;
private system.windows.forms.menustrip menustrip;
private system.windows.forms.toolstripmenuitem toolstripmenuitem;
private system.windows.forms.label label;
private system.windows.forms.button btnadd;
private system.windows.forms.textbox tbnum;
private system.windows.forms.label ge;
private system.windows.forms.toolstripmenuitem 附加功能toolstripmenuitem;
private system.windows.forms.toolstripmenuitem 补抽toolstripmenuitem;
private system.windows.forms.button addend;
private system.windows.forms.openfiledialog openfiledialog;
private system.windows.forms.button button;
private system.windows.forms.textbox textbox;
private system.windows.forms.button button;
}
}
}
}
|
数据库设计
界面
好了,本文就给大家介绍这么多,有需要的朋友可以参考下本代码,根据自己实际需求适当加入,同时感谢大家一直以来对服务器之家网站的支持。