Exemplo n.º 1
0
 /// <summary>勤務シフトのインポート
 /// </summary>
 /// <param name="pattern">インポートする勤務シフト</param>
 /// <returns>成功:追加したエレメント/不成功:null</returns>
 private CPattern ImportPattern(CPattern pattern)
 {
     #region 重複チェック
     CPatternCollection col = Target.Patterns;
     if (col.GetByName(pattern.Name) != null)
     {
         return(null);
     }
     if (col.Size() >= FMainForm.MaxItemCount)
     {
         return(null);
     }
     #endregion
     #region インポート
     CPattern newpattern = col.CreatePattern(true);
     newpattern.Name  = pattern.Name;
     newpattern.Start = pattern.Start;
     newpattern.Scope = pattern.Scope;
     newpattern.Rest  = pattern.Rest;
     newpattern.Notes = pattern.Notes + "\nインポートされました。";
     foreach (string key in pattern.properties.AllKeys)
     {
         newpattern[key] = pattern[key];
     }
     #endregion
     col.AddPattern(newpattern);
     // 終端
     return(newpattern);
 }
Exemplo n.º 2
0
 /// <summary>勤務シフトの数
 /// </summary>
 /// <returns>勤務シフトの数</returns>
 public virtual int Size()
 {
     return(patternList.Size());
 }
Exemplo n.º 3
0
        /// <summary>メンバーからコンポーネントへ
        /// </summary>
        private void Member2Components()
        {
            this.NumPriority.Value  = Member.Priority;                          // 優先度
            this.TxtMemberName.Text = Member.Name;                              // 名前
            try {
                // 期待される作業時間
                this.TxtWorkTime.Value = this.TxtWorkTime.MinDate + Member.ExpectedWork;
            } catch { }
            try {
                // 期待される休憩時間
                this.TxtRest.Text = Member.ExpectedRest.ToString("000.000");
            } catch { }
            this.ChkChief.Checked = Member.IsChief;                             // チーフですか?
            // 作成日
            if (Member.Created > this.txtCreated.MinDate)
            {
                this.txtCreated.Value = Member.Created.Date;
            }
            else
            {
                this.txtCreated.Value = System.DateTime.Today;
            }
            // 削除日
            if (Member.Removed != null)
            {
                this.txtRemoved.Value = (DateTime)Member.Removed;
            }
            else
            {
                this.txtRemoved.Value = this.txtRemoved.MaxDate;
            }
            // シフトの一覧
            this.TblPatterns.Clear();
            CTimeTable         timetable = Member.TimeTable;
            CPatternCollection patterns  = timetable.Patterns;

            for (int i = 0; i < patterns.Size(); i++)
            {
                CPattern pattern = patterns[i];
                if (!pattern.BuiltIn)
                {
                    System.Data.DataRow row = this.TblPatterns.NewRow();
                    row["ClmPattern"]     = pattern;
                    row["ClmPatternName"] = pattern.Name;
                    this.TblPatterns.Rows.Add(row);
                }
            }
            // シフトの選択状況
            this.LstPatterns.ClearSelected();
            for (int i = 0; i < this.TblPatterns.Rows.Count; i++)
            {
                System.Data.DataRow row     = this.TblPatterns.Rows[i];
                CPattern            pattern = row["ClmPattern"] as CPattern;
                if (Member.Contains(pattern))
                {
                    this.LstPatterns.SetItemChecked(i, true);
                }
                else
                {
                    this.LstPatterns.SetItemChecked(i, false);
                }
            }
            // 稼働日
            chkMonday.Checked    = Member.IsAvailableDay(CTimeTable.tMonday);
            chkTuesday.Checked   = Member.IsAvailableDay(CTimeTable.tTuesday);
            chkWednesday.Checked = Member.IsAvailableDay(CTimeTable.tWednesday);
            chkThursday.Checked  = Member.IsAvailableDay(CTimeTable.tThursday);
            chkFriday.Checked    = Member.IsAvailableDay(CTimeTable.tFriday);
            chkSaturday.Checked  = Member.IsAvailableDay(CTimeTable.tSaturday);
            chkSunday.Checked    = Member.IsAvailableDay(CTimeTable.tSunday);
            // めも
            txtNotes.Text = Member.Notes;
            // 稼動間隔
            dtpSpace.Value = dtpSpace.MinDate + Member.Spacetime;
            // 連続稼働日
            numContinuas.Value = Member.ContinuasInt;
        }