private void Save_Action_SimpleButton_Click(object sender, EventArgs e)
 {
     if (XtraExtension.Confirm(@"确认是否保存数据!") == DialogResult.OK)
     {
         var msgErrors  = new List <string>();
         var mappedList = new List <string>();
         if (State == FormState.Add)
         {
             _batch = new Batch();
             MapData(ref mappedList);
             if (ValidateData(mappedList, ref msgErrors))
             {
                 _batchEntityBll.Add(_batch);
                 _batchEntityBll.Save();
             }
             else
             {
                 XtraExtension.ShowAlarm(msgErrors.GetJoinListStr("\r\n"));
             }
         }
         if (State == FormState.Edit)
         {
             MapData(ref mappedList);
             if (ValidateData(mappedList, ref msgErrors))
             {
                 _batchEntityBll.Save();
             }
             else
             {
                 XtraExtension.ShowAlarm(msgErrors.GetJoinListStr("\r\n"));
             }
         }
     }
 }
 private void Shell_XtraForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (XtraExtension.Confirm(@"确认是否退出!") != DialogResult.OK)
     {
         e.Cancel = true;
     }
 }
Ejemplo n.º 3
0
 private void Delete_RepositoryItemHyperLinkEdit_Click(object sender, EventArgs e)
 {
     if (XtraExtension.Confirm("请确认是否要删除当前记录?") == DialogResult.OK)
     {
         var model = gridView1.GetRow(gridView1.FocusedRowHandle) as Batch;
         if (model != null)
         {
             _batchEntityBll.DeleteByKey(model.BatchID.ToString());
             BindData(paging_XtraUserControl1.MyPagingHelper.PageIndex);
         }
     }
 }