Exemplo n.º 1
0
        /// <summary>メンバーのセーブ
        /// </summary>
        public XmlElement SaveMembers(XmlDocument doc, CTimeTable all)
        {
            XmlElement element = doc.CreateElement("members");

            SaveTmElement(doc, element, all.Members);
            for (int i = 0; i < all.Members.Size(true); i++)
            {
                CMember    member = all.Members[i, true];
                XmlElement pNode  = doc.CreateElement("member");
                SaveTmElement(doc, pNode, member);
                pNode.SetAttribute("name", member.Name);
                pNode.SetAttribute("chief", member.IsChief.ToString());
                pNode.SetAttribute("expectedwork", member.ExpectedWork.ToString());
                pNode.SetAttribute("expectedrest", member.ExpectedRest.ToString());
                pNode.SetAttribute("priority", member.Priority.ToString());
                //
                for (int j = 0; j < member.PatternSize; j++)
                {
                    CPattern   pattern = member[j];
                    XmlElement nNode   = doc.CreateElement("pattern");
                    nNode.SetAttribute("id", pattern.ObjectID.ToString());
                    pNode.AppendChild(nNode);
                }
                #region 稼働日
                pNode.SetAttribute("avl-monday", member.IsAvailableDay(CTimeTable.tMonday).ToString());
                pNode.SetAttribute("avl-tuesday", member.IsAvailableDay(CTimeTable.tTuesday).ToString());
                pNode.SetAttribute("avl-wednesday", member.IsAvailableDay(CTimeTable.tWednesday).ToString());
                pNode.SetAttribute("avl-thursday", member.IsAvailableDay(CTimeTable.tThursday).ToString());
                pNode.SetAttribute("avl-friday", member.IsAvailableDay(CTimeTable.tFriday).ToString());
                pNode.SetAttribute("avl-saturday", member.IsAvailableDay(CTimeTable.tSaturday).ToString());
                pNode.SetAttribute("avl-sunday", member.IsAvailableDay(CTimeTable.tSunday).ToString());
                #endregion
                #region 連続稼働日数と空白時間
                pNode.SetAttribute("continuas", member.Continuas.ToString());
                pNode.SetAttribute("spacetime", member.Spacetime.ToString());
                #endregion
                //
                element.AppendChild(pNode);
            }
            return(element);
        }
Exemplo n.º 2
0
 /// <summary>メンバーのインポート
 /// </summary>
 /// <param name="member">インポートするメンバー</param>
 /// <returns>成功:追加したエレメント/不成功:null</returns>
 private CMember ImportMember(CMember member)
 {
     #region 重複チェック
     CMemberCollection col = Target.Members;
     if (col.GetByName(member.Name) != null)
     {
         return(null);
     }
     if (col.Size() >= FMainForm.MaxItemCount)
     {
         return(null);
     }
     #endregion
     #region インポート
     CMember newmember = col.CreateMember(true);
     newmember.Name    = member.Name;
     newmember.IsChief = member.IsChief;
     newmember.SetAvailableDay(CTimeTable.tMonday, member.IsAvailableDay(CTimeTable.tMonday));
     newmember.SetAvailableDay(CTimeTable.tTuesday, member.IsAvailableDay(CTimeTable.tTuesday));
     newmember.SetAvailableDay(CTimeTable.tWednesday, member.IsAvailableDay(CTimeTable.tWednesday));
     newmember.SetAvailableDay(CTimeTable.tThursday, member.IsAvailableDay(CTimeTable.tThursday));
     newmember.SetAvailableDay(CTimeTable.tFriday, member.IsAvailableDay(CTimeTable.tFriday));
     newmember.SetAvailableDay(CTimeTable.tSaturday, member.IsAvailableDay(CTimeTable.tSaturday));
     newmember.SetAvailableDay(CTimeTable.tSunday, member.IsAvailableDay(CTimeTable.tSunday));
     newmember.Spacetime = member.Spacetime;
     newmember.Continuas = member.Continuas;
     newmember.Notes     = member.Notes + "\nインポートされました。";
     foreach (string key in member.properties.AllKeys)
     {
         newmember[key] = member[key];
     }
     #endregion
     col.AddMember(newmember);
     // 終端
     return(newmember);
 }