示例#1
0
        public void WriteXml(XmlWriter writer)
        {
            var w = new APIWriter(writer);

            writer.WriteComment(DateTime.Now.ToString());
            foreach (var pi in typeof(OnlineRegModel).GetProperties(BindingFlags.Public | BindingFlags.Instance)
                     .Where(vv => vv.CanRead && vv.CanWrite))
            {
                switch (pi.Name)
                {
                case "List":
                    w.Start("List");
                    foreach (var i in list)
                    {
                        Util.Serialize(i, writer);
                    }
                    w.End();
                    break;

                case "History":
                    w.Start("History");
                    foreach (var i in History)
                    {
                        w.Add("item", i);
                    }
                    w.End();
                    break;

                case "password":
                    break;

                case "testing":
                    if (testing == true)
                    {
                        w.Add(pi.Name, testing);
                    }
                    break;

                case "prospect":
                    if (prospect)
                    {
                        w.Add(pi.Name, prospect);
                    }
                    break;

                default:
                    w.Add(pi.Name, pi.GetValue(this, null));
                    break;
                }
            }
        }
示例#2
0
        public void WriteXml(XmlWriter writer)
        {
            var w = new APIWriter(writer);

            writer.WriteComment(DateTime.Now.ToString());
            foreach (PropertyInfo pi in typeof(OnlineRegModel).GetProperties(BindingFlags.Public | BindingFlags.Instance)
                     .Where(vv => vv.CanRead && vv.CanWrite))
            {
                Debug.WriteLine(pi.Name);
                switch (pi.Name)
                {
                case "List":
                    w.Start("List");
                    foreach (var i in list)
                    {
                        Util.Serialize(i, writer);
                    }
                    w.End();
                    break;

                case "password":
                    break;

                default:
                    w.Add(pi.Name, pi.GetValue(this, null));
                    break;
                }
            }
        }
示例#3
0
 public override void WriteXml(APIWriter w)
 {
     if (!Label.HasValue())
     {
         Label = "Request";
     }
     w.Add("AskRequest", Label);
 }
 private bool WriteCheckboxChoices(bool checkoxesAdded, APIWriter w)
 {
     if (Checkbox != null && Checkbox.Count > 0 && !checkoxesAdded)
     {
         foreach (var c in Checkbox)
         {
             w.Add("Checkbox", c);
         }
     }
     checkoxesAdded = true;
     return(checkoxesAdded);
 }
 private bool WriteDropdownOptions(bool optionsAdded, APIWriter w)
 {
     if (option != null && option.Count > 0 && !optionsAdded)
     {
         foreach (var o in option)
         {
             w.Add("option", o);
         }
     }
     optionsAdded = true;
     return(optionsAdded);
 }
示例#6
0
文件: AskText.cs 项目: thewruck/bvcms
 public override void WriteXml(APIWriter w)
 {
     if (list.Count == 0)
     {
         return;
     }
     w.Start(Type);
     foreach (var q in list)
     {
         w.Add("Question", q.Question);
     }
     w.End();
 }
示例#7
0
 public override void WriteXml(APIWriter w)
 {
     if (list.Count == 0)
     {
         return;
     }
     w.Start(Type);
     w.Add("Label", Label);
     foreach (var g in list)
     {
         g.WriteXml(w);
     }
     w.End();
 }
示例#8
0
 public override void WriteXml(APIWriter w)
 {
     if (list.Count == 0)
     {
         return;
     }
     w.Start(Type)
     .AttrIfTrue("TargetExtraValue", TargetExtraValue);
     foreach (var q in list)
     {
         w.Add("Question", q.Question);
     }
     w.End();
 }
        public string WriteXml()
        {
            var optionsAdded   = false;
            var checkoxesAdded = false;
            var w = new APIWriter();

            w.Start("OnlineRegPersonModel");

            foreach (PropertyInfo pi in typeof(OnlineRegPersonModel0).GetProperties(BindingFlags.Public | BindingFlags.Instance)
                     .Where(vv => vv.CanRead && vv.CanWrite))
            {
                switch (pi.Name)
                {
                case "ExtraQuestion":
                    WriteExtraAnswers(w);
                    break;

                case "Text":
                    WriteText(w);
                    break;

                case "YesNoQuestion":
                    WriteYesNoChoices(w);
                    break;

                case "option":
                    optionsAdded = WriteDropdownOptions(optionsAdded, w);
                    break;

                case "Checkbox":
                    checkoxesAdded = WriteCheckboxChoices(checkoxesAdded, w);
                    break;

                case "MenuItem":
                    WriteMenuChoices(w);
                    break;

                default:
                    w.Add(pi.Name, pi.GetValue(this, null));
                    break;
                }
            }
            w.End();
            return(w.ToString());
        }
示例#10
0
        public void WriteXml(XmlWriter writer)
        {
            var optionsAdded   = false;
            var checkoxesAdded = false;
            var w = new APIWriter(writer);

            foreach (PropertyInfo pi in typeof(OnlineRegPersonModel).GetProperties(BindingFlags.Public | BindingFlags.Instance)
                     .Where(vv => vv.CanRead && vv.CanWrite))
            {
                switch (pi.Name)
                {
                case "SpecialTest":
                    WriteSpecialTest(w);
                    break;

                case "FundItem":
                    WriteFundItems(w);
                    break;

                case "FamilyAttend":
                    WriteFamilyAttend(w);
                    break;

                case "ExtraQuestion":
                    WriteExtraAnswers(w);
                    break;

                case "Text":
                    WriteText(w);
                    break;

                case "YesNoQuestion":
                    WriteYesNoChoices(w);
                    break;

                case "OrganizationDocument":
                    WriteDocumentsUpload(w);
                    break;

                case "option":
                    optionsAdded = WriteDropdownOptions(optionsAdded, w);
                    break;

                case "Checkbox":
                    checkoxesAdded = WriteCheckboxChoices(checkoxesAdded, w);
                    break;

                case "MenuItem":
                    WriteMenuChoices(w);
                    break;

                case "MissionTripGoerId":
                    if (Parent.SupportMissionTrip)
                    {
                        w.Add(pi.Name, MissionTripGoerId);
                    }
                    break;

                case "IsFilled":
                    if (IsFilled)
                    {
                        w.Add(pi.Name, IsFilled);
                    }
                    break;

                case "CreatingAccount":
                    if (CreatingAccount)
                    {
                        w.Add(pi.Name, CreatingAccount);
                    }
                    break;

                case "MissionTripNoNoticeToGoer":
                    if (MissionTripNoNoticeToGoer)
                    {
                        w.Add(pi.Name, MissionTripNoNoticeToGoer);
                    }
                    break;

                case "memberus":
                    if (memberus)
                    {
                        w.Add(pi.Name, memberus);
                    }
                    break;

                case "otherchurch":
                    if (otherchurch)
                    {
                        w.Add(pi.Name, otherchurch);
                    }
                    break;

                case "nochurch":
                    if (nochurch)
                    {
                        w.Add(pi.Name, nochurch);
                    }
                    break;

                default:
                    w.Add(pi.Name, pi.GetValue(this, null));
                    break;
                }
            }
        }
示例#11
0
        public void WriteXml(XmlWriter writer)
        {
            var optionsAdded   = false;
            var checkoxesAdded = false;
            var w = new APIWriter(writer);

            foreach (PropertyInfo pi in typeof(OnlineRegPersonModel).GetProperties(BindingFlags.Public | BindingFlags.Instance)
                     .Where(vv => vv.CanRead && vv.CanWrite))
            {
                switch (pi.Name)
                {
                case "FundItem":
                    if (FundItem != null && FundItem.Count > 0)
                    {
                        foreach (var f in FundItem.Where(ff => ff.Value > 0))
                        {
                            w.Start("FundItem");
                            w.Attr("fund", f.Key);
                            w.AddText(f.Value.Value.ToString());
                            w.End();
                        }
                    }
                    break;

                case "FamilyAttend":
                    if (FamilyAttend != null && FamilyAttend.Count > 0)
                    {
                        foreach (var f in FamilyAttend)
                        {
                            w.Start("FamilyAttend");
                            w.Attr("PeopleId", f.PeopleId);
                            w.Attr("Name", f.Name);
                            w.Attr("Attend", f.Attend);
                            w.Attr("Birthday", f.Birthday);
                            w.Attr("GenderId", f.GenderId);
                            w.Attr("MaritalId", f.MaritalId);
                            w.End();
                        }
                    }
                    break;

                case "ExtraQuestion":
                    if (ExtraQuestion != null)
                    {
                        for (var i = 0; i < ExtraQuestion.Count; i++)
                        {
                            if (ExtraQuestion[i] != null && ExtraQuestion[i].Count > 0)
                            {
                                foreach (var q in ExtraQuestion[i])
                                {
                                    w.Start("ExtraQuestion");
                                    w.Attr("set", i);
                                    w.Attr("question", q.Key);
                                    w.AddText(q.Value);
                                    w.End();
                                }
                            }
                        }
                    }
                    break;

                case "YesNoQuestion":
                    if (YesNoQuestion != null && YesNoQuestion.Count > 0)
                    {
                        foreach (var q in YesNoQuestion)
                        {
                            w.Start("YesNoQuestion");
                            w.Attr("question", q.Key);
                            w.AddText(q.Value.ToString());
                            w.End();
                        }
                    }
                    break;

                case "option":
                    if (option != null && option.Count > 0 && !optionsAdded)
                    {
                        foreach (var o in option)
                        {
                            w.Add("option", o);
                        }
                    }
                    optionsAdded = true;
                    break;

                case "Checkbox":
                    if (Checkbox != null && Checkbox.Count > 0 && !checkoxesAdded)
                    {
                        foreach (var c in Checkbox)
                        {
                            w.Add("Checkbox", c);
                        }
                    }
                    checkoxesAdded = true;
                    break;

                case "MenuItem":
                    if (MenuItem != null)
                    {
                        for (var i = 0; i < MenuItem.Count; i++)
                        {
                            if (MenuItem[i] != null && MenuItem[i].Count > 0)
                            {
                                foreach (var q in MenuItem[i])
                                {
                                    w.Start("MenuItem");
                                    w.Attr("set", i);
                                    w.Attr("name", q.Key);
                                    w.Attr("number", q.Value);
                                    w.End();
                                }
                            }
                        }
                    }
                    break;

                case "MissionTripPray":
                    if (Parent.SupportMissionTrip)
                    {
                        w.Add(pi.Name, MissionTripPray);
                    }
                    break;

                case "MissionTripGoerId":
                    if (Parent.SupportMissionTrip)
                    {
                        w.Add(pi.Name, MissionTripGoerId);
                    }
                    break;

                case "IsFilled":
                    if (IsFilled)
                    {
                        w.Add(pi.Name, IsFilled);
                    }
                    break;

                case "CreatingAccount":
                    if (CreatingAccount)
                    {
                        w.Add(pi.Name, CreatingAccount);
                    }
                    break;

                case "MissionTripNoNoticeToGoer":
                    if (MissionTripNoNoticeToGoer)
                    {
                        w.Add(pi.Name, MissionTripNoNoticeToGoer);
                    }
                    break;

                case "memberus":
                    if (memberus)
                    {
                        w.Add(pi.Name, memberus);
                    }
                    break;

                case "otherchurch":
                    if (otherchurch)
                    {
                        w.Add(pi.Name, otherchurch);
                    }
                    break;

                default:
                    w.Add(pi.Name, pi.GetValue(this, null));
                    break;
                }
            }
        }
示例#12
0
        public void WriteXml(XmlWriter writer)
        {
            var optionsAdded   = false;
            var checkoxesAdded = false;
            var menuitemsAdded = false;
            var w = new APIWriter(writer);

            foreach (PropertyInfo pi in typeof(OnlineRegPersonModel).GetProperties(BindingFlags.Public | BindingFlags.Instance)
                     .Where(vv => vv.CanRead && vv.CanWrite))
            {
                switch (pi.Name)
                {
                case "FundItem":
                    if (FundItem != null && FundItem.Count > 0)
                    {
                        foreach (var f in FundItem.Where(ff => ff.Value > 0))
                        {
                            w.Start("FundItem");
                            w.Attr("fund", f.Key);
                            w.AddText(f.Value.Value.ToString());
                            w.End();
                        }
                    }
                    break;

                case "ExtraQuestion":
                    if (ExtraQuestion != null)
                    {
                        for (var i = 0; i < ExtraQuestion.Count; i++)
                        {
                            if (ExtraQuestion[i] != null && ExtraQuestion[i].Count > 0)
                            {
                                foreach (var q in ExtraQuestion[i])
                                {
                                    w.Start("ExtraQuestion");
                                    w.Attr("set", i);
                                    w.Attr("question", q.Key);
                                    w.AddText(q.Value);
                                    w.End();
                                }
                            }
                        }
                    }
                    break;

                case "YesNoQuestion":
                    if (YesNoQuestion != null && YesNoQuestion.Count > 0)
                    {
                        foreach (var q in YesNoQuestion)
                        {
                            w.Start("YesNoQuestion");
                            w.Attr("question", q.Key);
                            w.AddText(q.Value.ToString());
                            w.End();
                        }
                    }
                    break;

                case "option":
                    if (option != null && option.Count > 0 && !optionsAdded)
                    {
                        foreach (var o in option)
                        {
                            w.Add("option", o);
                        }
                    }
                    optionsAdded = true;
                    break;

                case "Checkbox":
                    if (Checkbox != null && Checkbox.Count > 0 && !checkoxesAdded)
                    {
                        foreach (var c in Checkbox)
                        {
                            w.Add("Checkbox", c);
                        }
                    }
                    checkoxesAdded = true;
                    break;

                case "MenuItem":
                    if (MenuItem != null && !menuitemsAdded)
                    {
                        foreach (var kv in MenuItem)
                        {
                            w.Start("MenuItem");
                            w.Attr("name", kv.Key);
                            w.Attr("number", kv.Value);
                            w.End();
                        }
                    }
                    menuitemsAdded = true;
                    break;

                default:
                    w.Add(pi.Name, pi.GetValue(this, null));
                    break;
                }
            }
        }