public SaveBusinessClosedDayRequest(AppClosedDay item)
 {
     BusinessClosedDay newItem = new BusinessClosedDay();
     newItem.Id = Guid.Parse(item.UniqueId);
     newItem.Subject = item.Subject;
     newItem.IsNew = item.IsNew;
     newItem.IsDirty = item.IsDirty;
     newItem.IsAllDayEvent = item.IsAllDayEvent;
     newItem.Start = item.IsAllDayEvent ? DateEx.GetStartOfDay(item.Start) : item.Start;
     newItem.End = item.IsAllDayEvent ? DateEx.GetEndOfDay(item.End) : item.End;
     newItem.TypeId = item.TypeId;
     if (item.RecurrenceRule.IsNotNull()) {
         newItem.RecurrencePattern = RecurrencePatternHelper.RecurrencePatternToString(item.RecurrenceRule.Pattern);
     }
     newItem.RecurrencePatternExt = item.RecurrenceRuleExt;
     this.item = newItem;
 }
Пример #2
0
 public IAsyncResult BeginSaveBusinessClosedDay(BusinessClosedDay item, Identification identification, AsyncCallback callback, object state)
 {
     logger.Log(LogLevel.Trace, AppLib.GetCaller(logger));
     if (AppLib.VerifyToken(identification.Token) <= 0) {
         throw new FaultException<ServiceFault>(new ServiceFault("Invalid Authentication", "Authorization"), new FaultReason("Unauthorized"));
     }
     var task = Task<int>.Factory.StartNew(process => DoSaveBusinessClosedDay(identification, item), state);
     return task.ContinueWith(res => callback(task));
 }
 public SaveBusinessClosedDayRequest(BusinessClosedDay item)
 {
     this.item = item;
 }
Пример #4
0
 public int DoSaveBusinessClosedDay(Identification identification, BusinessClosedDay item)
 {
     logger.Log(LogLevel.Trace, AppLib.GetCaller(logger));
     using (SystemDAO dao = new SystemDAO()) {
         return dao.SaveBusinessClosedDayRecord(item, identification.Token, identification.UserId);
     }
 }