public Kardex() { InitializeComponent(); SiaWin = Application.Current.MainWindow; //idemp = SiaWin._BusinessId; TextBoxRef.Focus(); }
private object OnTextBoxRef(TextBoxRef textBoxRef) { INiCommandBarControl control; ErrorUtil.ThrowOnFailure(_commandManager.FindCommandBarControl( textBoxRef.Guid, out control )); if (control == null) { throw new NetIdeException(String.Format(NeutralResources.CannotFindCommand, textBoxRef.Guid)); } return(control); }
public override void ProcessFrame(Playable playable, FrameData info, object playerData) { if (m_textBoxRef == null) { m_textBoxRef = playerData as TextBoxRef; } if (!m_textBoxRef) { return; } if (Application.isPlaying && began == false) { if (m_textBoxRef.dialogueRunner.isDialogueRunning == false) { began = true; Debug.Log("<color=green>TEXTBOX STARTED</color>"); m_textBoxRef.dialogueRunner.Clear();// UNLOADS ALL LOADED YARN FILES. if (useInlineDialogue) { m_textBoxRef.dialogueRunner.AddScript(inlineDialogue); } else if (dialogueAsset != null) { m_textBoxRef.dialogueRunner.AddScript(dialogueAsset); } m_dialougeUI.onEnd.AddListener(m_onEnd); m_textBoxRef.CallTextBox(startNode); //Pause without breaking the current animation states. Work around for 2018.2 if (pauseTimeline) { m_graph.GetRootPlayable(0).SetSpeed(0); } if (jumpToEndOfClip) { JumpToEndofPlayable(); } } } }
public override void ProcessFrame(Playable playable, FrameData info, object playerData) { TextBoxRef trackBinding = playerData as TextBoxRef; if (!trackBinding) { return; } /* * int inputCount = playable.GetInputCount (); * * for (int i = 0; i < inputCount; i++) * { * float inputWeight = playable.GetInputWeight(i); * ScriptPlayable<TriggerDialogueBehaviour> inputPlayable = (ScriptPlayable<TriggerDialogueBehaviour>)playable.GetInput(i); * TriggerDialogueBehaviour input = inputPlayable.GetBehaviour (); * } */ }
private object OnTextBoxRef(TextBoxRef textBoxRef) { INiCommandBarControl control; ErrorUtil.ThrowOnFailure(_commandManager.FindCommandBarControl( textBoxRef.Guid, out control )); if (control == null) throw new NetIdeException(String.Format(NeutralResources.CannotFindCommand, textBoxRef.Guid)); return control; }
private void Button_Click(object sender, RoutedEventArgs e) { try { ResetValue(); if (FecIni.Text.Length <= 0) { MessageBox.Show("debe de ingresar la fecha de corte"); FecIni.Focus(); return; } if (string.IsNullOrEmpty(TextBoxRef.Text.Trim())) { MessageBox.Show("debe de ingresar una referencia"); TextBoxRef.Focus(); return; } if (string.IsNullOrEmpty(TextBoxbod.Text.Trim())) { MessageBox.Show("debe de ingresar una bodega"); TextBoxbod.Focus(); return; } SqlConnection con = new SqlConnection(SiaWin._cn); SqlCommand cmd = new SqlCommand(); SqlDataAdapter da = new SqlDataAdapter(); DataSet ds = new DataSet(); cmd = new SqlCommand("_EmpInventarioKardes", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Fecha", FecIni.Text); cmd.Parameters.AddWithValue("@Ref", TextBoxRef.Text); cmd.Parameters.AddWithValue("@Bods", TextBoxbod.Text); cmd.Parameters.AddWithValue("@codemp", codemp); da = new SqlDataAdapter(cmd); da.Fill(ds); con.Close(); GridKardex.ItemsSource = ds.Tables[0]; if (ds.Tables[0].Rows.Count > 0) { GridKardex.Focus(); GridKardex.SelectedIndex = 0; decimal CantEnt = Convert.ToDecimal(ds.Tables[0].Compute("Sum(ent_uni)", "").ToString()); decimal TotEnt = Convert.ToDecimal(ds.Tables[0].Compute("Sum(ent_ctotal)", "").ToString()); TxtTotalUnEnt.Text = CantEnt.ToString("N2"); TxtTotalUncostEnt.Text = TotEnt.ToString("N2"); int promedioEntrada = 0; if (TotEnt > 0 & CantEnt > 0) { TxtTotalUncosEnt.Text = (TotEnt / CantEnt).ToString("N2"); promedioEntrada = Convert.ToInt32(TotEnt / CantEnt); } else { TxtTotalUncosEnt.Text = "0"; } ProEnt.Text = promedioEntrada.ToString(); decimal CantSal = Convert.ToDecimal(ds.Tables[0].Compute("Sum(sal_uni)", "").ToString()); decimal TotSal = Convert.ToDecimal(ds.Tables[0].Compute("Sum(sal_ctotal)", "").ToString()); TxtTotalUnSal.Text = CantSal.ToString("N2"); TxtTotalUncostSal.Text = TotSal.ToString("N2"); int promedioSalida = 0; if (TotSal > 0 & CantSal > 0) { TxtTotalUncosSal.Text = (TotSal / CantSal).ToString("N2"); promedioSalida = Convert.ToInt32(TotSal / CantSal); } else { TxtTotalUncosSal.Text = "0"; } ProSal.Text = promedioSalida.ToString(); decimal CantSaldo = Convert.ToDecimal(ds.Tables[0].Compute("Sum(saldo_uni)", "").ToString()); decimal TotSaldo = Convert.ToDecimal(ds.Tables[0].Compute("Sum(saldo_ctotal)", "").ToString()); TxtTotalUnSaldo.Text = CantSaldo.ToString("N2"); TxtTotalUncostSaldo.Text = TotSaldo.ToString("N2"); int promedioSaldo = 0; if (TotSaldo > 0 & CantSaldo > 0) { promedioSaldo = Convert.ToInt32(TotSaldo / CantSaldo); TxtTotalUncosSaldo.Text = (TotSaldo / CantSaldo).ToString("N2"); } else { TxtTotalUncosSaldo.Text = "0"; } ProSaldo.Text = promedioSaldo.ToString(); } Total.Text = ds.Tables[0].Rows.Count.ToString(); } catch (Exception w) { MessageBox.Show("error al cargar la consulta programada:" + w.ToString()); } }
public override IEnumerator RunLine(Line line) { TextBoxRef textBoxRef; TextBox textBox; string[] lineText; string msg; string textBoxKey; //split TextBoxKey from message. if (line.text.Contains(":") == false) { yield break; } lineText = line.text.Split(':'); textBoxKey = lineText[0]; msg = lineText[1]; // Find TextBox with textBoxKey textBoxRef = FindObjectsOfType <TextBoxRef>() .Where((TextBoxRef s) => { return(s.textBoxKey == textBoxKey); }) .First(); textBox = textBoxRef.textBox; m_lastTextBox = textBoxRef; textBox.EnabledTextBox(textBoxRef.textBoxSettings.useTween); // if the current textbox isnt in the conversation yet we add it to the activeTextboxes. if (m_activeTextBoxes.Contains(textBoxRef) == false) { m_activeTextBoxes.Add(textBoxRef); } textBox.text.text = msg; textBox.text.maxVisibleCharacters = 0; m_audioSource = textBox.GetComponent <AudioSource>(); //Set Font From SettingsAsset. if (textBoxRef.textBoxSettings.TMP_Font != null) { textBox.text.font = textBoxRef.textBoxSettings.TMP_Font; } textBox.text.fontSize = textBoxRef.textBoxSettings.fontSize; //Set the size of the text box if (textBoxRef.textBoxSettings.autoSize) { textBox.text.rectTransform.sizeDelta = textBoxRef.textBoxSettings.maxSize; textBox.bg.sizeDelta = textBoxRef.textBoxSettings.maxSize; textBox.text.rectTransform.sizeDelta.Set(textBoxRef.textBoxSettings.maxSize.x, textBox.text.rectTransform.sizeDelta.y); textBox.text.ForceMeshUpdate(); Vector2 pSize = textBox.text.GetPreferredValues(textBox.text.text, textBoxRef.textBoxSettings.maxSize.x, textBoxRef.textBoxSettings.maxSize.y); if (pSize.x >= textBoxRef.textBoxSettings.maxSize.x) { pSize.y = 0; int index = 0; float lineWidth = 0f; for (; index < textBox.text.textInfo.lineCount; index++) { if (textBox.text.textInfo.lineInfo[index].width > lineWidth) { lineWidth = textBox.text.textInfo.lineInfo[index].width; } pSize.y += textBox.text.textInfo.lineInfo[index].lineHeight; if (textBox.text.textInfo.lineInfo[index].lastCharacterIndex == textBox.text.text.Length - 1) { break; } } pSize.y += textBox.text.margin.y + textBox.text.margin.w; pSize.x = lineWidth + textBox.text.margin.y + textBox.text.margin.w; } textBox.text.rectTransform.sizeDelta = pSize; textBox.bg.sizeDelta = pSize; } textBox.text.ForceMeshUpdate(); // display per character. if (textBoxRef.textBoxSettings.useDelay) { while (textBox.text.maxVisibleCharacters < textBox.text.textInfo.characterCount) { // Show Next Character. textBox.text.maxVisibleCharacters++; // Play Audio textBoxRef.textBoxSettings.sfx.Play(m_audioSource); // not 100% sure this is right.. set the delay between characters. if (textBox.useTimeScale) { yield return(new WaitForSeconds(textBoxRef.textBoxSettings.delay * (Input.GetButton("Interact") ? .5f : 1f))); } else { yield return(new WaitForSecondsRealtime(textBoxRef.textBoxSettings.delay * (Input.GetButton("Interact") ? .5f : 1f))); } } } // display per page. else { // show all characters. textBox.text.maxVisibleCharacters = textBox.text.textInfo.characterCount; // Play Audio textBoxRef.textBoxSettings.sfx.Play(m_audioSource); } //Handle per-line Delay. if (textBoxRef.textBoxSettings.inputType == TextBoxSettings.InputType.Player) { yield return(new WaitWhile(() => { return SimpleInput.GetButtonDown("Interact") == false; })); } else if (textBoxRef.textBoxSettings.inputType == TextBoxSettings.InputType.Passive) { float nextTime = Time.time + textBoxRef.textBoxSettings.passiveLineDelay; yield return(new WaitWhile(() => { return Time.time < nextTime; })); } //tween textbox closed. textBox.DisableTextbox(textBoxRef.textBoxSettings.useTween); yield return(new WaitWhile(() => { return textBox.gameObject.activeSelf; })); }