DevExpress控件的使用(一)_.NET_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > .NET > DevExpress控件的使用(一)

DevExpress控件的使用(一)

 2017/3/8 5:34:21  Espresso徐  程序员俱乐部  我要评论(0)
  • 摘要:1privatevoidgridView1_RowClick(objectsender,DevExpress.XtraGrid.Views.Grid.RowClickEventArgse)2{3DataRowdr=gridView1.GetDataRow(e.RowHandle);4txt_orderno.Text=dr["ORDER_NO"].ToString();5}1privatevoidgrid_surfaceTop_MouseDown(objectsender
  • 标签:使用 控件

1         private void gridView1_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
2         {
3             DataRow dr = gridView1.GetDataRow(e.RowHandle);
4             txt_orderno.Text = dr["ORDER_NO"].ToString();
5         }

  1         private void grid_surfaceTop_MouseDown(object sender, MouseEventArgs e)
  2         {
  3 
  4             GridHitInfo m_ghi = gridView1.CalcHitInfo(e.Location);
  5             GridHitInfo m_item = gridView3.CalcHitInfo(e.Location);
  6             if (m_ghi.InRowCell)
  7             {
  8                 // = gridView1.GetRowCellDisplayText(m_ghi.RowHandle, "TOTALSET_HOTELNAME").ToString();
  9                 orderno = gridView1.GetRowCellDisplayText(m_ghi.RowHandle, "ORDER_NO").ToString();
 10                 
 11                 ORDER_FLAG = gridView1.GetRowCellDisplayText(m_ghi.RowHandle, "ORDER_FLAG").ToString();
 12                 
 13             }
 14             //string orderno = string.Empty;
 15             //string STATUS = string.Empty;
 16             BLLData.BLLData bll = new BLLData.BLLData();
 17             //DataTable dt1 = bll.Gettopmessage(txt_orderno.Text, txt_Exorderno.Text, txt_idcard.Text, txt_code.Text);
 18             //orderno = dt1.Rows[0]["ORDER_NO"].ToString();
 19             //ORDER_FLAG = dt1.Rows[0]["ORDER_FLAG"].ToString();
 20             //da = bll.GetSBARCODE(orderno);
 21             //NewMethod(dt1);
 22             BLLData.BLLData bd = new BLLData.BLLData();
 23            
 24                 #region 线下门票
 25             if (ORDER_FLAG == "线下门票")
 26                 {
 27                     //grid_surfaceTop.DataSource = dt1;
 28                     dt = bd.GetAccess(orderno);
 29                     dtitems = bd.GetOrderitems(orderno);
 30                     dtlockage = bd.Getlockage(orderno);
 31                     // NewMethod1(dt1);
 32                     if (dt == null)
 33                     {
 34 
 35                     }
 36                     else
 37                     {
 38                         newdt();
 39                         gridControl2.DataSource = dt;//绑定门票信息
 40                     }
 41                     if (dtitems == null)
 42                     {
 43 
 44                     }
 45                     else
 46                     {
 47                         Newdtitems();
 48                         gridControl3.DataSource = dtitems;//绑定订单明细
 49                     }
 50                     if (dtlockage == null)
 51                     {
 52 
 53                     }
 54                     else
 55                     {
 56                         gridControl5.DataSource = dtlockage;//绑定入园信息
 57                     }
 58                 }
 59                 #endregion
 60                 #region 线下酒店
 61             if (ORDER_FLAG == "线下酒店")
 62                 {
 63                     //grid_surfaceTop.DataSource = dt1;
 64                     dthoel = bd.GetHotel(orderno);
 65                     //NewMethod1(dt1);
 66                     if (dthoel == null)
 67                     {
 68 
 69                     }
 70                     else
 71                     {
 72                         newhoel();
 73                         gridControl4.DataSource = dthoel;//绑定酒店信息
 74                     }
 75                 }
 76                 #endregion
 77                 #region 线下套餐
 78             if (ORDER_FLAG == "线下套餐")
 79                 {
 80                    // grid_surfaceTop.DataSource = da;
 81                     //newda();
 82                     dt = bd.GetAccess(orderno);
 83                     dtitems = bd.GetOrderitems(orderno);
 84                     dthoel = bd.GetHotel(orderno);
 85                     dtlockage = bd.Getlockage(orderno);
 86 
 87                     //NewMethod1(dt1);
 88                     if (dt == null || dt.Rows.Count == 0)
 89                     {
 90 
 91                     }
 92                     else
 93                     {
 94                         newdt();
 95                         gridControl2.DataSource = dt;//绑定门票信息
 96                     }
 97                     if (dtitems == null)
 98                     {
 99 
100                     }
101                     else
102                     {
103                         Newdtitems();
104                         gridControl3.DataSource = dtitems;//绑定订单明细
105                     }
106                     if (dthoel == null)
107                     {
108 
109                     }
110                     else
111                     {
112                         newhoel();
113                         gridControl4.DataSource = dthoel;//绑定酒店信息
114                     }
115                     if (dtlockage == null)
116                     {
117 
118                     }
119                     else
120                     {
121                         gridControl5.DataSource = dtlockage;//绑定入园信息
122                     }
123                 }
124                 #endregion
125                 #region 线下餐券
126             if (ORDER_FLAG == "线下餐券")
127                 {
128                     //grid_surfaceTop.DataSource = dt1;
129                     dtitems = bd.GetOrderitems(orderno);
130 
131                     //NewMethod1(dt1);
132                     if (dtitems == null)
133                     {
134 
135                     }
136                     else
137                     {
138                         Newdtitems();
139                         gridControl3.DataSource = dtitems;//绑定订单明细
140                     }
141 
142                 }
143                 #endregion
144                 #region 线下微电影
145             if (ORDER_FLAG == "线下微电影")
146                 {
147                     // grid_surfaceTop.DataSource = dt1;
148                     dt = bd.GetAccess(orderno);
149                     dtitems = bd.GetOrderitems(orderno);
150                     dtlockage = bd.Getlockage(orderno);
151 
152                     //NewMethod1(dt1);
153                     if (dt == null || dt.Rows.Count == 0)
154                     {
155 
156                     }
157                     else
158                     {
159                         Newdtitems();
160                         gridControl2.DataSource = dt;//绑定门票信息
161                     }
162                     if (dtitems == null)
163                     {
164 
165                     }
166                     else
167                     {
168                         Newdtitems();
169                         gridControl3.DataSource = dtitems;//绑定订单明细
170                     }
171                     if (dtlockage == null)
172                     {
173 
174                     }
175                     else
176                     {
177                         gridControl5.DataSource = dtlockage;//绑定入园信息
178                     }
179                 }
180                 #endregion
181                 #region 团队门票
182             if (ORDER_FLAG == "团队门票")
183                 {
184                     //grid_surfaceTop.DataSource = da;
185                     //newda();
186                     dtitems = bd.GetOrderitems(orderno);
187                     dthoel = bd.GetHotel(orderno);
188                     dtlockage = bd.Getlockage(orderno);
189                     dtteam = bd.Getteam(orderno);
190                     dt = bd.GetAccess(orderno);
191                     dtMove = bd.GetTeamMove(orderno);
192                     dtFood = bd.GetTeamFood(orderno);
193                     // NewMethod1(dt1);
194                     // Newdtitems2();
195 
196                     if (dt == null)
197                     {
198 
199                     }
200                     else
201                     {
202                         newdt();
203                         gridControl2.DataSource = dt;//绑定门票信息
204                     }
205                     if (dtitems == null)
206                     {
207 
208                     }
209                     else
210                     {
211                         Newdtitems();
212                         gridControl3.DataSource = dtitems;//绑定订单明细
213                     }
214                     if (dtteam == null)
215                     {
216 
217                     }
218                     else
219                     {
220                         gridControl1.DataSource = dtteam;//绑定团队信息
221                     }
222                     if (dthoel == null)
223                     {
224 
225                     }
226                     else
227                     {
228                         newhoel();
229                         gridControl4.DataSource = dthoel;//绑定酒店信息
230                     }
231                     if (dtlockage == null)
232                     {
233 
234                     }
235                     else
236                     {
237                         gridControl5.DataSource = dtlockage;//绑定入园信息
238                     }
239                     if (dtMove == null)
240                     {
241 
242                     }
243                     else
244                     {
245                         newMove();
246                         gridControl7.DataSource = dtMove;//获取团队微电影信息
247                     }
248                     if (dtMove == null)
249                     {
250 
251                     }
252                     else
253                     {
254                         newFood();
255                         gridControl6.DataSource = dtFood;//获取团队餐券信息
256                     }
257 
258 
259 
260 
261                     //gridControl1.DataSource = dtteam;//绑定团队信息
262                     //gridControl4.DataSource = dthoel;//绑定酒店信息
263                     //gridControl5.DataSource = dtlockage;//绑定入园信息
264                 }
265                 #endregion
266                 #region 会务
267             if (ORDER_FLAG == "会务")
268                 {
269                    // grid_surfaceTop.DataSource = da;
270                    // newda();
271                     dt = bd.GetAccess(orderno);
272                     dtitems = bd.GetOrderitems(orderno);
273                     dthoel = bd.GetHotel(orderno);
274                     dtlockage = bd.Getlockage(orderno);
275                     dtteam = bd.Getteam(orderno);
276 
277                     //NewMethod1(dt1);
278                     if (dt == null)
279                     {
280 
281                     }
282                     else
283                     {
284                         newdt();
285                         gridControl2.DataSource = dt;//绑定门票信息
286                     }
287                     if (dtitems == null)
288                     {
289 
290                     }
291                     else
292                     {
293                         Newdtitems();
294                         gridControl3.DataSource = dtitems;//绑定订单明细
295                     }
296                     if (dtteam == null)
297                     {
298 
299                     }
300                     else
301                     {
302                         gridControl1.DataSource = dtteam;//绑定团队信息
303                     }
304                     if (dthoel == null)
305                     {
306 
307                     }
308                     else
309                     {
310                         newhoel();
311                         gridControl4.DataSource = dthoel;//绑定酒店信息
312                     }
313                     if (dtlockage == null)
314                     {
315 
316                     }
317                     else
318                     {
319                         gridControl5.DataSource = dtlockage;//绑定入园信息
320                     }
321                     if (dtMove == null)
322                     {
323 
324                     }
325                     else
326                     {
327                         newMove();
328                         gridControl7.DataSource = dtMove;//获取团队微电影信息
329                     }
330                     if (dtMove == null)
331                     {
332 
333                     }
334                     else
335                     {
336                         newFood();
337                         gridControl6.DataSource = dtFood;//获取团队餐券信息
338                     }
339 
340                 }
341                 #endregion
342             #region 线上PC门票
343             if (ORDER_FLAG == "线上PC门票")
344                 {
345                     //grid_surfaceTop.DataSource = dt1;
346                     dt = bd.GetAccess(orderno);
347                     //NewMethod1(dt1);
348                     dtitems = bd.GetOrderitems(orderno);
349                     dtlockage = bd.Getlockage(orderno);
350                     // NewMethod1(dt1);
351                     if (dt == null)
352                     {
353 
354                     }
355                     else
356                     {
357                         newdt();
358                         gridControl2.DataSource = dt;//绑定门票信息
359                     }
360                     if (dtitems == null)
361                     {
362 
363                     }
364                     else
365                     {
366                         Newdtitems();
367                         gridControl3.DataSource = dtitems;//绑定订单明细
368                     }
369                     if (dtlockage == null)
370                     {
371 
372                     }
373                     else
374                     {
375                         gridControl5.DataSource = dtlockage;//绑定入园信息
376                     }
377                 }
378                 #endregion
379             #region 线上PC酒店
380             if (ORDER_FLAG == "线上PC酒店")
381                 {
382                     // grid_surfaceTop.DataSource = dt1;
383                     dthoel = bd.GetHotel(orderno);
384                     // NewMethod1(dt1);
385                     if (dthoel == null)
386                     {
387 
388                     }
389                     else
390                     {
391                         newhoel();
392                         gridControl4.DataSource = dthoel;//绑定酒店信息
393                     }
394                 }
395                 #endregion
396             #region 线上PC套餐
397             if (ORDER_FLAG == "线上PC套餐")
398                 {
399                     //grid_surfaceTop.DataSource = da;
400                     //newda();
401                     dt = bd.GetAccess(orderno);
402                     dtitems = bd.GetOrderitems(orderno);
403                     dthoel = bd.GetHotel(orderno);
404                     dtlockage = bd.Getlockage(orderno);
405 
406                     // NewMethod1(dt1);
407                     if (dt == null || dt.Rows.Count == 0)
408                     {
409 
410                     }
411                     else
412                     {
413                         newdt();
414                         gridControl2.DataSource = dt;//绑定门票信息
415                     }
416                     if (dtitems == null)
417                     {
418 
419                     }
420                     else
421                     {
422                         Newdtitems();
423                         gridControl3.DataSource = dtitems;//绑定订单明细
424                     }
425                     if (dthoel == null)
426                     {
427 
428                     }
429                     else
430                     {
431                         newhoel();
432                         gridControl4.DataSource = dthoel;//绑定酒店信息
433                     }
434                     if (dtlockage == null)
435                     {
436 
437                     }
438                     else
439                     {
440                         gridControl5.DataSource = dtlockage;//绑定入园信息
441                     }
442                 }
443                 #endregion
444             #region 线上PC微电影
445             if (ORDER_FLAG == "线上PC微电影")
446                 {
447                     // grid_surfaceTop.DataSource = dt1;
448                     dt = bd.GetAccess(orderno);
449                     dtitems = bd.GetOrderitems(orderno);
450                     dtlockage = bd.Getlockage(orderno);
451                     //NewMethod1(dt1);
452                     if (dt == null || dt.Rows.Count == 0)
453                     {
454 
455                     }
456                     else
457                     {
458                         Newdtitems();
459                         gridControl2.DataSource = dt;//绑定门票信息
460                     }
461                     if (dtitems == null)
462                     {
463 
464                     }
465                     else
466                     {
467                         Newdtitems();
468                         gridControl3.DataSource = dtitems;//绑定订单明细
469                     }
470                     if (dtlockage == null)
471                     {
472 
473                     }
474                     else
475                     {
476                         gridControl5.DataSource = dtlockage;//绑定入园信息
477                     }
478                 }
479                 #endregion
480                 #region 线上手机门票
481             if (ORDER_FLAG == "线上手机门票")
482                 {
483                     // grid_surfaceTop.DataSource = dt1;
484                     dt = bd.GetAccess(orderno);
485                     dtitems = bd.GetOrderitems(orderno);
486                     dtlockage = bd.Getlockage(orderno);
487 
488                     // NewMethod1(dt1);
489                     if (dt == null)
490                     {
491 
492                     }
493                     else
494                     {
495                         newdt();
496                         gridControl2.DataSource = dt;//绑定门票信息
497                     }
498                     if (dtitems == null)
499                     {
500 
501                     }
502                     else
503                     {
504                         Newdtitems();
505                         gridControl3.DataSource = dtitems;//绑定订单明细
506                     }
507                     if (dtlockage == null)
508                     {
509 
510                     }
511                     else
512                     {
513                         gridControl5.DataSource = dtlockage;//绑定入园信息
514                     }
515                 }
516                 #endregion
517                 #region 线上手机酒店
518             if (ORDER_FLAG == "线上手机酒店")
519                 {
520                     // grid_surfaceTop.DataSource = dt1;
521                     dthoel = bd.GetHotel(orderno);
522                     //NewMethod1(dt1);
523                     if (dthoel == null)
524                     {
525 
526                     }
527                     else
528                     {
529                         newhoel();
530                         gridControl4.DataSource = dthoel;//绑定酒店信息
531                     }
532                 }
533                 #endregion
534                 #region 线上手机套餐
535             if (ORDER_FLAG == "线上手机套餐")
536                 {
537                     //grid_surfaceTop.DataSource = da;
538                     //newda();
539                     dt = bd.GetAccess(orderno);
540                     dtitems = bd.GetOrderitems(orderno);
541                     dthoel = bd.GetHotel(orderno);
542                     dtlockage = bd.Getlockage(orderno);
543 
544                     //NewMethod1(dt1);
545                     if (dt == null || dt.Rows.Count == 0)
546                     {
547 
548                     }
549                     else
550                     {
551                         newdt();
552                         gridControl2.DataSource = dt;//绑定门票信息
553                     }
554                     if (dtitems == null)
555                     {
556 
557                     }
558                     else
559                     {
560                         Newdtitems();
561                         gridControl3.DataSource = dtitems;//绑定订单明细
562                     }
563                     if (dthoel == null)
564                     {
565 
566                     }
567                     else
568                     {
569                         newhoel();
570                         gridControl4.DataSource = dthoel;//绑定酒店信息
571                     }
572                     if (dtlockage == null)
573                     {
574 
575                     }
576                     else
577                     {
578                         gridControl5.DataSource = dtlockage;//绑定入园信息
579                     }
580                 }
581                 #endregion
582                 #region 线上手机微电影
583             if (ORDER_FLAG == "线上手机微电影")
584                 {
585                     //grid_surfaceTop.DataSource = dt1;
586                     dt = bd.GetAccess(orderno);
587                     dtitems = bd.GetOrderitems(orderno);
588                     dtlockage = bd.Getlockage(orderno);
589                     // NewMethod1(dt1);
590                     if (dt == null || dt.Rows.Count == 0)
591                     {
592 
593                     }
594                     else
595                     {
596                         Newdtitems();
597                         gridControl2.DataSource = dt;//绑定门票信息
598                     }
599                     if (dtitems == null)
600                     {
601 
602                     }
603                     else
604                     {
605                         Newdtitems();
606                         gridControl3.DataSource = dtitems;//绑定订单明细
607                     }
608                     if (dtlockage == null)
609                     {
610 
611                     }
612                     else
613                     {
614                         gridControl5.DataSource = dtlockage;//绑定入园信息
615                     }
616                 }
617                 #endregion
618                 #region OTA门票
619                 if (ORDER_FLAG == "OTA门票")
620                 {
621                     //grid_surfaceTop.DataSource = dt1;
622                     dt = bd.GetAccess(orderno);
623                     dtitems = bd.GetOrderitems(orderno);
624                     dtlockage = bd.Getlockage(orderno);
625 
626                     //NewMethod1(dt1);
627                     if (dt == null)
628                     {
629 
630                     }
631                     else
632                     {
633                         newdt();
634                         gridControl2.DataSource = dt;//绑定门票信息
635                     }
636                     if (dtitems == null)
637                     {
638 
639                     }
640                     else
641                     {
642                         Newdtitems();
643                         gridControl3.DataSource = dtitems;//绑定订单明细
644                     }
645                     if (dtlockage == null)
646                     {
647 
648                     }
649                     else
650                     {
651                         gridControl5.DataSource = dtlockage;//绑定入园信息
652                     }
653                 }
654                 #endregion
655                 #region OTA酒店
656                 if (ORDER_FLAG == "OTA酒店")
657                 {
658                     //grid_surfaceTop.DataSource = dt1;
659                     dthoel = bd.GetHotel(orderno);
660                     //NewMethod1(dt1);
661                     if (dthoel == null)
662                     {
663 
664                     }
665                     else
666                     {
667                         newhoel();
668                         gridControl4.DataSource = dthoel;//绑定酒店信息
669                     }
670                 }
671                 #endregion
672                 #region OTA套餐
673                 if (ORDER_FLAG == "OTA套餐")
674                 {
675                    // grid_surfaceTop.DataSource = da;
676                    // newda();
677                     dt = bd.GetAccess(orderno);
678                     dtitems = bd.GetOrderitems(orderno);
679                     dthoel = bd.GetHotel(orderno);
680                     dtlockage = bd.Getlockage(orderno);
681 
682                     // NewMethod1(dt1);
683                     if (dt == null || dt.Rows.Count == 0)
684                     {
685 
686                     }
687                     else
688                     {
689                         newdt();
690                         gridControl2.DataSource = dt;//绑定门票信息
691                     }
692                     if (dtitems == null)
693                     {
694 
695                     }
696                     else
697                     {
698                         Newdtitems();
699                         gridControl3.DataSource = dtitems;//绑定订单明细
700                     }
701                     if (dthoel == null)
702                     {
703 
704                     }
705                     else
706                     {
707                         newhoel();
708                         gridControl4.DataSource = dthoel;//绑定酒店信息
709                     }
710                     if (dtlockage == null)
711                     {
712 
713                     }
714                     else
715                     {
716                         gridControl5.DataSource = dtlockage;//绑定入园信息
717                     }
718                 }
719                 #endregion
720                 #region OTA微电影
721                 if (ORDER_FLAG == "OTA微电影")
722                 {
723                     //  grid_surfaceTop.DataSource = dt1;
724                     dt = bd.GetAccess(orderno);
725                     dtitems = bd.GetOrderitems(orderno);
726                     dtlockage = bd.Getlockage(orderno);
727                     // NewMethod1(dt1);
728                     if (dt == null || dt.Rows.Count == 0)
729                     {
730 
731                     }
732                     else
733                     {
734                         Newdtitems();
735                         gridControl2.DataSource = dt;//绑定门票信息
736                     }
737                     if (dtitems == null)
738                     {
739 
740                     }
741                     else
742                     {
743                         Newdtitems();
744                         gridControl3.DataSource = dtitems;//绑定订单明细
745                     }
746                     if (dtlockage == null)
747                     {
748 
749                     }
750                     else
751                     {
752                         gridControl5.DataSource = dtlockage;//绑定入园信息
753                     }
754                 }
755                 #endregion
756                 #region B2B门票
757                 if (ORDER_FLAG == "B2B门票")
758                 {
759                     // grid_surfaceTop.DataSource = dt1;
760                     dt = bd.GetAccess(orderno);
761                     dtitems = bd.GetOrderitems(orderno);
762                     dtlockage = bd.Getlockage(orderno);
763 
764                     // NewMethod1(dt1);
765                     if (dt == null)
766                     {
767 
768                     }
769                     else
770                     {
771                         newdt();
772                         gridControl2.DataSource = dt;//绑定门票信息
773                     }
774                     if (dtitems == null)
775                     {
776 
777                     }
778                     else
779                     {
780                         Newdtitems();
781                         gridControl3.DataSource = dtitems;//绑定订单明细
782                     }
783                     if (dtlockage == null)
784                     {
785 
786                     }
787                     else
788                     {
789                         gridControl5.DataSource = dtlockage;//绑定入园信息
790                     }
791                 }
792                 #endregion
793                 #region B2B酒店
794                 if (ORDER_FLAG == "B2B酒店")
795                 {
796                     // grid_surfaceTop.DataSource = dt1;
797                     dthoel = bd.GetHotel(orderno);
798                     // NewMethod1(dt1);
799                     if (dthoel == null)
800                     {
801 
802                     }
803                     else
804                     {
805                         newhoel();
806                         gridControl4.DataSource = dthoel;//绑定酒店信息
807                     }
808                 }
809                 #endregion
810                 #region B2B套餐
811                 if (ORDER_FLAG == "B2B套餐")
812                 {
813                    // grid_surfaceTop.DataSource = da;
814                     //newda();
815                     dt = bd.GetAccess(orderno);
816                     dtitems = bd.GetOrderitems(orderno);
817                     dthoel = bd.GetHotel(orderno);
818                     dtlockage = bd.Getlockage(orderno);
819 
820                     // NewMethod1(dt1);
821                     if (dt == null || dt.Rows.Count == 0)
822                     {
823 
824                     }
825                     else
826                     {
827                         newdt();
828                         gridControl2.DataSource = dt;//绑定门票信息
829                     }
830                     if (dtitems == null)
831                     {
832 
833                     }
834                     else
835                     {
836                         Newdtitems();
837                         gridControl3.DataSource = dtitems;//绑定订单明细
838                     }
839                     if (dthoel == null)
840                     {
841 
842                     }
843                     else
844                     {
845                         newhoel();
846                         gridControl4.DataSource = dthoel;//绑定酒店信息
847                     }
848                     if (dtlockage == null)
849                     {
850 
851                     }
852                     else
853                     {
854                         gridControl5.DataSource = dtlockage;//绑定入园信息
855                     }
856                 }
857                 #endregion
858                 #region B2B微电影
859                 if (ORDER_FLAG == "B2B微电影")
860                 {
861                     // grid_surfaceTop.DataSource = dt1;
862                     dt = bd.GetAccess(orderno);
863                     dtitems = bd.GetOrderitems(orderno);
864                     dtlockage = bd.Getlockage(orderno);
865                     //NewMethod1(dt1);
866                     if (dt == null || dt.Rows.Count == 0)
867                     {
868 
869                     }
870                     else
871                     {
872                         Newdtitems();
873                         gridControl2.DataSource = dt;//绑定门票信息
874                     }
875                     if (dtitems == null)
876                     {
877 
878                     }
879                     else
880                     {
881                         Newdtitems();
882                         gridControl3.DataSource = dtitems;//绑定订单明细
883                     }
884                     if (dtlockage == null)
885                     {
886 
887                     }
888                     else
889                     {
890                         gridControl5.DataSource = dtlockage;//绑定入园信息
891                     }
892                 }
893                 #endregion
897         }

 

 1         //门票列表的单元格的值改变事件
 2         private void tl_tickets_CellValueChanged(object sender, DevExpress.XtraTreeList.CellValueChangedEventArgs e)
 3         {
 4             if (e.Node[11] == "")
 5             {
 6                 H2.DevMessageBox.ExclamationCenter("人数固定,不可修改!");
 7                 return;
 8             }
 9             if (e.Node[6] == "住宿")
10             {
11                 H2.DevMessageBox.ExclamationCenter("酒店产品,请删除后重新添加!");
12                 return;
13             }
14             if (e.Column.Caption == "数量")
15             {
16                 try
17                 {
18                     double price = Convert.ToDouble(e.Node[2]);
19                     double num = Convert.ToDouble(e.Value);
20                     double total = price * num;
21                     e.Node[4] = total.ToString("N");
22                     //
23                     m_nkc.DisplayNum = "";
24 
25 
26                     //
27                     //m_pay.SetPay(tl_tickets);
28                     //存在疑问
29                     this.m_ucInfoDisplay.SetDisplay(tl_tickets);
30 
31                     //遍历门票List,除酒店以外的所有产品,全部数量一致
32                     for (int i = 0; i < tl_tickets.Nodes.Count; i++)
33                     {
34                         DevExpress.XtraTreeList.Nodes.TreeListNode node = tl_tickets.Nodes[i];
35                         if (node[6].ToString() == "住宿")
36                         {
37                             continue;
38                         }
39                         //固定人数产品不可变动数量
40                         if (node[11].ToString() == "")
41                         {
42                             continue;
43                         }
44                         //调整其他非酒店产品的数量和小计
45                         //单价2 数量3 小计4
46                         double price_o = Convert.ToDouble(node[2]);
47                         node[3] = Convert.ToDouble(e.Value);
48                         double total_o = price_o * num;
49                         node[4] = total_o.ToString("N");
50                     }
51 
52                 }
53                 catch { }
54             }
55 
56         }

 

 1         /// <summary>
 2         /// 启用TreeList的ShowingEditor事件,该事件在控件转化到可编辑状态前调用,只要设置该事件的参数CancelEventArgs即可
 3         /// 而对于具体是哪一个节点则可以通过TreeList的FocusedNode来获取,而对于是哪一列则可以通过TreeList的FocusedColumn来获取
 4         /// </summary>
 5         private void tl_tickets_ShowingEditor(object sender, CancelEventArgs e)
 6         {
 7             DevExpress.XtraTreeList.TreeList CurrentTreeList = sender as DevExpress.XtraTreeList.TreeList;
 8             if (CurrentTreeList != null)
 9             {
10                 DevExpress.XtraTreeList.Nodes.TreeListNode node = CurrentTreeList.FocusedNode;
11                 DevExpress.XtraTreeList.Columns.TreeListColumn column = CurrentTreeList.FocusedColumn;
12 
13                 //是否套餐 || 是否固定人数 || 是否是住宿
14                 if ((column.Caption == "数量" && "".Equals(node.GetValue(11).ToString())) || (column.Caption == "数量" && "".Equals(node.GetValue(8).ToString())) || (column.Caption == "数量" && "住宿".Equals(node.GetValue(6).ToString())))
15                 {
16                     //取消可编辑状态
17                     e.Cancel = true;
18                 }
19                 else
20                 {
21                     e.Cancel = false;
22                 }
23             }
24         }

 

发表评论
用户名: 匿名