示例#1
0
 public CommandResult Update(Holiday info)
 {
     Holiday original = ProviderFactory.Create<IHolidayProvider>(_RepoUri).GetByID(info.ID).QueryObject;
     if (original != null)
     {
         return ProviderFactory.Create<IHolidayProvider>(_RepoUri).Update(info, original);
     }
     else
     {
         return new CommandResult(ResultCode.NoRecord, ResultCodeDecription.GetDescription(ResultCode.NoRecord));
     }
 }
示例#2
0
 public CommandResult Add(Holiday info)
 {
     string id = ProviderFactory.Create<IStringIDCreater>(_RepoUri).CreateID("H", 3, "Holiday");
     if (!string.IsNullOrEmpty(id))
     {
         info.ID = id;
         return ProviderFactory.Create<IHolidayProvider>(_RepoUri).Insert(info);
     }
     else
     {
         return new CommandResult(ResultCode.Fail, "创建ID失败");
     }
 }
示例#3
0
 public CommandResult Delete(Holiday info)
 {
     return ProviderFactory.Create<IHolidayProvider>(_RepoUri).Delete(info);
 }
 protected override Object GetItemFromInput()
 {
     Holiday info;
     if (UpdatingItem == null)
     {
         info = new Holiday();
     }
     else
     {
         info = UpdatingItem as Holiday;
     }
     info.StartDate = this.dtStartDate.Value.Date;
     info.EndDate = this.dtEndDate.Value.Date;
     info.Memo = this.txtMemo.Text;
     info.WeekendToWorkDay1 = null;
     info.WeekendToWorkDay2 = null;
     info.WeekendToWorkDay3 = null;
     info.WeekendToWorkDay4 = null;
     info.WeekendToWorkDay5 = null;
     info.WeekendToWorkDay6 = null;
     if (checkBox1.Checked) info.WeekendToWorkDay1 = dtWorkday1.Value;
     if (checkBox2.Checked) info.WeekendToWorkDay2 = dtWorkday2.Value;
     if (checkBox3.Checked) info.WeekendToWorkDay3 = dtWorkday3.Value;
     if (checkBox4.Checked) info.WeekendToWorkDay4 = dtWorkday4.Value;
     if (checkBox5.Checked) info.WeekendToWorkDay5 = dtWorkday5.Value;
     if (checkBox6.Checked) info.WeekendToWorkDay6 = dtWorkday6.Value;
     return info;
 }