示例#1
0
        private void btnListDetail_Execute(object sender, SimpleActionExecuteEventArgs e)
        {
            if (View.CurrentObject == null)
                return;

            ControlDrawing drawing = (ControlDrawing)View.CurrentObject;

            if (drawing.Control == null)
            {
                XtraMessageBox.Show("����ѡ�������� !!!");
                return;
            }

            DialogResult dr = XtraMessageBox.Show("ע�� : ԭ�еĹ���ͼ���Ͻ���ɾ�� !!!", "����", MessageBoxButtons.OKCancel);

            if (dr == DialogResult.Cancel)
                return;

            foreach (ControlDrawingDetail detail in drawing.ControlDrawingDetails)
            {
                detail.Delete();
            }

            foreach (Dim dim in drawing.Control.Dims)
            {
                ControlDrawingDetail detail = new ControlDrawingDetail(drawing.Session);
                detail.ControlDrawing = drawing;
                detail.Dim = dim;
                detail.Save();
            }
        }
示例#2
0
        public void CopyTo(ControlDrawing ToControlDrawing)
        {
            ToControlDrawing.Item = Item;
            ToControlDrawing.Jia = Jia;
            ToControlDrawing.Machine = Machine;
            ToControlDrawing.NextProcessNo = NextProcessNo;
            ToControlDrawing.ProcessNo = ProcessNo;
            ToControlDrawing.PreProcessNo = PreProcessNo;
            ToControlDrawing.CurrentVersion = CurrentVersion;
            ToControlDrawing.Revision = Revision;
            ToControlDrawing.Control = Control;
            ToControlDrawing.CycleTime = CycleTime;

            foreach (ControlDrawingTool ControlDrawingTool in ControlDrawingTools)
            {
                ToControlDrawing.ControlDrawingTools.Add(ControlDrawingTool);
            }

            foreach(ControlDrawingDetail CDDetail in ControlDrawingDetails)
            {
                ControlDrawingDetail NewCDDetail = new ControlDrawingDetail(Session);
                CDDetail.CopyTo(NewCDDetail);
                ToControlDrawing.ControlDrawingDetails.Add(NewCDDetail);
            }
        }
 public void CopyTo(ControlDrawingDetail NewDrawingDetail)
 {
     NewDrawingDetail.Dim = Dim;
     NewDrawingDetail.DimValue = DimValue;
     NewDrawingDetail.SetupDim = SetupDim;
     NewDrawingDetail.Form = Form;
     NewDrawingDetail.Gage = Gage;
     NewDrawingDetail.InspecFreq = InspecFreq;
     NewDrawingDetail.InspectQty = InspectQty;
     NewDrawingDetail.Tolerance = Tolerance;
 }