예제 #1
0
 /// <summary>
 /// @author : khoaht
 /// @createDate:28/05/2008
 /// @description : Save a schedule for workstation instance
 /// </summary>
 /// <param name="workstationId"></param>
 private void SaveOneScheduleWorkstation(int workstationId)
 {
     ScheduleWorkstation swNew = new ScheduleWorkstation(scheduleId, workstationId);
     Pattern pattern = new Pattern();
     pattern.StartTime = txtStartTime.Text;
     pattern.EndTime = txtEndTime.Text;
     pattern.Weekly = GetWeeklyValue();
     pattern.Daily = GetDailyValue();
     pattern.Monthly = GetMonthlyValue();
     swNew.PatternItem = pattern;
     bschedule.Add(swNew);
 }
예제 #2
0
 /// <summary>
 /// @author : khoaht
 /// @createDate : 26/05/08
 /// @descrtiption : Load advance schedule
 /// </summary>
 /// <param name="pattern"></param>
 private void LoadAdvanceSchedule(Pattern pattern)
 {
     // txtPriority.Text = sw.Priority.ToString();
     txtStartTime.Text = pattern.StartTime;
     txtEndTime.Text = pattern.EndTime;
     // monthly
     if (!pattern.Monthly.Equals(""))
     {
         cboMonthly.Text = ((String)pattern.Monthly).Substring(0, 2);
         string temp = ((string)pattern.Monthly).Substring(2, 31);
         for (int i = 0; i < 31; i++)
             monthlyValues[i] = temp[i] == '1' ? 1 : 0;
         SetMonthButtonStatus();
     }
     // weekly
     if (!pattern.Weekly.Equals(""))
     {
         cboWeekly.Text = ((String)pattern.Weekly).Substring(0, 2);
         string temp = ((string)pattern.Weekly).Substring(2, 7);
         for (int i = 0; i < 7; i++)
             daysValue[i] = temp[i] == '1' ? 1 : 0;
             SetButtonStatus();
     }
     // Daiy
     if (!pattern.Daily.Equals(""))
         cboDaily.Text = (string)pattern.Daily;
 }
예제 #3
0
 /// <summary>
 /// @author : khoaht
 /// @createDate:28/05/2008
 /// @description : Save advance schedule
 /// </summary>
 private void SaveAdvanceSchedulePerAWorkstation()
 {
     // Save advance per workstation
     // Advance schedule
     if (listWorkstationAdded.Items.Count <= 0)
         return;
     // get workstation id
     int workstationId = (int)listWorkstationAdded.SelectedValue;
     ScheduleWorkstation swUpdate = new ScheduleWorkstation(scheduleId, workstationId);
     Pattern pattern = new Pattern();
     swUpdate.Sequence = byte.Parse(txtFreq.Text.Trim());
     swUpdate.Status = 1;
     swUpdate.Priority = Byte.Parse(txtPriority.Text);// Default
     pattern.StartTime = txtStartTime.Text;
     pattern.EndTime = txtEndTime.Text;
     pattern.Weekly = GetWeeklyValue();
     pattern.Daily = GetDailyValue();
     pattern.Monthly = GetMonthlyValue();
     swUpdate.PatternItem = pattern;
     bschedule.Update(swUpdate);
     // end advance schedule
 }
예제 #4
0
 /// <summary>
 /// @author : khoaht
 /// @createDate:28/04/2008
 /// @modified:08/2008
 /// @description : Save schedule workstation
 /// </summary>
 private void SaveScheduleWorkstations()
 {
     int index = 0;
     scheduleWorkstation = new ScheduleWorkstation[tblWorkstation.Rows.Count];
     Pattern prt = new Pattern(txtStartTime.Text, txtEndTime.Text, GetDailyValue(), GetWeeklyValue(), GetMonthlyValue());
     foreach (DataRow dr in tblWorkstation.Rows)
     {
         if ((bool)dr[STR_TICK])
         {
             scheduleWorkstation[index] = new ScheduleWorkstation();
             scheduleWorkstation[index].WorkstationId = (int)dr["WORKSTATION_ID"];
             scheduleWorkstation[index].ScheduleId = this.scheduleId;
             scheduleWorkstation[index].Sequence = byte.Parse(txtFreq.Text.Trim());
             scheduleWorkstation[index].Length = GetClipLength();
             scheduleWorkstation[index].Status = 1;// Default
             scheduleWorkstation[index].Priority = Byte.Parse(txtPriority.Text); //Default
             scheduleWorkstation[index].PatternItem = prt;
             index++;
         }
     }
     bschedule.AddGroupd(scheduleWorkstation);
 }