示例#1
0
 /// <summary>
 /// @author : khoaht
 /// @createDate:28/04/2008
 /// @description : Load update
 /// </summary>
 private void LoadUpdate()
 {
     bschedule = new BSchedule();
     schedule = bschedule.GetSchedule(scheduleId);
     BClip bc = new BClip(this.clipId);
     txtClip.Text = bc.clip.Name;
     txtPrice.Text = String.Format("{0:#,###}", (Decimal)schedule.Price);
     txtFreq.Text = schedule.Freq.ToString();
     dteFromDate.Value = schedule.FromDate;
     dteToDate.Value = schedule.ToDate;
 }
示例#2
0
 /// <summary>
 /// @author : khoaht
 /// @createDate:28/04/2008
 /// @modifiedDate:28/04/2008
 /// @description : Save schedule workstation
 /// </summary>
 private void SaveScheduleWorkstations(BSchedule bsch,Schedule sch)
 {
     bool RemoveAll=true;
     if(scheduleWorkstation!=null)
     {
         for (int i = 0; i < scheduleWorkstation.Length; i++)
            if(scheduleWorkstation[i]!=null)
            {
                scheduleWorkstation[i].ScheduleId = sch.ScheduleId;
                RemoveAll=false;
            }
         bsch.AddGroupd(scheduleWorkstation);
     }
     if(RemoveAll)// Must sure the schedule of all workstations are removed
     {
        bsch.DeleteScheduleFromWorkstatoins(sch);
     }
 }
示例#3
0
 /// <summary>
 /// @author : khoaht
 /// @createDate:28/04/2008
 /// @description : Create new Schedule
 /// </summary>
 private void CreateNewSchedule()
 {
     BSchedule bSchedule = new BSchedule();
     Schedule schedule = new Schedule();
     schedule.ClipId = clipId;
     schedule.FromDate = GetDateTime(dteFromDate.Value);
     schedule.ToDate = GetDateTime(dteToDate.Value); ;
     schedule.Price = Convert.ToDecimal(txtPrice.Text.Trim());
     schedule.Freq = byte.Parse(txtFreq.Text);
     schedule.Status = 1;
     scheduleId = schedule.ScheduleId = bSchedule.Add(schedule);
     SaveScheduleWorkstations(bSchedule,schedule);
     // Add to Grid
     frmSchedule.AddToGrid(schedule);
     // Clear field
     ClearFields();
 }