private bool SyncVideoSources() { NotifyMsg(string.Format("{0}{1}......", Resources.Resource1.FrmSyncDataToStandby_Synchronizing, Resources.Resource1.FrmSyncDataToStandby_Video)); NotifyProgress(100, 0); bool success = true; CommandResult result = null; VideoSourceBll masterbll = new VideoSourceBll(AppSettings.CurrentSetting.CurrentMasterConnect); VideoSourceBll standbybll = new VideoSourceBll(AppSettings.CurrentSetting.CurrentStandbyConnect); QueryResultList <VideoSourceInfo> infos = masterbll.GetAllVideoSources(); success = infos.Result == ResultCode.Successful; if (success) { success = standbybll.DeleteAllVideos().Result == ResultCode.Successful; if (success) { NotifyProgress(infos.QueryObjects.Count, 0); foreach (VideoSourceInfo info in infos.QueryObjects) { result = standbybll.InsertWithPrimaryKey(info); success = result.Result == ResultCode.Successful; NotifyProgress(null, null); if (!success) { break; } } } } if (!success) { NotifyMsg(string.Format("{0}{1}", Resources.Resource1.FrmSyncDataToStandby_Video, Resources.Resource1.Form_Fail), Color.Red); } else { NotifyMsg(string.Format("{0}{1}", Resources.Resource1.FrmSyncDataToStandby_Video, Resources.Resource1.Form_Success)); } return(success); }
protected override CommandResult UpdateItem(object updatingItem) { VideoSourceBll bll = new VideoSourceBll(AppSettings.CurrentSetting.ParkConnect); return(bll.Update((VideoSourceInfo)updatingItem)); }
protected override CommandResult AddItem(object addingItem) { VideoSourceBll bll = new VideoSourceBll(AppSettings.CurrentSetting.ParkConnect); return(bll.Insert((VideoSourceInfo)addingItem)); }