private void BrowsePSD_Click(object sender, RoutedEventArgs e) { OpenFileDialog openfile = new OpenFileDialog() { Multiselect = false, DefaultExt = ".psd", Filter = "PhotoShop File (.psd)|*.psd" }; bool?result = openfile.ShowDialog(); if (result == true) { addedPSD = new PSD(new FileInfo(openfile.FileName)); BrowsedPSD.Text = openfile.FileName; } }
public static bool CheckPSD( PSD.File psd ) { if ( psd == null ) return false; if ( !psd.Layers.Contains( Boot.ShadingLayerName ) ) { Console.WriteLine( "Error: The shading layer is missing." ); return false; } if ( !psd.Layers.Contains( Boot.IDLayerName ) ) { Console.WriteLine( "Error: The id layer is missing." ); return false; } if ( !psd.Layers.Contains( Boot.BorderLayerName ) ) { Console.WriteLine( "Error: The borders layer is missing." ); return false; } return true; }
public static void GetBuffers( PSD.File psd, out int[] colorbuffer, out int[] idbuffer, out int[] borderbuffer ) { psd.Layers.HideAll(); psd.Layers[Boot.ShadingLayerName].Visible = true; psd.Layers[Boot.ShadingLayerName].OpacityF = 1; psd.Layers[Boot.ShadingLayerName].Mode = PSD.LayerMode.Normal; colorbuffer = Visualiser.CreateBuffer32( psd.Layers.CreateFlattenedImage() ); psd.Layers[Boot.ShadingLayerName].Visible = false; psd.Layers[Boot.IDLayerName].Visible = true; psd.Layers[Boot.IDLayerName].OpacityF = 1; psd.Layers[Boot.IDLayerName].Mode = PSD.LayerMode.Normal; idbuffer = Visualiser.CreateBuffer32( psd.Layers.CreateFlattenedImage() ); psd.Layers[Boot.IDLayerName].Visible = false; psd.Layers[Boot.BorderLayerName].Visible = true; psd.Layers[Boot.BorderLayerName].OpacityF = 1; psd.Layers[Boot.BorderLayerName].Mode = PSD.LayerMode.Normal; borderbuffer = Visualiser.CreateBuffer32( psd.Layers.CreateFlattenedImage() ); }
private async void ExecuteSave(object obj) { try { if (!VSales.TRNMODE && string.IsNullOrEmpty(VSales.BillTo)) { MessageBox.Show("Customer Name cannot be empty in Credit Sales.", MessageBoxCaption, MessageBoxButton.OK, MessageBoxImage.Exclamation); return; } else if (VSDetailList.Count == 0) { MessageBox.Show("Please add atleast one Voucher Type.", MessageBoxCaption, MessageBoxButton.OK, MessageBoxImage.Exclamation); return; } if (MessageBox.Show("You are going to save current transation. Do you want to proceed?", MessageBoxCaption, MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.No) { return; } ParkingVouchers = new List <Voucher>(); using (SqlConnection conn = new SqlConnection(GlobalClass.TConnectionString)) { conn.Open(); using (SqlTransaction tran = conn.BeginTransaction()) { VSales.TDate = CurDate; VSales.TTime = CurTime; VSales.UID = GlobalClass.User.UID; VSales.SESSION_ID = GlobalClass.Session; VSales.TMiti = nepDate.CBSDate(CurDate); VSales.BillNo = InvoicePrefix + GetInvoiceNo(InvoicePrefix); VSales.FYID = GlobalClass.FYID; VSales.Save(tran); foreach (TParkingSalesDetails PSD in VSDetailList) { PSD.BillNo = VSales.BillNo; PSD.FYID = VSales.FYID; PSD.Save(tran); } conn.Execute("UPDATE tblSequence SET CurNo = CurNo + 1 WHERE VNAME = @VNAME AND FYID = @FYID", new { VNAME = InvoicePrefix, FYID = GlobalClass.FYID }, transaction: tran); GlobalClass.SetUserActivityLog("Voucher Sales Invoice", "New", VCRHNO: VSales.BillNo, WorkDetail: "Bill No : " + VSales.BillNo); SyncFunctions.LogSyncStatus(tran, VSales.BillNo, GlobalClass.FYNAME); if (GenerateVoucher) { vp = new wVoucherPrintProgress() { DataContext = this }; vp.Show(); await GenerateVouchers(tran); vp.Hide(); } tran.Commit(); if (!string.IsNullOrEmpty(SyncFunctions.username)) { SyncFunctions.SyncSalesData(SyncFunctions.getBillObject(VSales.BillNo), 1); } MessageBox.Show("Vouchers Generated Successfully", MessageBoxCaption, MessageBoxButton.OK, MessageBoxImage.Information); if (!(string.IsNullOrEmpty(VSales.BillTo) || CustomerList.Any(x => x.Name == VSales.BillTo))) { CustomerList.Add(new Party { Name = VSales.BillTo, Address = VSales.BILLTOADD, PAN = VSales.BILLTOPAN }); } } if (!string.IsNullOrEmpty(VSales.BillNo)) { PrintBill(VSales.BillNo, true); if (GenerateVoucher) { vp.Show(); await PrintVouchers(VSales.BillNo, true); vp.Close(); } } //GenerateVouchers(); ExecuteUndo(null); } } catch (Exception ex) { MessageBox.Show(ex.Message, MessageBoxCaption, MessageBoxButton.OK, MessageBoxImage.Error); } }