private void btnCreate_Click(object sender, EventArgs e) { if (validateForm() && saveInventory()) { MessageBoxHandler.openBox("Inventory Saved", "Success", MessageBoxIcon.Information); } }
private void btnSave_Click(object sender, EventArgs e) { if (validateCustomer() && saveCustomer()) { MessageBoxHandler.openBox("Success", "Custoemr saved", MessageBoxIcon.Information); } }
public static void ShowMessageBox(string content, string title, Action actionAfterConfirmation = null) { if (MainGameHandler.SceneManagerInstance == null) { return; } try { GameObject canvas = FindCanvas(); GameObject messageBoxPrefab = (GameObject)Resources.Load("Prefabs/UI/MessageBox/MessageBox", typeof(GameObject)); if (canvas == null || messageBoxPrefab == null) { Debug.Log("ShowMessageBox() - cannot find canvas or message box prefab!"); return; } GameObject newMsgBoxInstance = MainGameHandler.SceneManagerInstance.InstantiateExternally(messageBoxPrefab, canvas.transform); MessageBoxHandler handler = newMsgBoxInstance.GetComponent <MessageBoxHandler>(); handler.Set(content, title, actionAfterConfirmation); } catch (Exception exception) { Debug.Log($"ShowMessageBox(): {exception.Message}"); } }
/// <summary> /// Processes this response /// </summary> /// <returns></returns> public override async Task <ControllerResponseResult> Process() { var handler = new MessageBoxHandler(TemplateFactory, StringTableManager, DataCollector); await ResponseWriter.WriteAsync(handler.GetInline(Text, Status), Context.Response); return(ControllerResponseResult.RawOutput); }
/// <summary> /// Processes this response /// </summary> /// <returns></returns> public override Task <ControllerResponseResult> Process() { Context.Response.StatusCode = StatusCode; var handler = new MessageBoxHandler(TemplateFactory, StringTableManager, DataCollector); handler.Show(Text, Status, Title); return(Task.FromResult(ControllerResponseResult.Default)); }
private void Awake() { if (boxHandler == null) { boxHandler = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } }
private void btnSaveSales_Click(object sender, EventArgs e) { try { if (validateSales() && sale.save()) { MessageBoxHandler.openBox("Sales Saved", "Success", MessageBoxIcon.Information); } } catch (Exception err) { MessageBoxHandler.openBox("Error", err.ToString(), MessageBoxIcon.Error); } }
public bool Init(string logFilePath, MessageBoxHandler mbh, ConfirmBoxHandler ch) { try { LogFile = new StreamWriter(logFilePath, false, Encoding.UTF8); } catch (Exception) { return(false); } MsgBoxHandler = mbh; ConfirmHandler = ch; ucore.Log.Receivers += Log; ucore.Log.ExceptionReceivers += LogExceptionDetail; return(true); }
public bool save() { try { string query = "INSERT sale("; query += "transaction_number,"; query += "invoicenumber,"; query += "official_receipt,"; query += "customer_id,"; query += "date,"; query += "total_gross)"; query += "VALUES("; query += "@transaction_number,"; query += "@invoicenumber,"; query += "@official_receipt,"; query += "@customer_id,"; query += "@date,"; query += "@total_gross)"; dbHandler.setParameters("@invoicenumber", invoiceNumber); dbHandler.setParameters("@transaction_number", transactionNumber); dbHandler.setParameters("@official_receipt", officialReceipt); dbHandler.setParameters("@customer_id", customerId); dbHandler.setParameters("@date", date); dbHandler.setParameters("@total_gross", totalGross); var result = dbHandler.Insert(query); if (result is long) { Console.WriteLine("Result is " + result); return(true); } else { throw new Exception(result); } } catch (Exception err) { MessageBoxHandler.openBox("Error", err.ToString()); return(false); } }
static void Main() { #if false Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); #endif string filename = @"F:\COR\DMS\POST_0020_GE01_OG01_0000 - Kopie.dxf"; MessageBoxHandler.CloseNextMessageBoxByTitle("Wout Ware trial"); // Annoying WW.Cad.Model.DxfModel model = null; model = WW.Cad.IO.DxfReader.Read(filename); // System.Console.WriteLine(model.UnsupportedObjects.Count); for (int i = model.Layers.Count - 1; i >= 0; --i) { System.Console.WriteLine(model.Layers[i].Name); // if (string.Equals(model.Layers[i].Name, "0", System.StringComparison.InvariantCultureIgnoreCase)) { continue; } // if (string.Equals(model.Layers[i].Name, "Grundriss", System.StringComparison.InvariantCultureIgnoreCase)) if (string.Equals(model.Layers[i].Name, "Raumpolygon", System.StringComparison.InvariantCultureIgnoreCase)) { model.Layers[i].Enabled = true; continue; } model.Layers[i].Enabled = false; // continue; for (int j = model.Entities.Count - 1; j >= 0; --j) { if (model.Entities[j].Layer == model.Layers[i]) { // System.Console.WriteLine(model.Entities[j].Layer.Name); // System.Console.WriteLine(model.Layers[i].Name); model.Entities.RemoveAt(j); } // End if (model.Entities[j].Layer == model.Layers[i]) } // Next j model.Layers.RemoveAt(i); } // Next i System.Collections.Generic.List <WW.Cad.Base.DxfMessage> ls = new System.Collections.Generic.List <WW.Cad.Base.DxfMessage>(); model.Repair(ls); // System.Console.WriteLine(model.Layers[1].Name); // WW.Cad.Model.Tables.DxfLayer layer = model.Layers[1]; // layer.Enabled = false; // WW.Cad.Example.LayerExtractorVisitor layerExtractorVisitor = new WW.Cad.Example.LayerExtractorVisitor(); // layerExtractorVisitor.Run(model, layer); using (System.IO.FileStream fs = new System.IO.FileStream("oneLayer.dxf", System.IO.FileMode.Create, System.IO.FileAccess.Write, System.IO.FileShare.None)) { WW.Cad.IO.DxfWriter dxfwriter = new WW.Cad.IO.DxfWriter(fs, model, false); dxfwriter.Write(); // fs.Flush(); // fs.Close(); } // End Using fs System.Console.WriteLine(System.Environment.NewLine); System.Console.WriteLine(" --- Press any key to continue --- "); System.Console.ReadKey(); } // End Sub Main