本文整理汇总了C#中Dialog.ShowAll方法的典型用法代码示例。如果您正苦于以下问题:C# Dialog.ShowAll方法的具体用法?C# Dialog.ShowAll怎么用?C# Dialog.ShowAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dialog
的用法示例。
在下文中一共展示了Dialog.ShowAll方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnButtonIngresarClicked
protected void OnButtonIngresarClicked(object sender, EventArgs e)
{
ControladorBaseDatos Bd = new ControladorBaseDatos();
string[] usuarioClave = new string[2];
usuarioClave = Bd.ObtenerUsuarioContraseñaBd(entryUsuario.Text);
if(usuarioClave[0].Equals(entryUsuario.Text) & usuarioClave[1].Equals(entryClave.Text))
{
//PrincipalWindow principal = new PrincipalWindow(entryUsuario.Text);
VenderProductosDialog principal = new VenderProductosDialog(entryUsuario.Text);
base.Destroy();
principal.Show();
}
else
{
Dialog dialog = new Dialog("Iniciar Sesion", this, Gtk.DialogFlags.DestroyWithParent);
dialog.Modal = true;
dialog.Resizable = false;
Gtk.Label etiqueta = new Gtk.Label();
etiqueta.Markup = "Usuario/Clave incorrectos";
dialog.BorderWidth = 8;
dialog.VBox.BorderWidth = 8;
dialog.VBox.PackStart(etiqueta, false, false, 0);
dialog.AddButton ("Cerrar", ResponseType.Close);
dialog.ShowAll();
dialog.Run ();
dialog.Destroy ();
}
}
示例2: OnButtonEditarNumBoletaClicked
protected void OnButtonEditarNumBoletaClicked(object sender, EventArgs e)
{
numBoleta = this.db.ObtenerBoleta ();
if (Int32.Parse (entryNumBoleta.Text.Trim ()) > numBoleta) {
try {
Venta nuevaVenta = new Venta (Int32.Parse (entryNumBoleta.Text.Trim ()), DateTime.Now.ToString ("yyyy-MM-dd"), "0", "inicioBoletaNueva", Int32.Parse ("0"), usuario_, "false");
db.AgregarVentaBd (nuevaVenta);
entryNumBoleta.Text = "";
Dialog dialog = new Dialog ("EDITAR BOLETA", this, Gtk.DialogFlags.DestroyWithParent);
dialog.Modal = true;
dialog.Resizable = false;
Gtk.Label etiqueta = new Gtk.Label ();
etiqueta.Markup = "La operación ha sido realizada con éxito";
dialog.BorderWidth = 8;
dialog.VBox.BorderWidth = 8;
dialog.VBox.PackStart (etiqueta, false, false, 0);
dialog.AddButton ("Cerrar", ResponseType.Close);
dialog.ShowAll ();
dialog.Run ();
dialog.Destroy ();
} catch (Exception ex) {
Dialog dialog = new Dialog ("EDITAR BOLETA", this, Gtk.DialogFlags.DestroyWithParent);
dialog.Modal = true;
dialog.Resizable = false;
Gtk.Label etiqueta = new Gtk.Label ();
etiqueta.Markup = "Ha ocurrido un error al editar boleta";
dialog.BorderWidth = 8;
dialog.VBox.BorderWidth = 8;
dialog.VBox.PackStart (etiqueta, false, false, 0);
dialog.AddButton ("Cerrar", ResponseType.Close);
dialog.ShowAll ();
dialog.Run ();
dialog.Destroy ();
Console.WriteLine ("error editar boleta: " + ex);
}
} else {
Dialog dialog = new Dialog ("EDITAR BOLETA", this, Gtk.DialogFlags.DestroyWithParent);
dialog.Modal = true;
dialog.Resizable = false;
Gtk.Label etiqueta = new Gtk.Label ();
etiqueta.Markup = "La boleta ingresada es menor a la del sistema";
dialog.BorderWidth = 8;
dialog.VBox.BorderWidth = 8;
dialog.VBox.PackStart (etiqueta, false, false, 0);
dialog.AddButton ("Cerrar", ResponseType.Close);
dialog.ShowAll ();
dialog.Run ();
dialog.Destroy ();
}
}
示例3: compileButton_Clicked
private void compileButton_Clicked(object sender, EventArgs e)
{
try
{
softwareModel = new SoftwareModel (openTextBox.Text, softwareModelLoaded);
}
catch (Exception ex)
{
var dlg = new Dialog("Error", this, DialogFlags.Modal, ResponseType.Ok);
dlg.VBox.Add (new Label (ex.Message));
dlg.ShowAll ();
dlg.Run();
dlg.Destroy();
}
}
示例4: OnButtonIngresarDineroClicked
protected void OnButtonIngresarDineroClicked(object sender, EventArgs e)
{
ControladorBaseDatos baseDatos = new ControladorBaseDatos();
try {
int boleta = baseDatos.ObtenerBoleta();
Venta nVenta = new Venta(boleta,
DateTime.Now.ToString("yyyy-MM-dd"),
entryMontoDinero.Text.Trim(),
"IngresoDineroCaja",
Int32.Parse("0"),
usuario_,
"false");
baseDatos.AgregarVentaBd(nVenta);
entryMontoDinero.Text = "";
Dialog dialog = new Dialog("INGRESAR MONTO DINERO", this, Gtk.DialogFlags.DestroyWithParent);
dialog.Modal = true;
dialog.Resizable = false;
Gtk.Label etiqueta = new Gtk.Label();
etiqueta.Markup = "La operación ha sido realizada con éxito";
dialog.BorderWidth = 8;
dialog.VBox.BorderWidth = 8;
dialog.VBox.PackStart(etiqueta, false, false, 0);
dialog.AddButton ("Cerrar", ResponseType.Close);
dialog.ShowAll();
dialog.Run ();
dialog.Destroy ();
}
catch (Exception ex)
{
Dialog dialog = new Dialog("INGRESAR MONTO DINERO", this, Gtk.DialogFlags.DestroyWithParent);
dialog.Modal = true;
dialog.Resizable = false;
Gtk.Label etiqueta = new Gtk.Label();
etiqueta.Markup = "Ha ocurrido un error al ingresar monto dinero";
dialog.BorderWidth = 8;
dialog.VBox.BorderWidth = 8;
dialog.VBox.PackStart(etiqueta, false, false, 0);
dialog.AddButton ("Cerrar", ResponseType.Close);
dialog.ShowAll();
dialog.Run ();
dialog.Destroy ();
Console.WriteLine("error ingresar monto: "+ex);
}
}
示例5: ShowMessage
void ShowMessage (Window parent, string title, string message)
{
Dialog dialog = null;
try {
dialog = new Dialog (title, parent,
DialogFlags.DestroyWithParent | DialogFlags.Modal,
ResponseType.Ok);
dialog.VBox.Add (new Label (message));
dialog.ShowAll ();
dialog.Run ();
} finally {
if (dialog != null)
dialog.Destroy ();
}
}
示例6: EditarNumBoletaDialog
public EditarNumBoletaDialog(string usuario)
{
this.usuario_ = usuario;
this.Build ();
numBoleta = this.db.ObtenerBoleta () - 1;
Dialog dialog = new Dialog ("EDITAR BOLETA", this, Gtk.DialogFlags.DestroyWithParent);
dialog.Modal = true;
dialog.Resizable = false;
Gtk.Label etiqueta = new Gtk.Label ();
etiqueta.Markup = "Número de boleta actual: "+numBoleta.ToString();
dialog.BorderWidth = 8;
dialog.VBox.BorderWidth = 8;
dialog.VBox.PackStart (etiqueta, false, false, 0);
dialog.AddButton ("Cerrar", ResponseType.Close);
dialog.ShowAll ();
dialog.Run ();
dialog.Destroy ();
}
示例7: AssignKey
protected void AssignKey(){
KeyNode selectedKeyNode = (KeyNode) commandNodeView.NodeSelection.SelectedNode;
String s = "Select the key to associate with\n\"" + selectedKeyNode.CommandString + "\"\nPress ESC to cancel";
Gtk.Label label = new Gtk.Label(s);
label.Justify = Justification.Center;
label.HeightRequest = 70;
Dialog dialog = new Dialog ("Assign a key", this, Gtk.DialogFlags.DestroyWithParent);
dialog.TypeHint = WindowTypeHint.Splashscreen;
dialog.Modal = true;
dialog.VBox.Add (label);
dialog.HasSeparator = false;
dialog.KeyPressEvent += delegate(object o, Gtk.KeyPressEventArgs args) {
bool alreadyAssigned = false;
string keyAssigned = "";
if(args.Event.KeyValue != (uint)Gdk.Key.Escape){
foreach (KeyNode node in keyNodeStore){
if(node.Key == (Gdk.Key)args.Event.KeyValue){
alreadyAssigned = true;
keyAssigned = node.CommandString;
break;
}
}
if(!alreadyAssigned){
selectedKeyNode.Key = (Gdk.Key)args.Event.KeyValue;
SaveKeyCommand(selectedKeyNode.KeyCommand, selectedKeyNode.Key);
}
else{
label.Text = "Key already assigned to \n\"" + keyAssigned + "\"";
}
}
if(!alreadyAssigned){
Gtk.Application.Invoke (delegate {
dialog.Destroy();
});
}
else{
Timer timer = new Timer(1500);
timer.Elapsed += delegate {
label.Text = s;
timer.Stop();
};
timer.Start();
}
};
Gtk.Application.Invoke (delegate {
dialog.ShowAll();
});
}
示例8: OnActualizarButtonClicked
protected virtual void OnActualizarButtonClicked(object sender, System.EventArgs e)
{
Gtk.TreeIter iter;
this.FamiliaProductosTreeview.Selection.GetSelected(out iter);
FamiliaProducto familia_vieja = new FamiliaProducto(this.familiaModel.GetValue(iter, 0).ToString());
FamiliaProducto familia_nueva = new FamiliaProducto(entryFamilia.Text.Trim());
if (!this.db.ExisteFamiliaBd(familia_vieja))
{
Dialog dialog = new Dialog("No se pudo actualizar la familia", this, Gtk.DialogFlags.DestroyWithParent);
dialog.Modal = true;
dialog.Resizable = false;
Gtk.Label etiqueta = new Gtk.Label();
etiqueta.Markup = "No se pudo actualizar la familia porque no existe una en la base de datos.\nIntente recargar la lista de familias.";
dialog.BorderWidth = 8;
dialog.VBox.BorderWidth = 8;
dialog.VBox.PackStart(etiqueta, false, false, 0);
dialog.AddButton ("Cerrar", ResponseType.Close);
dialog.ShowAll();
dialog.Run ();
dialog.Destroy ();
}
else
{
if (this.db.ActualizarFamilia(familia_vieja, familia_nueva))
{
this.familias.RemoveAt(this.familiaModel.GetPath(iter).Indices[0]);
this.familias.Insert(this.familiaModel.GetPath(iter).Indices[0], familia_nueva);
this.familiaModel.SetValue(iter, 0, familia_nueva.Nombre);
this.entryFamilia.Text = "";
this.quitar_button.Sensitive = false;
this.actualizar_button.Sensitive = false;
this.FamiliaProductosTreeview.Selection.UnselectAll();
//Console.WriteLine("Actualizado");
this.cambiado = true;
}
else
{
Dialog dialog = new Dialog("No se pudo actualizar la familia", this, Gtk.DialogFlags.DestroyWithParent);
dialog.Modal = true;
dialog.Resizable = false;
Gtk.Label etiqueta = new Gtk.Label();
etiqueta.Markup = "No se pudo actualizar la familia, ha ocurrido un error al actualizar en la base de datos.";
dialog.BorderWidth = 8;
dialog.VBox.BorderWidth = 8;
dialog.VBox.PackStart(etiqueta, false, false, 0);
dialog.AddButton ("Cerrar", ResponseType.Close);
dialog.ShowAll();
dialog.Run ();
dialog.Destroy ();
}
}
}
示例9: OnStartStreamButtonClicked
protected void OnStartStreamButtonClicked (object sender, EventArgs e)
{
bool vlcError = false;
if(rtspTunnel != null && rtspTunnel.Running){
SpawnThread(delegate()
{
vlcWindow.Kill();
});
return;
}
else{
SpawnThread(delegate()
{
int stepTimeOut = 10000;
bool hasError = false;
Gtk.ProgressBar progressBar = new Gtk.ProgressBar();
progressBar.WidthRequest = 170;
Label label = new Label("Opening RTSP Connection");
//label.HeightRequest = 10;
Dialog dialog = new Dialog ("Starting video stream", this, Gtk.DialogFlags.DestroyWithParent);
dialog.TypeHint = WindowTypeHint.Splashscreen;
dialog.Modal = true;
dialog.VBox.Add (label);
dialog.VBox.Add (progressBar);
dialog.HasSeparator = false;
System.Timers.Timer timer = new System.Timers.Timer(100);
timer.Elapsed += delegate {
Gtk.Application.Invoke (delegate {
progressBar.Pulse();
});
};
Gtk.Application.Invoke (delegate {
dialog.ShowAll();
});
timer.Start();
if(brickType == BrickType.NXT)
rtspTunnel = new RtspTunnel(rtspPort,imagePort,brick.Connection);
else
throw new NotImplementedException("What to do with EV3");
rtspTunnel.Start();
string errorMessage = "";
if(rtspTunnel.RTSPWaitHandle.WaitOne(stepTimeOut)){
Gtk.Application.Invoke (delegate {
label.Text = "Starting stream";
});
vlcWindow = new Process();
string argument = "rtsp://127.0.0.1:" + rtspPort + " --network-caching="+ networkCachingCombobox.GetActiveValue();
Console.WriteLine(argument);
vlcWindow.StartInfo = new ProcessStartInfo(settings.Path,
argument);
try{
vlcError = false;
vlcWindow = Process.Start(new ProcessStartInfo(settings.Path,argument));
/*if(vlcWindow.Start()){
vlcError = false;
}*/
}
catch{
vlcError = true;
}
if(!vlcError){
Gtk.Application.Invoke (delegate {
label.Text = "Waiting for image stream";
});
if(rtspTunnel.StreamWaitHandle.WaitOne(stepTimeOut)){
//Everything is ok
rtspTunnel.Stopped += OnRTSPTunnelStopped;
rtspTunnel.NewImageDataRate += OnUpdateStreamRate;
OnRTSPTunnelStarted();
}
else{
errorMessage = "Failed to receive image data";
hasError = true;
}
}
else{
errorMessage = "Failed to start vlc window";
hasError = true;
}
}
else{
errorMessage = "Failed to start remote RTSP-server";
hasError = true;
}
timer.Stop();
Gtk.Application.Invoke (delegate {
dialog.Destroy();
});
if(hasError && !vlcError){
if(rtspTunnel != null && rtspTunnel.Running){
rtspTunnel.Stop();
}
Gtk.Application.Invoke (delegate {
MessageDialog md = new MessageDialog (this, DialogFlags.Modal, MessageType.Error, ButtonsType.Close, "\n" + errorMessage);
md.Icon = global::Gdk.Pixbuf.LoadFromResource (MessageDialogIconName);
md.WindowPosition = Gtk.WindowPosition.CenterOnParent;
md.Run ();
md.Destroy();
});
//.........这里部分代码省略.........
示例10: ExcepcionDesconocida
private void ExcepcionDesconocida(GLib.UnhandledExceptionArgs e)
{
#if DEBUG
Console.WriteLine(e.ToString());
#endif
Dialog dialog = new Dialog("Excepcion", this, Gtk.DialogFlags.DestroyWithParent);
dialog.Modal = true;
dialog.Resizable = false;
Gtk.Label etiqueta = new Gtk.Label();
etiqueta.Markup = "Ha ocurrido un error.";
dialog.BorderWidth = 8;
dialog.VBox.BorderWidth = 8;
dialog.VBox.PackStart(etiqueta, false, false, 0);
dialog.AddButton ("Cerrar", ResponseType.Close);
dialog.ShowAll();
dialog.Run ();
dialog.Destroy ();
}
示例11: OnQuitarFamiliaDialogResponse
private void OnQuitarFamiliaDialogResponse(object sender, ResponseArgs args)
{
switch (args.ResponseId)
{
case ResponseType.Accept:
Gtk.TreeIter iter;
this.FamiliaProductosTreeview.Selection.GetSelected(out iter);
FamiliaProducto bod = new FamiliaProducto(this.familiaModel.GetValue(iter, 0).ToString());
if (!this.db.ExisteFamiliaBd(bod))
{
Dialog dialog = new Dialog("No se pudo quitar la familia", this, Gtk.DialogFlags.DestroyWithParent);
dialog.Modal = true;
dialog.Resizable = false;
Gtk.Label etiqueta = new Gtk.Label();
etiqueta.Markup = "No se pudo quitar la familia porque no existe en la base de datos.\nIntente recargar la lista de familias.";
dialog.BorderWidth = 8;
dialog.VBox.BorderWidth = 8;
dialog.VBox.PackStart(etiqueta, false, false, 0);
dialog.AddButton ("Cerrar", ResponseType.Close);
dialog.ShowAll();
dialog.Run ();
dialog.Destroy ();
}
else
{
if (this.db.QuitarFamilia(bod))
{
Console.WriteLine(this.familias.Count);
this.familias.RemoveAt(this.familiaModel.GetPath(iter).Indices[0]);
Console.WriteLine(this.familias.Count);
this.familiaModel.Remove(ref iter);
this.actualizar_button.Sensitive = false;
this.FamiliaProductosTreeview.Selection.UnselectAll();
this.cambiado = true;
}
else
{
Dialog dialog = new Dialog("No se pudo quitar la familia", this, Gtk.DialogFlags.DestroyWithParent);
dialog.Modal = true;
dialog.Resizable = false;
Gtk.Label etiqueta = new Gtk.Label();
etiqueta.Markup = "No se pudo quitar la familia, ha ocurrido un error al quitarla de la base de datos.";
dialog.BorderWidth = 8;
dialog.VBox.BorderWidth = 8;
dialog.VBox.PackStart(etiqueta, false, false, 0);
dialog.AddButton ("Cerrar", ResponseType.Close);
dialog.ShowAll();
dialog.Run ();
dialog.Destroy ();
}
}
break;
default:
break;
}
}
示例12: scanParse
private void scanParse(ref int i)
{
//parses the GIMMEH
string name = lexemeList [i+1].getName (); //get the lexeme name
string desc = lexemeList [i+1].getDescription (); //get the lexeme description
if (desc == Constants.VARDESC) { //if it is a variable
int index = findVarName (name); //find the variable
if (index != -1) { //if it is inisialized
Dialog inputPrompt = null;
ResponseType response = ResponseType.None;
try {
//create a prompt
inputPrompt = new Dialog (Constants.SCAN, this,
DialogFlags.DestroyWithParent | DialogFlags.Modal,
"OK", ResponseType.Yes);
//set the size
inputPrompt.Resize (300, 50);
//set the layout
inputPrompt.VBox.Add (inputTextView = new TextView ());
//show the prompt
inputPrompt.ShowAll ();
//get the response
response = (ResponseType)inputPrompt.Run ();
} finally {
if (inputPrompt != null) {
if (response == ResponseType.Yes) {
string input = inputTextView.Buffer.Text; //get the input
Value val = new Value (input, Constants.STRING); //store it to the variable as YARN
allTable[index][lexemeList [i + 1].getName ()] = val;
}
inputPrompt.Destroy ();
}
}
} else //else the variable is not yet declared
throw new SyntaxException (WarningMessage.varNoDec (name));
} else //else GIMMEH has no arguments
throw new SyntaxException (WarningMessage.noArguments (Constants.SCAN));
i++;
}
示例13: OnAction20Activated
protected void OnAction20Activated(object sender, EventArgs e)
{
Dialog HistoryDialog = new Dialog ("История версий программы", this, Gtk.DialogFlags.DestroyWithParent);
HistoryDialog.Modal = true;
HistoryDialog.AddButton ("Закрыть", ResponseType.Close);
System.IO.StreamReader HistoryFile = new System.IO.StreamReader ("changes.txt");
TextView HistoryTextView = new TextView ();
HistoryTextView.WidthRequest = 700;
HistoryTextView.WrapMode = WrapMode.Word;
HistoryTextView.Sensitive = false;
HistoryTextView.Buffer.Text = HistoryFile.ReadToEnd ();
Gtk.ScrolledWindow ScrollW = new ScrolledWindow ();
ScrollW.HeightRequest = 500;
ScrollW.Add (HistoryTextView);
HistoryDialog.VBox.Add (ScrollW);
HistoryDialog.ShowAll ();
HistoryDialog.Run ();
HistoryDialog.Destroy ();
}
示例14: OnDownloadFileButtonPressed
protected void OnDownloadFileButtonPressed(object sender, System.EventArgs e){
FileNode selectedFileNode = (FileNode)FileNodeView.NodeSelection.SelectedNode;
if(selectedFileNode == null){
Gtk.Application.Invoke (delegate {
MessageDialog md = new MessageDialog (this, DialogFlags.Modal, MessageType.Info, ButtonsType.Close, "\nPlease select a file to download");
md.Icon = global::Gdk.Pixbuf.LoadFromResource (MessageDialogIconName);
md.WindowPosition = Gtk.WindowPosition.CenterOnParent;
md.Run ();
md.Destroy();
});
return;
}
if(downloadFolder == ""){
Gtk.Application.Invoke (delegate {
MessageDialog md = new MessageDialog (this, DialogFlags.Modal, MessageType.Info, ButtonsType.Close, "\nPlease select a folder");
md.Icon = global::Gdk.Pixbuf.LoadFromResource (MessageDialogIconName);
md.WindowPosition = Gtk.WindowPosition.CenterOnParent;
md.Run ();
md.Destroy();
});
return;
}
SpawnThread(delegate()
{
Gtk.ProgressBar progressBar = new Gtk.ProgressBar();
progressBar.WidthRequest = 170;
progressBar.PulseStep = 0.1;
progressBar.Fraction = 0;
progressBar.Text = (0).ToString() + "%";
Label label = new Label("Downloading file...");
//label.HeightRequest = 10;
Dialog dialog = new Dialog ("Progress", this, Gtk.DialogFlags.DestroyWithParent);
dialog.TypeHint = WindowTypeHint.Splashscreen;
dialog.Modal = true;
dialog.VBox.Add (label);
dialog.VBox.Add (progressBar);
dialog.HasSeparator = false;
//dialog.AddButton ("Cancel", ResponseType.Close);
//dialog.Response += delegate(object obj, ResponseArgs args){ dialog.Destroy();};
Gtk.Application.Invoke (delegate {
dialog.ShowAll();
});
int totalBytes = 0;
double target = (double) selectedFileNode.Size;
System.Action<int> onBytesRead = delegate(int bytesRead){
Gtk.Application.Invoke (delegate {
totalBytes += bytesRead;
//label.Text = "Downloading file...\n" + totalBytes + " of " + selectedFileNode.Size.ToString() + " bytes";
progressBar.Fraction = ((double)totalBytes/target);
progressBar.Text = ((int) (progressBar.Fraction*100)).ToString() + "%";
});
};
brick.FileSystem.OnBytesRead += onBytesRead;
try{
brick.FileSystem.DownloadFile(downloadFolder+"\\"+selectedFileNode.FileName,selectedFileNode.FileName);
Gtk.Application.Invoke (delegate {
dialog.Destroy();
});
}
catch(Exception exception){
Gtk.Application.Invoke (delegate {
dialog.Destroy();
MessageDialog md = new MessageDialog (this, DialogFlags.Modal, MessageType.Error, ButtonsType.Close, "\nFailed to download file\nError: " + exception.Message);
md.Icon = global::Gdk.Pixbuf.LoadFromResource (MessageDialogIconName);
md.WindowPosition = Gtk.WindowPosition.CenterOnParent;
md.Run ();
md.Destroy();
});
if(brick != null)
brick.FileSystem.OnBytesRead -= onBytesRead;
if(exception is MonoBrickException)
throw(exception);
return;
}
brick.FileSystem.OnBytesRead -= onBytesRead;
Gtk.Application.Invoke (delegate {
MessageDialog md = new MessageDialog (this, DialogFlags.Modal, MessageType.Info, ButtonsType.Ok, "\nFile downloaded successfully");
md.Icon = global::Gdk.Pixbuf.LoadFromResource (MessageDialogIconName);
md.WindowPosition = Gtk.WindowPosition.CenterOnParent;
md.Run ();
md.Destroy();
});
});
}
示例15: ControladorBaseDatos
/* public void CargarFechaInicial()
{
ControladorBaseDatos db = new ControladorBaseDatos();
try {
//db.ordenarFecha();
List<string> fechaInicial = db.ObtenerFechaBd();
comboboxFechasInicial.Clear();
CellRendererText cell = new CellRendererText();
comboboxFechasInicial.PackStart(cell, false);
comboboxFechasInicial.AddAttribute(cell, "text", 0);
this.fechaInicialModel = new Gtk.ListStore(typeof (string));
comboboxFechasInicial.Model = fechaInicialModel;
foreach (string i in fechaInicial)
{
this.fechaInicialModel.AppendValues(i);
}
if (fechaInicial.Count != 0)
{
this.comboboxFechasInicial.Active = 0;
}
}
catch (Exception ex)
{
Console.WriteLine("Excepcion:"+ex);
}
}
public void CargarFechaFinal()
{
ControladorBaseDatos db = new ControladorBaseDatos();
//db.ordenarFecha();
try {
List<string> fechaFinal = db.ObtenerFechaBd();
comboboxFechasFinal.Clear();
CellRendererText cell2 = new CellRendererText();
comboboxFechasFinal.PackStart(cell2, false);
comboboxFechasFinal.AddAttribute(cell2, "text", 0);
this.fechaFinalModel = new Gtk.ListStore(typeof (string));
comboboxFechasFinal.Model = fechaFinalModel;
foreach (string j in fechaFinal)
{
this.fechaFinalModel.AppendValues(j);
}
if (fechaFinal.Count != 0)
{
this.comboboxFechasFinal.Active = 0;
}
}
catch (Exception ex)
{
Console.WriteLine("Excepcion:"+ex);
}
}
*/
protected void OnButtonGuardarReporteClicked(object sender, EventArgs e)
{
string fechaInicial = calendarFInicial.GetDate ().ToString ("yyyy-MM-dd").Trim ();
string fechaFinal = calendarFFinal.GetDate ().ToString ("yyyy-MM-dd").Trim ();
this.OnCalendarFInicialDaySelected(sender,e);
this.OnCalendarFFinalDaySelected(sender,e);
if(fechaInicial.CompareTo(fechaFinal)==1){
Dialog dialog = new Dialog("ADVERTENCIA", this, Gtk.DialogFlags.DestroyWithParent);
dialog.Modal = true;
dialog.Resizable = false;
Gtk.Label etiqueta = new Gtk.Label();
etiqueta.Markup = "fecha final no puede ser anterior a fecha inicial";
dialog.BorderWidth = 8;
dialog.VBox.BorderWidth = 8;
dialog.VBox.PackStart(etiqueta, false, false, 0);
dialog.AddButton ("Cerrar", ResponseType.Close);
dialog.ShowAll();
dialog.Run ();
dialog.Destroy ();
}
else{
// string fechaInicial = comboboxFechasInicial.ActiveText;
// string fechaFinal = comboboxFechasFinal.ActiveText;
Document myDocument;
SeleccionarRuta();
// for(int aux=0; aux<listaVentas.Count; aux++){
// Console.WriteLine("Numero Boleta: "+Convert.ToString(listaVentas[aux].Idventa));
//myDocument.Add(new Paragraph("Numero Boleta: "+listaVentas[aux].Idventa));
// }
if(this.ruta_destino!=null){
Console.WriteLine("iText Demo");
//.........这里部分代码省略.........