public LoaiThietBi getLoaiThietBi() { if (obj.id != Guid.Empty) { return(LoaiThietBi.getById(obj.id)); } return(null); }
private void setDataObj() { try { objLoaiThietBi.ten = txtTen.Text; objLoaiThietBi.mota = txtMoTa.Text; if (ceTBsoluonglon.Checked) { if (objLoaiThietBi.thietbis.Count == 0) { ThietBi obj = new ThietBi(); obj.ten = txtTen.Text; obj.mota = txtMoTa.Text; obj.hinhanhs = listHinhs; objLoaiThietBi.thietbis.Add(obj); } else { ThietBi obj = objLoaiThietBi.thietbis.FirstOrDefault(); obj.ten = txtTen.Text; obj.mota = txtMoTa.Text; obj.hinhanhs = listHinhs; } } LoaiThietBi parentLoaiThietBi = (LoaiThietBi)lueThuoc.GetSelectedDataRow(); if (parentLoaiThietBi.id != Guid.Empty) { objLoaiThietBi.parent = LoaiThietBi.getById(parentLoaiThietBi.id); } else { if (function.Equals("edit")) { objLoaiThietBi.parent_id = null; } } if (ceTBsoluonglon.Checked) { objLoaiThietBi.loaichung = true; } else { objLoaiThietBi.loaichung = false; } } catch (Exception ex) { Debug.WriteLine(this.Name + " : setDataObj : " + ex.Message); } }
private void treeListLoaiTB_FocusedNodeChanged(object sender, DevExpress.XtraTreeList.FocusedNodeChangedEventArgs e) { try { if (treeListLoaiTB.GetDataRecordByNode(e.Node) != null) { enableEdit(false, ""); SetTextGroupControl("Chi tiết", Color.Black); //objLoaiThietBi = (LoaiThietBi)treeListLoaiTB.GetDataRecordByNode(e.Node); objLoaiThietBi = LoaiThietBi.getById(GUID.From(e.Node.GetValue(colid))); setData(); } } catch (Exception ex) { Debug.WriteLine(this.Name + " : treeListLoaiTB_FocusedNodeChanged : " + ex.Message); } }
public List <LoaiThietBi> getListLoaiTB() { try { List <LoaiThietBi> list = new List <LoaiThietBi>(); List <TreeListNode> listNode = treeListLoaiTB.GetAllCheckedNodes(); foreach (TreeListNode node in listNode) { LoaiThietBi obj = LoaiThietBi.getById(GUID.From(node.GetValue(colid))); list.Add(obj); } return(list); } catch (Exception ex) { Debug.WriteLine(this.Name + "->getListLoaiTB: " + ex.Message); return(null); } }