예제 #1
0
 private void EditDocument(DocItemView obj)
 {
     if (obj != null)
     {
         DialogHelper.ShowEditItemDialog(obj.Id);
     }
 }
예제 #2
0
        void OpenDocument(DocItemView itemView)
        {
            DocItem item = null;

            using (var db = new AppDataBase())
            {
                item = (from i in db.Items
                        where i.DocItemId == itemView.Id
                       select i).First();
            }

            if (item != null)
            {
                if (Storage.Default.IsFileExist(item) == false)
                {
                    string fileName = Storage.Default.GetFullPath(item);

                    WindowAsyncOperation.RunAsync(Properties.Resources.MsgDownload, (ReportProgress progress) =>
                    {
                        WebDownload d = new WebDownload(item.Uri, progress);
                        d.Save(fileName);
                    });
                }

                Storage.Default.OpenFile(item);
            }
        }
예제 #3
0
        private void ChangeRateImpl(DocItemView obj)
        {
            if (obj != null)
            {
                using(var db = new AppDataBase())
                {
                    var item = (from i in db.Items
                                where i.DocItemId == obj.Id
                               select i).Single();

                    item.Rating = obj.Rating;

                    db.SaveChanges();
                }
            }
        }