Exemplo n.º 1
0
 public void DeleteAllObjects()
 {
     using (DocumentLock doclock = Document.LockDocument())
     {
         using (AcDb.Transaction trans = TransactionManager.StartTransaction())
         {
             foreach (var obj in (ObjectList.FindAll(p => p.ToolpathCurve != null || p.ProcessActions != null)))
             {
                 if (obj.ToolpathCurve != null)
                 {
                     trans.GetObject(obj.ToolpathCurve.ObjectId, AcDb.OpenMode.ForWrite);
                     obj.ToolpathCurve.Erase();
                 }
                 else
                 {
                     obj.ProcessActions.ForEach(p =>
                     {
                         trans.GetObject(p.Toolpath.ObjectId, AcDb.OpenMode.ForWrite);
                         p.Toolpath.Erase();
                     });
                 }
             }
             trans.Commit();
             Editor.UpdateScreen();
         }
     }
     ObjectList.Clear();
 }
Exemplo n.º 2
0
    private void LoadHumanParty() {
      HumanParty person = (HumanParty) this.Party;

      cboPartyType.Value = person.ObjectTypeInfo.Id.ToString();

      if (person.RegistryDate != ExecutionServer.DateMaxValue) {
        txtBornDate.Value = person.RegistryDate.ToString("dd/MMM/yyyy");
      } else {
        txtBornDate.Value = String.Empty;
      }
      txtFirstFamilyName.Value = person.FirstFamilyName;
      txtFirstName.Value = person.FirstName;
      txtMaritalFamilyName.Value = person.MaritalFamilyName;
      cboGender.Value = ((char) person.Gender).ToString();
      txtIFENumber.Value = person.IFENumber;
      txtCURPNumber.Value = person.CURPNumber;
      txtTaxIDNumber.Value = person.TaxIDNumber;
      txtNicknames.Value = person.Nicknames;
      txtSecondFamilyName.Value = person.SecondFamilyName;

      cboBornLocation.Items.Clear();
      cboBornLocation.Items.Add(new ListItem(person.RegistryLocation.CompoundName, person.RegistryLocation.Id.ToString()));

      ObjectList<RecordingActParty> list = RecordingActParty.GetList(this.RecordingAct.Recording, this.Party);
      List<RecordingActParty> p = list.FindAll((x) => (x.Party.Equals(this.Party) && x.SecondaryParty.IsEmptyInstance) || x.SecondaryParty.Equals(this.Party));

      RecordingActParty lastParty = null;
      if (p.Count != 0) {
        lastParty = p[0];
      } else {
        lastParty = person.GetLastRecordingActParty(this.recordingAct.Recording.PresentationTime);
      }
      if (lastParty == null) {
        isLoaded = true;
        return;
      }
      txtAddress.Value = lastParty.PartyAddress;
      cboAddressPlace.Items.Clear();
      cboAddressPlace.Items.Add(new ListItem(lastParty.PartyAddressPlace.CompoundName, lastParty.PartyAddressPlace.Id.ToString()));
      cboOccupation.Value = lastParty.PartyOccupation.Id.ToString();
      cboMarriageStatus.Value = lastParty.PartyMarriageStatus.Id.ToString();

      isLoaded = true;
    }
Exemplo n.º 3
0
        void SetConnect(ProcessObject obj, VertexType vertex)
        {
            RemoveConnect(obj, vertex);
            Point3d point = vertex == VertexType.Start ? obj.ProcessCurve.StartPoint : obj.ProcessCurve.EndPoint;
            List <ProcessObject> connectList = ObjectList.FindAll(p => p != obj && (p.ProcessCurve.StartPoint == point || p.ProcessCurve.EndPoint == point));

            if (connectList.Count == 1)  // TODO поиск первого
            {
                ProcessObject connectObject = connectList[0];
                VertexType    connectVertex = point == connectObject.ProcessCurve.StartPoint ? VertexType.Start : VertexType.End;
                obj.ConnectObject[vertex.Index()] = connectObject;
                obj.ConnectVertex[vertex.Index()] = connectVertex;
                connectObject.ConnectObject[connectVertex.Index()] = obj;
                connectObject.ConnectVertex[connectVertex.Index()] = vertex;
                if (connectObject.Side != SideType.None)
                {
                    obj.Side = vertex != connectVertex ? connectObject.Side : connectObject.Side.Opposite();
                }
            }
        }
Exemplo n.º 4
0
    private void LoadRolesCombo(ObjectList<RecordingActParty> parties) {
      this.cboRole.Items.Clear();

      if (parties.Count == 0 || parties.Count((x) => x.OwnershipMode == OwnershipMode.Owner) == 0) {
        HtmlSelectContent.LoadCombo(this.cboRole, this.recordingAct.RecordingActType.GetRoles(), "Id", "Name", "( Seleccionar rol )");
      } else {
        HtmlSelectContent.LoadCombo(this.cboRole, "( Seleccionar rol )", String.Empty, String.Empty);
      }

      List<RecordingActParty> bareOwnersList = parties.FindAll((x) => x.OwnershipMode == OwnershipMode.Bare);
      if (bareOwnersList.Count != 0) {
        this.cboRole.Items.Add(new ListItem(DomainActPartyRole.Usufructuary.Name, DomainActPartyRole.Usufructuary.Id.ToString()));
        HtmlSelectContent.LoadCombo<RecordingActParty>(cboUsufructuaryOf, bareOwnersList, (x) => x.Party.Id.ToString(),
                                                       (x) => x.Party.FullName, "( Seleccionar al nudo propietario )");
        if (cboUsufructuaryOf.Items.Count > 2) {
          cboUsufructuaryOf.Items.Add(new ListItem("( Selección múltiple )", "multiselect"));
        }
      }

      this.cboRole.Items.Add(new ListItem("( Secundarios )", String.Empty));
      HtmlSelectContent.AppendToCombo(this.cboRole, PartiesRole.GetList(), "Id", "Name");
    }