Ejemplo n.º 1
0
 //新增集合完成后
 void cdgvAthleteInfo_AddGroupCompleted(object group, CollapseDataGridViewEventArgs e)
 {
     if (e.Result)
     {
         //TODO:展示已新增数据,或设置CollapseDataGirdView其他属性,如只读等
         AthleteItemList singleGroup = group as AthleteItemList;
         if (singleGroup != null)
         {
             MessageBox.Show
             (
                 this,
                 "已成功新增集合" +
                 "\r\n驻扎酒店:" + ((singleGroup.Hotel != null) ? singleGroup.Hotel : "暂无") +
                 "\r\n大巴车牌:" + ((singleGroup.BusNo != null) ? singleGroup.BusNo : "暂无") +
                 "\r\n休息室号:" + ((singleGroup.RestRoomNo != null) ? singleGroup.RestRoomNo : "暂无") +
                 "\r\n成员数:" + singleGroup.Count,
                 "新增集合提示信息"
             );
         }
     }
     else
     {
         MessageBox.Show(e.ErrorMessage);
         //TODO: 出现错误后,可以清空CollapseDataGridView的DataSource后重新绑定
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 删除条目完成时
 /// </summary>
 /// <param name="item"></param>
 /// <param name="e"></param>
 void cdgvAthleteInfo_RemoveItemCompleted(object item, CollapseDataGridViewEventArgs e)
 {
     if (e.Result)
     {
         Athlete singleItem = item as Athlete;
         if (singleItem != null)
         {
             MessageBox.Show
             (
                 this,
                 "已成功删除条目" +
                 "\r\n姓名:" +
                 ((singleItem.Name != null && singleItem.Name != string.Empty) ? singleItem.Name : "暂无") +
                 "\r\n性别:" +
                 ((singleItem.Gender != null && singleItem.Gender != string.Empty) ? singleItem.Gender : "暂无") +
                 "\r\n国家:" +
                 ((singleItem.Country != null && singleItem.Country != string.Empty) ? singleItem.Country : "暂无"),
                 "删除条目提示信息"
             );
         }
     }
     else
     {
         MessageBox.Show(e.ErrorMessage);
     }
 }
Ejemplo n.º 3
0
 //删除集合完成后
 void cdgvAthleteInfo_RemoveGroupCompleted(object group, CollapseDataGridViewEventArgs e)
 {
     if (e.Result)
     {
         //TODO:展示已删除的数据,或设置CollapseDataGirdView其他属性,如只读等
         AthleteItemList singleGroup = group as AthleteItemList;
         MessageBox.Show
         (
             this,
             "已删除新增集合" +
             "\r\n驻扎酒店:" + ((singleGroup.Hotel != null) ? singleGroup.Hotel : "暂无") +
             "\r\n大巴车牌:" + ((singleGroup.BusNo != null) ? singleGroup.BusNo : "暂无") +
             "\r\n休息室号:" + ((singleGroup.RestRoomNo != null) ? singleGroup.RestRoomNo : "暂无") +
             "\r\n成员数:" + singleGroup.Count,
             "删除集合提示信息"
         );
     }
     else
     {
         MessageBox.Show(e.ErrorMessage);
     }
 }