/// <summary> /// �Ľ������ /// </summary> public void UpdateObject() { //��ȡ������� LayoutANTL obj = FocusedObject; if (obj == null) { return; } //���������һ������ LayoutANTL objCopy = new LayoutANTL(); DataConverter.CopyTo<LayoutANTL>(obj, objCopy); //ִ���IJ��� using (FrmLayoutDialogANTL dlg = new FrmLayoutDialogANTL()) { dlg.Object = objCopy; //���� if (dlg.ShowDialog() != DialogResult.OK) { return; } } //�ø������½������ DataConverter.CopyTo<LayoutANTL>(objCopy, obj); //ˢ�±�� gridControl.RefreshDataSource(); }
/// <summary> /// ��Ӷ��� /// </summary> public void AddObject() { //�����������Ƿ��Ѿ����� if (ObjectList == null) { return; } //�½����� LayoutANTL obj = new LayoutANTL(); obj.UID = Guid.NewGuid().ToString() + "|" + vp.ProjectUID; obj.Creater = vp.ProjectUID;// Itop.Client.MIS.UserNumber; //obj.CreaterName = Itop.Client.MIS.UserName; try { obj.CreateDate = (DateTime)Services.BaseService.GetObject("SelectSysData", null); } catch { } //ִ����Ӳ��� using (FrmLayoutDialogANTL dlg = new FrmLayoutDialogANTL()) { dlg.IsCreate = true; //�����½���־ dlg.Object = obj; if (dlg.ShowDialog() != DialogResult.OK) { return; } } //���¶�����뵽������ ObjectList.Add(obj); //////LayoutType lt1 = Services.BaseService.GetOneByKey<LayoutType>(obj.UID); //////if (lt1 == null) //////{ ////// lt1 = new LayoutType(); ////// lt1.UID = obj.UID; ////// LayoutType lt2 = Services.BaseService.GetOneByKey<LayoutType>("LayoutModule"); ////// lt1.ExcelData = lt2.ExcelData; ////// Services.BaseService.Create<LayoutType>(lt1); //////} //ˢ�±���������ж�λ���¶����ϡ� gridControl.RefreshDataSource(); GridHelper.FocuseRow(this.gridView, obj); }