/// <summary> /// Open therapist window /// </summary> public void OpenAddTherapistWindow() { if (_group == null || _group.Length < 1 || _indiv == null | _indiv.Length < 1) { return; } var dialog = new Dialog.Dialog(); dialog.Title = "Add New Therapist"; dialog.QuestionText = "Please give a name to the new therapist."; if (dialog.ShowDialog() == true) { try { string mKeySetName = dialog.ResponseText; therapistListViewModel.AllTherapists.Add(Therapist.CreateTherapist(mKeySetName)); using (StreamWriter file = new StreamWriter(Path.Combine(Properties.Settings.Default.SaveLocation, _group, _indiv, "Therapists.json"), false)) { Therapists mCollector = new Therapists(); mCollector.PrimaryTherapists = therapistListViewModel.AllTherapists; file.WriteLine(JsonConvert.SerializeObject(mCollector)); } MessageBox.Show("Successfully added: " + dialog.ResponseText); } catch (IOException e) { Console.WriteLine(e.ToString()); } } }
/// <summary> /// Open condition window /// </summary> public void OpenAddConditionDialog() { if (_group == null || _indiv == null || _eval == null || _group.Length < 1 || _indiv.Length < 1 || _eval.Length < 1) { return; } var dialog = new Dialog.Dialog(); dialog.Title = "Add New Condition"; dialog.QuestionText = "Please give a name to the new condition."; if (dialog.ShowDialog() == true) { try { DirectoryInfo di2 = Directory.CreateDirectory(Properties.Settings.Default.SaveLocation + "\\" + _group + "\\" + _indiv + "\\" + _eval + "\\" + dialog.ResponseText + "\\"); _cond = ""; conditionListViewModel.RefreshRepository(_group, _indiv, _eval); MessageBox.Show("Successfully Created: " + dialog.ResponseText); } catch (IOException e) { Console.WriteLine(e.ToString()); } } }
/// <summary> /// Open individual window /// </summary> public void OpenAddIndividualDialog() { if (_group == null || _group.Length < 1) { return; } var dialog = new Dialog.Dialog(); dialog.Title = "Add New Individual"; dialog.QuestionText = "Please give a name to the new individual."; if (dialog.ShowDialog() == true) { DirectoryInfo di2 = Directory.CreateDirectory(Path.Combine(Properties.Settings.Default.SaveLocation, _group, dialog.ResponseText)); _indiv = _eval = _cond = ""; individualListViewModel.RefreshRepository(_group); evaluationListViewModel.AllEvaluations.Clear(); conditionListViewModel.AllConditions.Clear(); collectorListViewModel.AllCollectors.Clear(); keyboardListViewModel.AllKeyboards.Clear(); therapistListViewModel.AllTherapists.Clear(); MessageBox.Show("Successfully Created: " + dialog.ResponseText); } }
/// <summary> /// Open group window /// </summary> public void OpenAddGroupDialog() { var dialog = new Dialog.Dialog(); dialog.Title = "Add New Group"; dialog.QuestionText = "Please give a name to the new group."; if (dialog.ShowDialog() == true) { try { DirectoryInfo di2 = Directory.CreateDirectory(Path.Combine(Properties.Settings.Default.SaveLocation, dialog.ResponseText)); _group = _indiv = _eval = _cond = ""; groupListViewModel.RefreshRepository(); individualListViewModel.AllIndividuals.Clear(); evaluationListViewModel.AllEvaluations.Clear(); conditionListViewModel.AllConditions.Clear(); collectorListViewModel.AllCollectors.Clear(); keyboardListViewModel.AllKeyboards.Clear(); therapistListViewModel.AllTherapists.Clear(); MessageBox.Show("Successfully Created: " + dialog.ResponseText); } catch (IOException e) { Console.WriteLine(e.ToString()); } } }
public void Use() { Dialog.Dialog dialog = DialogDatabase.Instance.GetDialogById(dialogId); if (dialog != null) { //GameController.Instance.GameState = GameStates.Dialog; UI.UIController.Instance.dialogScreen.Show(); UI.UIController.Instance.dialogScreen.SetDialog(dialog); } }
public void SetDialog(Dialog.Dialog dialog) { if (dialog == null || dialog.dialogPages.Count == 0) { UIController.Instance.dialogScreen.Hide(); return; } currentDialog = dialog; pageCount = 0; DrawDialog(); }
/// <summary> /// Open save dialog /// </summary> public void OpenSaveLocationDialog() { var dialog = new Dialog.Dialog(); dialog.Title = "Set Default Save Location"; dialog.QuestionText = "Please set the default location for save files."; dialog.ResponseText = Properties.Settings.Default.SaveLocation; dialog.ShowDialog(); if (Directory.Exists(dialog.ResponseText)) { Properties.Settings.Default.SaveLocation = dialog.ResponseText; Properties.Settings.Default.Save(); SaveLocation = Properties.Settings.Default.SaveLocation; } else { MessageBox.Show("This location doesn't seem to exist or isn't available. Are you sure this is the correct location?"); } }
private void btnPOSItemSearch_Click(object sender, EventArgs e) { if (IsEdit) { using (LSRetailPosis.POSProcesses.frmMessage dialog = new LSRetailPosis.POSProcesses.frmMessage("You are in editing mode", MessageBoxButtons.OK, MessageBoxIcon.Information)) { LSRetailPosis.POSProcesses.POSFormsManager.ShowPOSForm(dialog); return; } } Microsoft.Dynamics.Retail.Pos.Dialog.Dialog objdialog = new Dialog.Dialog(); string str = string.Empty; DataSet dsItem = new DataSet(); objdialog.MyItemSearch(500, ref str, out dsItem); saleLineItem = new SaleLineItem(); if (dsItem != null && dsItem.Tables.Count > 0 && dsItem.Tables[0].Rows.Count > 0) { saleLineItem.ItemId = Convert.ToString(dsItem.Tables[0].Rows[0]["ITEMID"]); Microsoft.Dynamics.Retail.Pos.Item.Item objItem = new Item.Item(); objItem.MYProcessItem(saleLineItem, application); Microsoft.Dynamics.Retail.Pos.Dimension.Dimension objDim = new Dimension.Dimension(); DataTable dtDimension = new DataTable(); dtDimension = objDim.GetDimensions(saleLineItem.ItemId); if (dtDimension != null && dtDimension.Rows.Count > 0) { DimensionConfirmation dimConfirmation = new DimensionConfirmation(); dimConfirmation.InventDimCombination = dtDimension; dimConfirmation.DimensionData = saleLineItem.Dimension; frmDimensions objfrmDim = new frmDimensions(dimConfirmation); objfrmDim.ShowDialog(); if (objfrmDim.SelectDimCombination != null) { inventDimId = GetInventID(Convert.ToString(objfrmDim.SelectDimCombination.ItemArray[2])); DataTable dtcmbCode = new DataTable(); dtcmbCode.Columns.Add("CodeID", typeof(string)); dtcmbCode.Columns.Add("CodeValue", typeof(string)); DataRow drCode; drCode = dtcmbCode.NewRow(); drCode["CodeID"] = Convert.ToString(objfrmDim.SelectDimCombination.ItemArray[4]); drCode["CodeValue"] = Convert.ToString(objfrmDim.SelectDimCombination.ItemArray[4]); dtcmbCode.Rows.Add(drCode); cmbCode.DataSource = dtcmbCode; cmbCode.DisplayMember = "CodeValue"; cmbCode.ValueMember = "CodeID"; DataTable dtSize = new DataTable(); dtSize.Columns.Add("SizeID", typeof(string)); dtSize.Columns.Add("SizeValue", typeof(string)); DataRow drSize; drSize = dtSize.NewRow(); drSize["SizeID"] = Convert.ToString(objfrmDim.SelectDimCombination.ItemArray[3]); drSize["SizeValue"] = Convert.ToString(objfrmDim.SelectDimCombination.ItemArray[3]); dtSize.Rows.Add(drSize); cmbSize.DataSource = dtSize; cmbSize.DisplayMember = "SizeID"; cmbSize.ValueMember = "SizeValue"; DataTable dtConfig = new DataTable(); dtConfig.Columns.Add("ConfigID", typeof(string)); dtConfig.Columns.Add("ConfigValue", typeof(string)); DataRow drConfig; drConfig = dtConfig.NewRow(); drConfig["ConfigID"] = Convert.ToString(objfrmDim.SelectDimCombination.ItemArray[6]); drConfig["ConfigValue"] = Convert.ToString(objfrmDim.SelectDimCombination.ItemArray[6]); dtConfig.Rows.Add(drConfig); cmbConfig.DataSource = dtConfig; cmbConfig.DisplayMember = "ConfigID"; cmbConfig.ValueMember = "ConfigValue"; DataTable dtStyle = new DataTable(); dtStyle.Columns.Add("StyleID", typeof(string)); dtStyle.Columns.Add("StyleValue", typeof(string)); DataRow drStyle; drStyle = dtStyle.NewRow(); drStyle["StyleID"] = Convert.ToString(objfrmDim.SelectDimCombination.ItemArray[5]); drStyle["StyleValue"] = Convert.ToString(objfrmDim.SelectDimCombination.ItemArray[5]); dtStyle.Rows.Add(drStyle); cmbStyle.DataSource = dtStyle; cmbStyle.DisplayMember = "StyleID"; cmbStyle.ValueMember = "StyleValue"; cmbConfig.Enabled = false; cmbCode.Enabled = false; cmbSize.Enabled = false; cmbStyle.Enabled = false; Previewdimensions = ColorSizeStyleConfig(); } } else { cmbStyle.Text = string.Empty; cmbConfig.Text = string.Empty; cmbCode.Text = string.Empty; cmbSize.Text = string.Empty; cmbConfig.Enabled = false; cmbCode.Enabled = false; cmbSize.Enabled = false; cmbStyle.Enabled = false; } txtPCS.Focus(); txtPCS.Text = ""; SqlConnection conn = new SqlConnection(); if (application != null) { conn = application.Settings.Database.Connection; } else { conn = ApplicationSettings.Database.LocalConnection; } txtItemId.Text = Convert.ToString(dsItem.Tables[0].Rows[0]["ITEMID"]); txtItemName.Text = Convert.ToString(dsItem.Tables[0].Rows[0]["ITEMNAME"]); unitid = saleLineItem.BackofficeSalesOrderUnitOfMeasure; } }
private void WriteDialogStrings(Dialog.Dialog dialog, List <string> lines, string lang) { lines.Add("[" + lang + "]"); lines.Add(MSGFormat(100, dialog.NpcName[lang])); if (dialog.DescriptionAlive[lang] != null) { foreach (String str in dialog.DescriptionAlive[lang]) { lines.Add(MSGFormat(200, str)); } } if (dialog.DescriptionAliveFull[lang] != null) { foreach (String str in dialog.DescriptionAliveFull[lang]) { lines.Add(MSGFormat(210, str)); } } if (dialog.DescriptionKnocked[lang] != null) { foreach (String str in dialog.DescriptionKnocked[lang]) { lines.Add(MSGFormat(220, str)); } } if (dialog.DescriptionKnockedFull[lang] != null) { foreach (String str in dialog.DescriptionKnockedFull[lang]) { lines.Add(MSGFormat(230, str)); } } if (dialog.DescriptionDead[lang] != null) { foreach (String str in dialog.DescriptionDead[lang]) { lines.Add(MSGFormat(240, str)); } } if (dialog.DescriptionDeadFull[lang] != null) { foreach (String str in dialog.DescriptionDeadFull[lang]) { lines.Add(MSGFormat(250, str)); } } if (dialog.DescriptionCriticalDead[lang] != null) { foreach (String str in dialog.DescriptionCriticalDead[lang]) { lines.Add(MSGFormat(260, str)); } } if (dialog.DescriptionCriticalDeadFull[lang] != null) { foreach (String str in dialog.DescriptionCriticalDeadFull[lang]) { lines.Add(MSGFormat(270, str)); } } int nodeNum = 0; foreach (FOCommon.Dialog.Node node in dialog.Nodes) { int ansNum = 0; lines.Add(MSGFormat(++nodeNum * 1000, node.Text[lang])); foreach (FOCommon.Dialog.Answer answer in node.Answers) { lines.Add(MSGFormat(nodeNum * 1000 + (++ansNum * 10), answer.Text[lang])); } } foreach (KeyValuePair <int, List <String> > kvp in dialog.UserStrings[lang]) { foreach (String line in kvp.Value) { lines.Add(MSGFormat(100000000 + kvp.Key, line)); } } lines.Add(""); }
private void ShowItemSearch(int fromRow, int numberOfItems) { string itemid = string.Empty; DataTable dtSKUItems = new DataTable(); string commandText = " SELECT ITEMID, ITEMNAME, I.UNITOFMEASURE FROM ( " + " SELECT IT.ITEMID, COALESCE(TR.NAME, IT.ITEMNAME, IT.ITEMID) AS ITEMNAME, IT.DATAAREAID, " + " ISNULL(IM.UNITID, '') AS UNITOFMEASURE, ROW_NUMBER() OVER (ORDER BY IT.ITEMNAME ASC) AS ROW " + " FROM ASSORTEDINVENTITEMS IT JOIN INVENTTABLEMODULE IM ON IT.ITEMID = IM.ITEMID AND IM.MODULETYPE = 2 " + " JOIN ECORESPRODUCT AS PR ON PR.RECID = IT.PRODUCT " + // " INNER JOIN SKUTable_Posted ON IT.ITEMID = SKUTable_Posted.SkuNumber " + " INNER JOIN SKUTableTrans ON IT.ITEMID = SKUTableTrans.SkuNumber " + //SKU Table " LEFT JOIN ECORESPRODUCTTRANSLATION AS TR " + " ON PR.RECID = TR.PRODUCT AND TR.LANGUAGEID = @CULTUREID WHERE IT.STORERECID = @STORERECID " + // " AND SKUTable_Posted.isAvailable='True' AND SKUTable_Posted.isLocked='False' " + " AND SKUTableTrans.isAvailable='True' AND SKUTableTrans.isLocked='False' " + //SKU Table " ) I WHERE I.DATAAREAID='" + ApplicationSettings.Database.DATAAREAID + "' AND I.ROW > @FROMROW AND I.ROW <= @TOROW "; SqlConnection connection = new SqlConnection(); if (application != null) { connection = application.Settings.Database.Connection; } else { connection = ApplicationSettings.Database.LocalConnection; } if (connection.State == ConnectionState.Closed) { connection.Open(); } SqlCommand command = new SqlCommand(commandText, connection); SqlParameter languageIdParm = command.Parameters.Add("@CULTUREID", SqlDbType.NVarChar, 7); languageIdParm.Value = ApplicationSettings.Terminal.CultureName; SqlParameter dataAreaIdParm = command.Parameters.Add("@DATAAREAID", SqlDbType.NVarChar, 4); dataAreaIdParm.Value = ApplicationSettings.Database.DATAAREAID; command.Parameters.AddWithValue("@FROMROW", fromRow); command.Parameters.AddWithValue("@TOROW", (fromRow + numberOfItems)); command.Parameters.AddWithValue("@STORERECID", ApplicationSettings.Terminal.StorePrimaryId); command.CommandTimeout = 0; SqlDataReader reader = command.ExecuteReader(); dtSKUItems.Load(reader); if (dtSKUItems != null && dtSKUItems.Rows.Count > 0) { DataRow drSelected = null; Dialog.Dialog oDialog = new Dialog.Dialog(); oDialog.GenericSearch(dtSKUItems, ref drSelected, "Select SKU"); if (dtSkuGridItems != null && dtSkuGridItems.Rows.Count > 0) { if (drSelected != null) { itemid = Convert.ToString(drSelected["ITEMID"]); dtSkuGridItems.ImportRow(drSelected); } } else { if (dtSkuGridItems != null && dtSkuGridItems.Columns.Count > 0) { if (drSelected != null) { itemid = Convert.ToString(drSelected["ITEMID"]); dtSkuGridItems.ImportRow(drSelected); } } else { dtSkuGridItems = dtSKUItems.Clone(); dtSkuGridItems.Columns.Add("SKUBOOKINGDATE", typeof(DateTime)); if (drSelected != null) { itemid = Convert.ToString(drSelected["ITEMID"]); dtSkuGridItems.ImportRow(drSelected); dtSkuGridItems.AcceptChanges(); } } } UpdateSKUTable(itemid); foreach (DataRow dr in dtSkuGridItems.Rows) { dr["SKUBOOKINGDATE"] = DateTime.Now.ToShortDateString(); } grItems.DataSource = dtSkuGridItems; } else { using (LSRetailPosis.POSProcesses.frmMessage dialog = new LSRetailPosis.POSProcesses.frmMessage("No Item Present.", MessageBoxButtons.OK, MessageBoxIcon.Information)) { LSRetailPosis.POSProcesses.POSFormsManager.ShowPOSForm(dialog); } } }
/// <summary> /// Open add keyboard window /// </summary> public void OpenAddKeyboardDialog() { if (_group == null || _group.Length < 1 || _indiv == null | _indiv.Length < 1) { return; } bool editingCurrent = false; var editDialog = new DialogEditYesNo(); if (_keys != null && _keys.Length > 0) { editDialog.QuestionText = "Do you want new keys or to edit: " + _keys; if (editDialog.ShowDialog() == true) { editingCurrent = editDialog.ReturnedAnswer; } } if (editingCurrent && editDialog.Clicked) { var mModel = new KeyboardScreenViewModel(); mModel.PatientName = _indiv; mModel.GroupName = _group; mModel.FileName = _keys; var kbWindow = new KeyboardScreen(); kbWindow.WindowStartupLocation = WindowStartupLocation.CenterScreen; kbWindow.DataContext = mModel; mModel.SetupKeysEditing(editingCurrent); if (kbWindow.ShowDialog() == true) { using (StreamWriter file = new StreamWriter(Path.Combine(Properties.Settings.Default.SaveLocation, _group, _indiv, _keys + ".json"), false)) { file.WriteLine(JsonConvert.SerializeObject(mModel.mReturnedKeys)); } MessageBox.Show("Successfully Edited Keyboard: " + _keys); FrequencyKeys.Clear(); DurationKeys.Clear(); keyboardListViewModel.RefreshRepository(_group, _indiv); } } else if (!editingCurrent) { var dialog = new Dialog.Dialog(); dialog.Title = "Add New Key Set"; dialog.QuestionText = "Please give a name to the new key set."; if (dialog.ShowDialog() == true) { string mKeySetName = dialog.ResponseText; var mModel = new KeyboardScreenViewModel(); mModel.PatientName = _indiv; mModel.GroupName = _group; mModel.CurrentlyEditing = editingCurrent; mModel.FileName = mKeySetName; Window MainWindow2 = Application.Current.MainWindow; var kbWindow = new KeyboardScreen(); kbWindow.WindowStartupLocation = WindowStartupLocation.CenterScreen; kbWindow.DataContext = mModel; if (kbWindow.ShowDialog() == true) { using (StreamWriter file = new StreamWriter(Path.Combine(Properties.Settings.Default.SaveLocation, _group, _indiv, mKeySetName + ".json"), false)) { file.WriteLine(JsonConvert.SerializeObject(mModel.mReturnedKeys)); } MessageBox.Show("Successfully Created Keyboard: " + mKeySetName); FrequencyKeys.Clear(); DurationKeys.Clear(); keyboardListViewModel.RefreshRepository(_group, _indiv); } } } }