Ejemplo n.º 1
0
		public static void DeleteReceipt(ReceiptTemplate receipt)
		{
			var filePath = Path.Combine(DirectoryPath, receipt.Uid.ToString());
			if (File.Exists(filePath))
				File.Delete(filePath);
			DbCache.DeleteReceiptByUid(receipt.Uid);
		}
Ejemplo n.º 2
0
		public static ReceiptTemplate GetDefaultTemplate()
		{
			var template = new ReceiptTemplate() 
			{ 
				Name = "По умолчанию",
 				Uid = Guid.Parse(DefaultTemplateUid)
			};
			return template;
		}
Ejemplo n.º 3
0
		public static void SaveReceipt(ReceiptTemplate receipt)
		{
			var filePath = Path.Combine(DirectoryPath, receipt.Uid.ToString());
			receipt.SaveLayout(filePath);
			DbCache.SaveReceipt(new Receipt
			{
				Name = receipt.Name,
				UID = receipt.Uid,
				Description = receipt.Description,
				Template = File.ReadAllBytes(filePath)
			});

		}
Ejemplo n.º 4
0
		public static void OpenDocument(ReceiptTemplate receipt)
		{
			Current.designer.OpenDocument(receipt);
		}
Ejemplo n.º 5
0
		void OnAddReceipt()
		{
			var newReceipt = new ReceiptTemplate
			{
				Name = "Новый шаблон",
				Uid = Guid.NewGuid()
			};
			Receipts.Add(newReceipt);
			Receipts = RewriteReceipts(Receipts);
			SelectedReceipt = Receipts.Find(x => x == newReceipt);
			isNewReceipt = true;
		}