コード例 #1
0
        internal InboundInterfaceElement GetInboundRequestElement()
        {
            var inboundRequest = new InboundInterfaceElement();

            // Initialize User
            inboundRequest.user = ToaUserUtil.GetInboundUser();
            
            //Initialize Head
            var head = new HeadElement();
            head.allow_change_date = ToaStringsUtil.GetString(_allowChangeDate);
            head.date = _uploadDate;
            head.default_appointment_pool = _defaultAppointmentPool;
            head.id = _transactionId;
            head.processing_mode = ToaStringsUtil.GetString(_processingMode);
            head.properties_mode = ToaStringsUtil.GetString(_propertiesMode);
            head.upload_type = ToaStringsUtil.GetString(_uploadType);
            head.provider_group = _providerGroup;
            if(null != _activitySettings)
                head.appointment = _activitySettings.GetActivitySettings();
            if(null != _inventorySettings)
                head.inventory = _inventorySettings.GetInventorySettings();
            inboundRequest.head = head;

            //initialize Data
            var data = new DataElement();
            var noOfModels = _dataModels.Count;
            CommandElement [] commands = null;
            ProviderElement [] providers = null;
            if (UploadType == UploadType.Full) // Full Upload
            {
                providers = new ProviderElement[noOfModels];
                foreach (var model in _dataModels)
                {
                    if (model is WorkOrderModel)
                    {
                        var activityModel = ((WorkOrderModel) model);
                        var providerElement = new ProviderElement();
                        providerElement.appointment = activityModel.GetActivityElement();
                        providers[--noOfModels] = providerElement;
                    }
                    else if (model is InventoryModel)
                    {
                        //TODO: Need to initialize inventory object 
                    }
                }
                data.providers = providers;
            }
            else // Incremental Upload
            {
                commands = new CommandElement[noOfModels];
                foreach (var model in _dataModels)
                {
                    if (model is WorkOrderModel)
                    {
                        var workOrderModel = ((WorkOrderModel)model);
                        var command = new CommandElement();
                        command.appointment = workOrderModel.GetActivityElement();
                        command.date = workOrderModel.AssignedDate;
                        command.external_id = workOrderModel.ExternalId;
                        command.type = ToaStringsUtil.GetString(workOrderModel.CommandType);
                        commands[--noOfModels] = command;
                    }
                    else if (model is InventoryModel)
                    {
                        //TODO: Need to initialize inventory object
                    }
                }
                data.commands = commands;
            }
            
            

            inboundRequest.data = data;

            return inboundRequest;
        }
コード例 #2
0
ファイル: ElementBase.cs プロジェクト: akinomyoga/mwg
        public static new Element FromObj(object instance)
        {
            if (instance == null)
            {
                return(null);
            }
            try{
                string tagUrn  = (string)GetProperty(instance, "tagUrn");
                string tagName = (string)GetProperty(instance, "tagName");
                if (tagUrn == null || tagUrn == "")
                {
                    switch (tagName.ToLower())
                    {
                    case "!":                       return(CommentElement.FromObj(instance));

                    case "a":                       return(AElement.FromObj(instance));

                    case "area":            return(AreaElement.FromObj(instance));

                    case "base":            return(BaseElement.FromObj(instance));

                    case "basefont":        return(BaseFontElement.FromObj(instance));

                    case "bgsound":         return(BgsoundElement.FromObj(instance));

                    case "address":
                    case "pre":
                    case "center":
                    case "listing":
                    case "xmp":
                    case "plaintext":
                    case "blockquote":      return(BlockElement.FromObj(instance));

                    case "body":            return(BodyElement.FromObj(instance));

                    case "br":                      return(BrElement.FromObj(instance));

                    case "button":          return(ButtonElement.FromObj(instance));

                    case "dd":                      return(DdElement.FromObj(instance));

                    case "div":                     return(DivElement.FromObj(instance));

                    case "dl":                      return(DlElement.FromObj(instance));

                    case "dt":                      return(DtElement.FromObj(instance));

                    case "embed":           return(EmbedElement.FromObj(instance));

                    case "fieldset":        return(FieldsetElement.FromObj(instance));

                    case "font":            return(FontElement.FromObj(instance));

                    case "form":            return(FormElement.FromObj(instance));

                    case "frame":           return(FrameElement.FromObj(instance));

                    case "frameset":        return(FramesetElement.FromObj(instance));

                    case "head":            return(HeadElement.FromObj(instance));

                    case "h1":
                    case "h2":
                    case "h3":
                    case "h4":
                    case "h5":
                    case "h6":
                        return(HnElement.FromObj(instance));

                    case "hr":                      return(HrElement.FromObj(instance));

                    case "html":            return(HtmlElement.FromObj(instance));

                    case "iframe":          return(IframeElement.FromObj(instance));

                    case "img":                     return(ImgElement.FromObj(instance));

                    case "input":           return(InputElement.FromObj(instance));

                    case "isindex":         return(IsindexElement.FromObj(instance));

                    case "legend":          return(LegendElement.FromObj(instance));

                    case "label":           return(LabelElement.FromObj(instance));

                    case "li":                      return(LiElement.FromObj(instance));

                    case "link":            return(LinkElement.FromObj(instance));

                    case "map":                     return(MapElement.FromObj(instance));

                    case "marquee":         return(MarqueeElement.FromObj(instance));

                    case "meta":            return(MetaElement.FromObj(instance));

                    case "nextid":          return(NextidElement.FromObj(instance));

                    case "noembed":
                    case "noframes":
                    case "nolayer":
                    case "noscript":        return(NoshowElement.FromObj(instance));

                    case "applet":
                    case "object":          return(ObjectElement.FromObj(instance));

                    case "ol":                      return(OlElement.FromObj(instance));

                    case "optgroup":
                    case "option":          return(OptionElement.FromObj(instance));

                    case "p":                       return(PElement.FromObj(instance));

                    case "param":           return(ParamElement.FromObj(instance));

                    case "i":
                    case "u":
                    case "b":
                    case "q":
                    case "s":
                    case "strong":
                    case "del":
                    case "strike":
                    case "em":
                    case "small":
                    case "big":
                    case "ruby":
                    case "rp":
                    case "sub":
                    case "sup":
                    case "acronym":
                    case "bdo":
                    case "cite":
                    case "dfn":
                    case "ins":
                    case "code":
                    case "kbd":
                    case "samp":
                    case "var":
                    case "nobr":            return(PhraseElement.FromObj(instance));

                    case "script":          return(ScriptElement.FromObj(instance));

                    case "select":          return(SelectElement.FromObj(instance));

                    case "span":            return(SpanElement.FromObj(instance));

                    case "style":           return(StyleElement.FromObj(instance));

                    case "caption":         return(CaptionElement.FromObj(instance));

                    case "td":
                    case "th":                      return(TableCellElement.FromObj(instance));

                    case "table":           return(TableElement.FromObj(instance));

                    case "colgroup":
                    case "col":                     return(ColElement.FromObj(instance));

                    case "tr":                      return(TrElement.FromObj(instance));

                    case "thead":
                    case "tbody":
                    case "tfoot":           return(TableSectionElement.FromObj(instance));

                    case "textarea":        return(TextAreaElement.FromObj(instance));

                    case "wbr": return(TextElement.FromObj(instance));

                    case "title":           return(TitleElement.FromObj(instance));

                    case "dir":
                    case "menu":
                    case "ul":                      return(UlElement.FromObj(instance));
                        // optionbutton ?
                        // spanflow ?
                        // default:			return UnknownElement.FromObj(instance);
                    }
                }
            }catch {
                // IHTMLElement でない可能性
            }

            return(new Element(instance));
        }
コード例 #3
0
ファイル: InboundRequest.cs プロジェクト: thollu/accelerators
        internal InboundInterfaceElement GetInboundRequestElement()
        {
            var inboundRequest = new InboundInterfaceElement();

            // Initialize User
            inboundRequest.user = ToaUserUtil.GetInboundUser();

            //Initialize Head
            var head = new HeadElement();

            head.allow_change_date = ToaStringsUtil.GetString(_allowChangeDate);
            head.date = _uploadDate;
            head.default_appointment_pool = _defaultAppointmentPool;
            head.id = _transactionId;
            head.processing_mode = ToaStringsUtil.GetString(_processingMode);
            head.properties_mode = ToaStringsUtil.GetString(_propertiesMode);
            head.upload_type     = ToaStringsUtil.GetString(_uploadType);
            head.provider_group  = _providerGroup;
            if (null != _activitySettings)
            {
                head.appointment = _activitySettings.GetActivitySettings();
            }
            if (null != _inventorySettings)
            {
                head.inventory = _inventorySettings.GetInventorySettings();
            }
            inboundRequest.head = head;

            //initialize Data
            var data       = new DataElement();
            var noOfModels = _dataModels.Count;

            CommandElement []  commands  = null;
            ProviderElement [] providers = null;
            if (UploadType == UploadType.Full) // Full Upload
            {
                providers = new ProviderElement[noOfModels];
                foreach (var model in _dataModels)
                {
                    if (model is WorkOrderModel)
                    {
                        var activityModel   = ((WorkOrderModel)model);
                        var providerElement = new ProviderElement();
                        providerElement.appointment = activityModel.GetActivityElement();
                        providers[--noOfModels]     = providerElement;
                    }
                    else if (model is InventoryModel)
                    {
                        //TODO: Need to initialize inventory object
                    }
                }
                data.providers = providers;
            }
            else // Incremental Upload
            {
                commands = new CommandElement[noOfModels];
                foreach (var model in _dataModels)
                {
                    if (model is WorkOrderModel)
                    {
                        var workOrderModel = ((WorkOrderModel)model);
                        var command        = new CommandElement();
                        command.appointment    = workOrderModel.GetActivityElement();
                        command.date           = workOrderModel.AssignedDate;
                        command.external_id    = workOrderModel.ExternalId;
                        command.type           = ToaStringsUtil.GetString(workOrderModel.CommandType);
                        commands[--noOfModels] = command;
                    }
                    else if (model is InventoryModel)
                    {
                        //TODO: Need to initialize inventory object
                    }
                }
                data.commands = commands;
            }



            inboundRequest.data = data;

            return(inboundRequest);
        }
コード例 #4
0
 public bool CanEat(Meal meal)
 {
     return(HeadElement.CheckCollision(meal));
 }