Esempio n. 1
0
        private void InitAttachmentGrid()
        {
            var eqptAttachmentBll = new BLL.EqptAttachment();

            _eqptAttachments         = eqptAttachmentBll.GetModelListWithoutAttachment(String.Format("SmId = {0} and LayerName = '{1}'", _smId, _layerInfo.LayerName));
            gc_Attachment.DataSource = _eqptAttachments;
        }
Esempio n. 2
0
        private void btn_DeleteAttachment_Click(object sender, EventArgs e)
        {
            if (gv_Attachment.FocusedRowHandle < 0)
            {
                XtraMessageBox.Show("当前未选中附件!", "提示");
                return;
            }
            var attachmentId = Convert.ToInt32(gv_Attachment.GetFocusedRowCellValue("Id"));

            if (XtraMessageBox.Show("删除后不可恢复,您确定要删除?", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                var eqptAttachmentBll = new BLL.EqptAttachment();
                if (eqptAttachmentBll.Delete(attachmentId))
                {
                    var eqptAttachment = _eqptAttachments.First(m => m.Id == attachmentId);
                    _eqptAttachments.Remove(eqptAttachment);
                    gc_Attachment.RefreshDataSource();
                }
            }
        }
Esempio n. 3
0
 private void InitAttachmentGrid()
 {
     var eqptAttachmentBll = new BLL.EqptAttachment();
     _eqptAttachments = eqptAttachmentBll.GetModelListWithoutAttachment(String.Format("SmId = {0} and LayerName = '{1}'", _smId, _layerInfo.LayerName));
     gc_Attachment.DataSource = _eqptAttachments;
 }
Esempio n. 4
0
 private void btn_DeleteAttachment_Click(object sender, EventArgs e)
 {
     if (gv_Attachment.FocusedRowHandle < 0)
     {
         XtraMessageBox.Show("当前未选中附件!", "提示");
         return;
     }
     var attachmentId = Convert.ToInt32(gv_Attachment.GetFocusedRowCellValue("Id"));
     if (XtraMessageBox.Show("删除后不可恢复,您确定要删除?", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
     {
         var eqptAttachmentBll = new BLL.EqptAttachment();
         if (eqptAttachmentBll.Delete(attachmentId))
         {
             var eqptAttachment = _eqptAttachments.First(m => m.Id == attachmentId);
             _eqptAttachments.Remove(eqptAttachment);
             gc_Attachment.RefreshDataSource();
         }
     }
 }