public string Builder(DocModel doc) { _xml = @"< fetch version = '1.0' output - format = 'xml-platform' mapping = 'logical' distinct = 'false' > <entity name = 'new_doc_to_entity' > <attribute name = 'new_doc_to_entityid' /> <attribute name = 'new_name' /> <attribute name = 'createdon' /> <attribute name = 'new_description' /> <attribute name = 'new_testdrive_ind' /> <attribute name = 'new_ready_for_delivery_ind' /> <attribute name = 'new_customer_class_glb' /> <attribute name = 'new_taradin_ind' /> <attribute name = 'new_required' /> <attribute name = 'new_loan_ind' /> <filter type = 'and'>"; if (_conditions.Any()) { _xml = _xml + @"< filter type = 'and' > "; foreach (var condition in _conditions.Keys) { _xml = _xml + "<condition attribute = '" + condition + "' operator= 'eq' value = '" + (_conditions[condition] == true ? "1" : "0") + "' />"; } _xml = _xml + @"</filter>"; } _xml = _xml + @"<link-entity name = 'new_doc_type' from = 'new_doc_typeid' to = 'new_doc_type' visible = 'false' link-type = 'inner' alias = 'aa' > <attribute name = 'new_description' /> <attribute name = 'new_name' /> <attribute name = 'new_doc_type' /> <filter type='and'> < condition attribute = 'new_entity_scheme_name' operator= 'eq' value = '" + doc.EntityName + "' /> </ filter> </link-entity> </ entity > </ fetch > "; return(_xml); }
public override DocModel GetParameters() { DocModel doc = Loadhelper(); var preImage = LoadPreImage(); doc.Delivery = _target.GetAttributeValue <bool?>("new_ready_for_delivery"); return(doc); }
public BuilderFetch AddConditionLoad(DocModel doc) { if (doc.IsLoan.HasValue) { if (!_conditions.ContainsKey("new_loan_ind")) { _conditions.Add("new_loan_ind", doc.IsLoan.Value); } } return(this); }
public BuilderFetch AddConditionTestDrive(DocModel doc) { if (doc.IsTestDrive.HasValue) { if (!_conditions.ContainsKey("new_testdrive_ind")) { _conditions.Add("new_testdrive_ind", doc.IsTestDrive.Value); } } return(this); }
public BuilderFetch AddConditionTradeIn(DocModel doc) { if (doc.IsTardeIn.HasValue) { if (!_conditions.ContainsKey("new_taradin_ind")) { _conditions.Add("new_taradin_ind", doc.IsTardeIn.Value); } } return(this); }
public BuilderFetch AddConditionDelivery(DocModel doc) { if (doc.Delivery.HasValue) { if (!_conditions.ContainsKey("new_ready_for_delivery_ind")) { _conditions.Add("new_ready_for_delivery_ind", doc.Delivery.Value); } } return(this); }
public override DocModel GetParameters() { DocModel doc = Loadhelper(); var preImage = LoadPreImage(); doc.IsTardeIn = _target.GetAttributeValue <bool?>("new_is_tradein"); doc.IsTestDrive = _target.GetAttributeValue <bool?>("new_is_testdrive"); doc.IsLoan = _target.GetAttributeValue <bool?>("new_is_finance"); //doc.Delivery = _target.GetAttributeValue<bool?>("new_is_finance"); return(doc); }
protected DocModel Loadhelper() { DocModel doc = new DocModel(); doc.Subject = _subject; doc.EntityName = _target.LogicalName; var preImage = LoadPreImage(); var ownerid = new EntityReference(); if (preImage != null && preImage.GetAttributeValue<EntityReference>("ownerid") != null) doc.OwnerId = preImage.GetAttributeValue<EntityReference>("ownerid"); if (_target != null && _target.GetAttributeValue<EntityReference>("ownerid") != null) doc.OwnerId = _target.GetAttributeValue<EntityReference>("ownerid"); doc.RegardingId = _target.ToEntityReference(); return doc; }
protected DocModel Loadhelper() { DocModel doc = new DocModel(); doc.Subject = _subject; doc.EntityName = _target.LogicalName; var preImage = LoadPreImage(); var ownerid = new EntityReference(); if (preImage != null && preImage.GetAttributeValue <EntityReference>("ownerid") != null) { doc.OwnerId = preImage.GetAttributeValue <EntityReference>("ownerid"); } if (_target != null && _target.GetAttributeValue <EntityReference>("ownerid") != null) { doc.OwnerId = _target.GetAttributeValue <EntityReference>("ownerid"); } doc.RegardingId = _target.ToEntityReference(); return(doc); }
public BuilderFetch AddConditionLoad(DocModel doc) { if (doc.IsLoan.HasValue) { if (!_conditions.ContainsKey("new_loan_ind")) _conditions.Add("new_loan_ind", doc.IsLoan.Value); } return this; }
public BuilderFetch AddConditionDelivery(DocModel doc) { if (doc.Delivery.HasValue) { if (!_conditions.ContainsKey("new_ready_for_delivery_ind")) _conditions.Add("new_ready_for_delivery_ind", doc.Delivery.Value); } return this; }
public string Builder(DocModel doc) { _xml = @"< fetch version = '1.0' output - format = 'xml-platform' mapping = 'logical' distinct = 'false' > <entity name = 'new_doc_to_entity' > <attribute name = 'new_doc_to_entityid' /> <attribute name = 'new_name' /> <attribute name = 'createdon' /> <attribute name = 'new_description' /> <attribute name = 'new_testdrive_ind' /> <attribute name = 'new_ready_for_delivery_ind' /> <attribute name = 'new_customer_class_glb' /> <attribute name = 'new_taradin_ind' /> <attribute name = 'new_required' /> <attribute name = 'new_loan_ind' /> <filter type = 'and'>"; if (_conditions.Any()) { _xml = _xml + @"< filter type = 'and' > "; foreach (var condition in _conditions.Keys) { _xml = _xml + "<condition attribute = '" + condition + "' operator= 'eq' value = '" + (_conditions[condition] == true ? "1" : "0") + "' />"; } _xml = _xml + @"</filter>"; } _xml = _xml + @"<link-entity name = 'new_doc_type' from = 'new_doc_typeid' to = 'new_doc_type' visible = 'false' link-type = 'inner' alias = 'aa' > <attribute name = 'new_description' /> <attribute name = 'new_name' /> <attribute name = 'new_doc_type' /> <filter type='and'> < condition attribute = 'new_entity_scheme_name' operator= 'eq' value = '"+ doc.EntityName+ "' /> </ filter> </link-entity> </ entity > </ fetch > "; return _xml; }
public BuilderFetch AddConditionTradeIn(DocModel doc) { if (doc.IsTardeIn.HasValue) { if (!_conditions.ContainsKey("new_taradin_ind")) _conditions.Add("new_taradin_ind", doc.IsTardeIn.Value); } return this; }
public BuilderFetch AddConditionTestDrive(DocModel doc) { if (doc.IsTestDrive.HasValue) { if (!_conditions.ContainsKey("new_testdrive_ind")) _conditions.Add("new_testdrive_ind", doc.IsTestDrive.Value); } return this; }