public override int Delete() { if (_entity == null) { return(0); } string msg = string.Format("你确定要删除检测单号为【{0}】的记录吗?", _entity.code); if (MessageBox.Show(msg, "询问", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.No) { return(0); } _bll.Delete(_entity.id); FishBll.Bll.CheckDetailBll detailbll = new FishBll.Bll.CheckDetailBll(); detailbll.DeleteByMid(_entity.id); ClearText(); Query(); return(1); }
protected void SetDetail() { FishBll.Bll.CheckDetailBll detailbll = new FishBll.Bll.CheckDetailBll(); List <FishEntity.CheckDetailEntity> details = detailbll.GetCheckDetailVo(_productid); SetDetail(details); }
protected void SetDetail() { int mid = _entity.id; FishBll.Bll.CheckDetailBll detailbll = new FishBll.Bll.CheckDetailBll(); List <FishEntity.CheckDetailEntity> details = detailbll.GetModelList("mid=" + mid); SetDetail(details); }
protected void AddDetails(int mid, bool isAdd) { List <FishEntity.CheckDetailEntity> listNews = GetDetails(mid); List <FishEntity.CheckDetailEntity> listsource = null; FishBll.Bll.CheckDetailBll detailBll = new FishBll.Bll.CheckDetailBll(); if (isAdd == false) { listsource = detailBll.GetModelList("mid=" + mid); if (listsource != null) { foreach (FishEntity.CheckDetailEntity item in listsource) { bool isExist = listNews.Exists((i) => { return(i.id == item.id); }); if (isExist == false) { bool isDelte = detailBll.Delete(item.id); } } } } foreach (FishEntity.CheckDetailEntity item in listNews) { if (item.id == 0) { int detailId = detailBll.Add(item); if (detailId > 0) { item.id = detailId; } } else { detailBll.Update(item); } } }