Example #1
0
        protected string GetStringFormat(Dlm.Entities.DataStructure.DataType datatype)
        {
            DataTypeDisplayPattern ddp = DataTypeDisplayPattern.Materialize(datatype.Extra);
            if (ddp != null)
                return ddp.StringPattern;

            return "";
        }
Example #2
0
 private bool removeTestPartyCustomAttributeValue(Dlm.Entities.Party.PartyCustomAttributeValue partyCustomAttrVal)
 {
     Dlm.Services.Party.PartyManager pm = new Dlm.Services.Party.PartyManager();
     return pm.RemovePartyCustomAttriuteValue(partyCustomAttrVal);
 }
Example #3
0
        protected string GetFormatedValue( object value, Dlm.Entities.DataStructure.DataType datatype, string format)
        {
            string tmp = value.ToString();

            if (DataTypeUtility.IsTypeOf(value, datatype.SystemType))
            {
                //Type type = Type.GetType("System." + datatype.SystemType);

                switch (DataTypeUtility.GetTypeCode(datatype.SystemType))
                {
                    case DataTypeCode.Int16:
                    case DataTypeCode.Int32:
                    case DataTypeCode.Int64:
                    {
                        Int64 newValue = Convert.ToInt64(tmp);
                        return newValue.ToString(format);
                    }

                    case DataTypeCode.UInt16:
                    case DataTypeCode.UInt32:
                    case DataTypeCode.UInt64:
                    {
                        UInt64 newValue = Convert.ToUInt64(tmp);
                        return newValue.ToString(format);
                    }

                    case DataTypeCode.Decimal:
                    case DataTypeCode.Double:
                    {
                        Double newValue = Convert.ToDouble(tmp);
                        return newValue.ToString(format);
                    }

                    case DataTypeCode.DateTime:
                    {
                            DateTime dateTime;

                            if (DateTime.TryParse(tmp, out dateTime))
                            {
                                return dateTime.ToString(format);
                            }

                            if (DateTime.TryParse(tmp, new CultureInfo("de-DE", false), DateTimeStyles.None, out dateTime))
                            {
                                return dateTime.ToString(format);
                            }

                            if (DateTime.TryParse(tmp, new CultureInfo("en-US", false), DateTimeStyles.None, out dateTime))
                            {
                                return dateTime.ToString(format);
                            }

                            if (DateTime.TryParse(tmp, CultureInfo.InvariantCulture, DateTimeStyles.None, out dateTime))
                            {
                                return dateTime.ToString(format);
                            }

                            return tmp;
             ;                   }
                    default: return tmp;
                }
            }

            return "";
        }
Example #4
0
 private bool removePartyRelationship(Dlm.Entities.Party.PartyRelationship partyRelationship)
 {
     Dlm.Services.Party.PartyManager pm = new Dlm.Services.Party.PartyManager();
     return pm.RemovePartyRelationship(partyRelationship);
 }
Example #5
0
 private bool removeTestPartyCustomAttribute(Dlm.Entities.Party.PartyCustomAttribute partyCustomAttr)
 {
     Dlm.Services.Party.PartyTypeManager pm = new Dlm.Services.Party.PartyTypeManager();
     return pm.DeletePartyCustomAttribute(partyCustomAttr);
 }
Example #6
0
 private void deleteTestParty(Dlm.Entities.Party.Party party)
 {
     Dlm.Services.Party.PartyManager pm = new Dlm.Services.Party.PartyManager();
     pm.Delete(party);
 }
Example #7
0
 private Dlm.Entities.Party.PartyStatus addTestPartyStatus(Dlm.Entities.Party.Party party)
 {
     Dlm.Services.Party.PartyManager pm = new Dlm.Services.Party.PartyManager();
     Dlm.Services.Party.PartyTypeManager ptm = new Dlm.Services.Party.PartyTypeManager();
     var partyType = ptm.Create("partyTypeTest2", "just for test2", null);
     var st = ptm.AddStatusType(partyType, "second try", "this is for test data", 0);
     return pm.AddPartyStatus(party, st, "test");
 }
Example #8
0
 private Dlm.Entities.Party.PartyRelationship addTestPartyRelationship(Dlm.Entities.Party.Party firstParty, Dlm.Entities.Party.Party secondParty, PartyRelationshipType prt)
 {
     Dlm.Services.Party.PartyManager pm = new Dlm.Services.Party.PartyManager();
     return pm.AddPartyRelationship(firstParty, secondParty, prt, "test Rel", "test relationship", DateTime.Now);
 }
Example #9
0
 private Dlm.Entities.Party.PartyCustomAttributeValue addTestPartyCustomAttributeValue(Dlm.Entities.Party.Party party, Dlm.Entities.Party.PartyCustomAttribute partyCustomAttr)
 {
     Dlm.Services.Party.PartyManager pm = new Dlm.Services.Party.PartyManager();
     pm.AddPartyCustomAttriuteValue(party, partyCustomAttr, "TestName");
     Dictionary<PartyCustomAttribute, string> customAtts = new Dictionary<PartyCustomAttribute, string>();
     customAtts.Add(partyCustomAttr, "Dic");
     customAtts.Add(addTestPartyCustomAttribute(party.PartyType), "dic2");
     customAtts.Add(addTestPartyCustomAttribute(party.PartyType), "dic3");
     pm.AddPartyCustomAttriuteValue(party, customAtts);
     return pm.AddPartyCustomAttriuteValue(party, partyCustomAttr, "TestName updated");
 }
Example #10
0
 private Dlm.Entities.Party.PartyCustomAttribute addTestPartyCustomAttribute(Dlm.Entities.Party.PartyType partyType)
 {
     Dlm.Services.Party.PartyTypeManager ptm = new Dlm.Services.Party.PartyTypeManager();
     return ptm.CreatePartyCustomAttribute(partyType, "string", "Name", "Name for test", "", true, 0);
 }