示例#1
0
        /// <summary>
        /// Перевизначений метод обробки повідомлень.
        /// </summary>
        /// <param name="m">Повідомлення</param>
        protected override void WndProc(ref Message m)
        {
            base.WndProc(ref m);

            //winapi.WinAPI.OutputDebugString(m.ToString());

            if (m.Msg == (int)CoreLib.MyMsgs.WM_HOTKEY)
            {
                //winapi.Funcs.OutputDebugString("Q");
                #region hot key control
                switch (m.WParam.ToInt32())
                {
                    case 0x10:
                        #region CONTROL + DELETE
                        {
                            //if (this.Cheque.ExtendedProperties.ContainsKey("BILL") && this.Cheque.ExtendedProperties["BILL"] != null && bool.Parse(this.Cheque.ExtendedProperties["LOCK"].ToString()))
                            if ((bool)DataWorkShared.ExtractBillProperty(this.Cheque, CoreConst.IS_LOCKED, false))
                            {
                                MMessageBox.Show("Поточний рахунок № " + DataWorkShared.ExtractBillProperty(this.Cheque, CoreConst.BILL_NO) + " надрукований клієнту.\r\nЗробіть з нього чек.",
                                    Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
                                break;//r
                            }

                            if (Cheque.Rows.Count == 0)
                                break;//r

                            if (!(ADMIN_STATE || UserConfig.Properties[24]) && (DataWorkShared.ExtractBillProperty(this.Cheque, CoreConst.OWNER_NO, string.Empty).ToString() == string.Empty))
                                if (admin.ShowDialog() != DialogResult.OK)
                                    break;//r

                            try
                            {
                                int index = chequeDGV.CurrentRow.Index;

                                if (DataWorkShared.ExtractBillProperty(this.Cheque, CoreConst.OID, string.Empty).ToString() != string.Empty)
                                {
                                    try
                                    {
                                        Dictionary<string, object[]> deletedRows = new Dictionary<string, object[]>();
                                        deletedRows = (Dictionary<string, object[]>)DataWorkShared.ExtractBillProperty(this.Cheque, CoreConst.DELETED_ROWS, deletedRows);
                                        //DataRow[] dRow = new DataRow[1] { };
                                        //this.Cheque.Rows.CopyTo(dRow, index);
                                        if (!deletedRows.ContainsKey(this.Cheque.Rows[index]["C"].ToString()))
                                        {
                                            deletedRows.Add(this.Cheque.Rows[index]["C"].ToString(), this.Cheque.Rows[index].ItemArray);
                                            DataWorkShared.SetBillProperty(this.Cheque, CoreConst.DELETED_ROWS, deletedRows);
                                        }
                                    }
                                    catch { }
                                }

                                Cheque.Rows.RemoveAt(index);

                                //AppFunc.OutputDebugString("k");
                                RowsRemoved_MyEvent(true);
                                index--;
                                if (index < 0)
                                    if (Cheque.Rows.Count != 0)
                                        index = 0;
                                    else
                                        break;//r
                                chequeDGV.CurrentCell = chequeDGV.Rows[index].Cells[chequeDGV.Columns.GetFirstColumn(DataGridViewElementStates.Visible).Name];
                                chequeDGV.Rows[index].Selected = true;
                            }
                            catch { }
                            break;
                        }
                        #endregion
                    case 0x11:
                        #region CONTROL + SHIFT + DELETE
                        {
                            //if (this.Cheque.ExtendedProperties.ContainsKey("BILL") && this.Cheque.ExtendedProperties["BILL"] != null && bool.Parse(this.Cheque.ExtendedProperties["LOCK"].ToString()))
                            if ((bool)DataWorkShared.ExtractBillProperty(this.Cheque, CoreConst.IS_LOCKED, false))
                            {
                                MMessageBox.Show("Поточний рахунок № " + DataWorkShared.ExtractBillProperty(this.Cheque, CoreConst.BILL_NO) + " надрукований клієнту.\r\nЗробіть з нього чек.",
                                    Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
                                break;//r
                            }

                            if (Cheque.Rows.Count == 0)
                                break;//r

                            if (!(ADMIN_STATE || UserConfig.Properties[24]))
                                if (admin.ShowDialog() != DialogResult.OK)
                                    break;//r

                            if (DataWorkShared.ExtractBillProperty(this.Cheque, CoreConst.OID, string.Empty).ToString() != string.Empty)
                            {
                                try
                                {
                                    Dictionary<string, object[]> deletedRows = new Dictionary<string, object[]>();
                                    deletedRows = (Dictionary<string, object[]>)DataWorkShared.ExtractBillProperty(this.Cheque, CoreConst.DELETED_ROWS, deletedRows);
                                    for (int index = 0; index < this.Cheque.Rows.Count ; index++)
                                    {
                                        if (!deletedRows.ContainsKey(this.Cheque.Rows[index]["C"].ToString()))
                                            deletedRows.Add(this.Cheque.Rows[index]["C"].ToString(), this.Cheque.Rows[index].ItemArray);
                                    }
                                    DataWorkShared.SetBillProperty(this.Cheque, CoreConst.DELETED_ROWS, deletedRows);

                                }
                                catch { }
                            }

                            Cheque.Rows.Clear();
                            RowsRemoved_MyEvent(true);
                            break;
                        }
                        #endregion
                    case 0x12:
                        #region CONTROL + PageDown
                        {
                            if ((bool)DataWorkShared.ExtractBillProperty(this.Cheque, CoreConst.IS_LOCKED, false))
                            {
                                MMessageBox.Show("Поточний рахунок № " + DataWorkShared.ExtractBillProperty(this.Cheque, CoreConst.BILL_NO) + " надрукований клієнту.\r\nЗробіть з нього чек.",
                                    Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
                                break;//r
                            }

                            if (inventChq)
                                return;

                            if (!(ADMIN_STATE || UserConfig.Properties[3]))
                                if (admin.ShowDialog() != DialogResult.OK)
                                    return;

                            double discSUMA = 0.0;
                            try
                            {
                                discSUMA = (double)Cheque.Compute("Sum(SUM)", "USEDDISC = " + Boolean.TrueString);
                            }
                            catch { }
                            uiWndDiscountRequest d = new uiWndDiscountRequest(discSUMA, true);
                            d.SetDiscount(ref discArrPercent, ref discArrCash);
                            d.Dispose();

                            if (discArrPercent[0] == 0.0 && discArrPercent[1] == 0.0 && discArrCash[0] == 0.0 && discArrCash[1] == 0.0)
                                ResetDiscount();
                            else
                            {
                                відмінитиЗнижкунадбавкуToolStripMenuItem.Enabled = true;
                                if (AppConfig.APP_OnlyDiscount)
                                    відмінитиЗнижкунадбавкуToolStripMenuItem.Text = "Скасувати знижку";
                                else
                                {
                                    if ((discArrPercent[0] != 0.0 && discArrPercent[1] != 0.0) || (discArrCash[0] != 0.0 && discArrCash[1] != 0.0))
                                        відмінитиЗнижкунадбавкуToolStripMenuItem.Text = "Скасувати знижку і націнку";
                                    if ((discArrPercent[0] == 0.0 && discArrPercent[1] != 0.0) || (discArrCash[0] == 0.0 && discArrCash[1] != 0.0))
                                        відмінитиЗнижкунадбавкуToolStripMenuItem.Text = "Скасувати націнку";
                                    if ((discArrPercent[0] != 0.0 && discArrPercent[1] == 0.0) || (discArrCash[0] != 0.0 && discArrCash[1] == 0.0))
                                        відмінитиЗнижкунадбавкуToolStripMenuItem.Text = "Скасувати знижку";
                                }
                            }

                            UpdateSumInfo(true);
                            break;
                        }
                        #endregion
                    case 0x13:
                        #region CONTROL + PageUp
                        {
                            if ((bool)DataWorkShared.ExtractBillProperty(this.Cheque, CoreConst.IS_LOCKED, false))
                            {
                                MMessageBox.Show("Поточний рахунок № " + DataWorkShared.ExtractBillProperty(this.Cheque, CoreConst.BILL_NO) + " надрукований клієнту.\r\nЗробіть з нього чек.",
                                    Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
                                break;//r
                            }

                            if (inventChq)
                                return;

                            if (!(ADMIN_STATE || UserConfig.Properties[3]))
                                if (admin.ShowDialog() != DialogResult.OK)
                                    return;

                            double discSUMA = 0;
                            try
                            {
                                discSUMA = (double)Cheque.Compute("Sum(SUM)", "USEDDISC = " + Boolean.TrueString);
                            }
                            catch { }
                            uiWndDiscountRequest d = new uiWndDiscountRequest(discSUMA, false);
                            d.SetDiscount(ref discArrPercent, ref discArrCash);
                            d.Dispose();

                            if (discArrPercent[0] == 0.0 && discArrPercent[1] == 0.0 && discArrCash[0] == 0.0 && discArrCash[1] == 0.0)
                                ResetDiscount();
                            else
                            {
                                відмінитиЗнижкунадбавкуToolStripMenuItem.Enabled = true;
                                if (AppConfig.APP_OnlyDiscount)
                                    відмінитиЗнижкунадбавкуToolStripMenuItem.Text = "Скасувати націнку";
                                else
                                {
                                    if ((discArrPercent[0] != 0.0 && discArrPercent[1] != 0.0) || (discArrCash[0] != 0.0 && discArrCash[1] != 0.0))
                                        відмінитиЗнижкунадбавкуToolStripMenuItem.Text = "Скасувати знижку і націнку";
                                    if ((discArrPercent[0] == 0.0 && discArrPercent[1] != 0.0) || (discArrCash[0] == 0.0 && discArrCash[1] != 0.0))
                                        відмінитиЗнижкунадбавкуToolStripMenuItem.Text = "Скасувати націнку";
                                    if ((discArrPercent[0] != 0.0 && discArrPercent[1] == 0.0) || (discArrCash[0] != 0.0 && discArrCash[1] == 0.0))
                                        відмінитиЗнижкунадбавкуToolStripMenuItem.Text = "Скасувати знижку";
                                }
                            }

                            UpdateSumInfo(true);
                            break;
                        }
                        #endregion
                    case 0x14:
                        #region SHIFT + DELETE
                        {
                            if ((bool)DataWorkShared.ExtractBillProperty(this.Cheque, CoreConst.IS_LOCKED, false))
                            {
                                MMessageBox.Show("Поточний рахунок № " + DataWorkShared.ExtractBillProperty(this.Cheque, CoreConst.BILL_NO) + " надрукований клієнту.\r\nЗробіть з нього чек.",
                                    Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
                                break;//r
                            }

                            if (inventChq)
                                return;

                            ResetDiscount();
                            UpdateSumInfo(true);
                            break;
                        }
                        #endregion
                    case 0x21:
                        {
                            //winapi.WApi.OutputDebugString("LINE FEED KEY HOT");
                            break;
                        }
                    case 0x20:
                        {
                            //winapi.WApi.OutputDebugString("RETURN KEY HOT");
                            break;
                        }
                    case 0x15:
                        #region ENTER
                        {
                            //if (   this.Cheque.ExtendedProperties.ContainsKey("BILL") && this.Cheque.ExtendedProperties["BILL"] != null && bool.Parse(((Dictionary<string, object>)this.Cheque.ExtendedProperties["BILL"])["IS_LOCKED"].ToString()))
                            if ((bool)DataWorkShared.ExtractBillProperty(this.Cheque, CoreConst.IS_LOCKED, false))
                            {
                                MMessageBox.Show("Поточний рахунок № " + DataWorkShared.ExtractBillProperty(this.Cheque, CoreConst.BILL_NO) + " надрукований клієнту.\r\nЗробіть з нього чек.",
                                    Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
                                break;//r
                            }
                            //for (int i = 0x10; i < 0x20; i++)
                            //AppFunc.UnregisterHotKey(this, i);

                            bool editWasClosed = false;

                            //winapi.WinAPI.OutputDebugString("Enter");

                            if (!UserConfig.Properties[22])
                                if (lastInputChar.AddMilliseconds(AppConfig.APP_ScannerCharReadFrequency) > DateTime.Now &&
                                    chararray != null && chararray.Length != 0)
                                {
                                    //if (chequeDGV.CurrentCell != null && chequeDGV.CurrentCell.IsInEditMode)
                                    //{
                                    //    if (chequeDGV.CurrentCell.EditedFormattedValue.ToString().Contains(chararray))
                                    //    {
                                    //        string val = chequeDGV.CurrentCell.EditedFormattedValue.ToString();
                                    //        int bcidx = val.IndexOf(chararray);
                                    //        val = val.Substring(0, bcidx);
                                    //        if (val == string.Empty)
                                    //            val = "0";
                                    //        chequeDGV.CurrentCell.Value = Convert.ToDouble(val);
                                    //    }
                                    //    chequeDGV.EndEdit();
                                    //    editWasClosed = true;
                                    //}

                                    // char filtering
                                    string newCharArray = string.Empty;
                                    foreach (char sci in this.chararray)
                                    {
                                        if (Char.IsLetter(sci) || Char.IsNumber(sci))
                                            newCharArray += sci;
                                    }

                                    //winapi.WApi.OutputDebugString("SEARCHING WITH BARCODE: [" + chararray + "]");
                                    SearchFilter(false, 2, true);
                                    SrchTbox.Text = newCharArray;
                                    SrchTbox.Select();
                                    this.chararray = string.Empty;
                                }

                            //close edit
                            if (chequeDGV.CurrentCell != null && chequeDGV.CurrentCell.IsInEditMode)
                            {
                                chequeDGV.EndEdit();
                                editWasClosed = true;
                            }

                            //lastInputChar = DateTime.Now;
                            //launch article property
                            if (chequeDGV.Focused && chequeDGV.RowCount != 0)
                            {
                                if (!(ADMIN_STATE || UserConfig.Properties[24]) && (DataWorkShared.ExtractBillProperty(this.Cheque, CoreConst.OWNER_NO, string.Empty).ToString() == string.Empty))
                                    if (admin.ShowDialog() != DialogResult.OK)
                                        return;

                                DataRow dRow = Cheque.Rows.Find(chequeDGV.CurrentRow.Cells["C"].Value);
                                Request req = new Request(dRow, CoreLib.GetDouble(dRow["TOT"]));
                                req.UpdateRowSource();
                                req.Dispose();
                                UpdateSumInfo(true);
                                break;//r
                            }

                            //Adding article to Cheque
                            if (articleDGV.Focused && articleDGV.RowCount != 0)
                            {
                                DataRow article = Articles.Rows.Find(articleDGV.CurrentRow.Cells["C"].Value);

                                if (!this._fl_isOk && this.Cheque.Rows.Count >= 3 && this.Cheque.Rows.Find(article["C"].ToString()) == null)
                                {
                                    MMessageBox.Show(this, "Ви не можете продавати більше позицій в демо-режимі", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
                                    break;
                                }

                                if (article != null)
                                    CoreLib.AddArticleToCheque(chequeDGV, articleDGV, article, AppConfig.APP_StartTotal, Articles);
                                break;//r
                            }
                            //winapi.WinAPI.OutputDebugString("srch: " + SrchTbox.Text);

                            //Searching
                            if (!editWasClosed && SrchTbox.Focused && SrchTbox.Text != string.Empty)
                            {
                                DataTable sTable = Articles.Clone();
                                bool allowToShow = false;
                                int i = 0;

                                //Debug.Write("BeginAdd");
                                #region search box
                                //winapi.WApi.OutputDebugString("SEARCH BOX TEXT: [" + SrchTbox.Text + "]");
                                if (SrchTbox.Text != "")
                                {
                                    switch (currSrchType)
                                    {
                                        case 0:
                                            {
                                                #region by name
                                                string[] words = SrchTbox.Text.Trim().Split(' ');
                                                DataRow[] dr1 = new DataRow[0];
                                                DataRow[] dr2 = new DataRow[0];
                                                DataTable dTable = (DataTable)articleDGV.DataSource;

                                                //string srchString = string.Empty;
                                                SrchTbox.Text = string.Empty;
                                                for (int l = 0; l < words.Length; l++)
                                                {
                                                    try
                                                    {
                                                        dr1 = dTable.Select("NAME Like '%" + words[l] + "%'");
                                                        dr2 = dTable.Select("DESC Like '%" + words[l] + "%'");
                                                    }
                                                    catch { }

                                                    sTable.Clear();
                                                    sTable.BeginLoadData();

                                                    if (dr1.Length > dr2.Length)
                                                    {
                                                        for (i = 0; i < dr1.Length; i++)
                                                            sTable.Rows.Add(dr1[i].ItemArray);
                                                    }
                                                    else
                                                    {
                                                        for (i = 0; i < dr2.Length; i++)
                                                            sTable.Rows.Add(dr2[i].ItemArray);
                                                    }

                                                    sTable.EndLoadData();

                                                    dTable = sTable.Copy();

                                                    if (dTable.Rows.Count > 0)
                                                    {
                                                        articleDGV.DataSource = dTable;
                                                        articleDGV.Select();
                                                        allowToShow = true;
                                                        SrchTbox.Text += words[l] + " ";
                                                        //SrchTbox.Select(0, srchString.Length);
                                                    }
                                                }

                                                if (SrchTbox.Text == string.Empty)
                                                //if (SrchTbox.SelectedText == string.Empty)
                                                {
                                                    MMessageBox.Show(this, "Нажаль нічого не вдалось знайти", "Результат пошуку",
                                                        MessageBoxButtons.OK, MessageBoxIcon.Information);
                                                    SearchFilter(false, AppConfig.APP_SearchType, true);
                                                }

                                                #endregion
                                                break;
                                            }
                                        case 1:
                                            {
                                                #region by id
                                                try
                                                {
                                                    DataRow[] dr = Articles.Select("ID Like \'" + SrchTbox.Text + "%\'");

                                                    if (dr.Length == 0)
                                                    {
                                                        MMessageBox.Show(this, "Нажаль нічого не вдалось знайти", "Результат пошуку", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                                        SearchFilter(false, AppConfig.APP_SearchType, true);
                                                        break;
                                                    }
                                                    if (dr.Length == 1)
                                                    {
                                                        SearchFilter(false, currSrchType, true);
                                                        CoreLib.AddArticleToCheque(chequeDGV, articleDGV, dr[0], AppConfig.APP_StartTotal, Articles);
                                                        allowToShow = false;
                                                        break;
                                                    }
                                                    else
                                                    {
                                                        sTable.Clear();
                                                        sTable.BeginLoadData();
                                                        for (i = 0; i < dr.Length; i++)
                                                            sTable.Rows.Add(dr[i].ItemArray);
                                                        sTable.EndLoadData();

                                                        articleDGV.DataSource = sTable;
                                                        articleDGV.Select();
                                                        allowToShow = true;
                                                    }

                                                }
                                                catch
                                                {
                                                    SrchTbox.Focus();
                                                    SrchTbox.SelectAll();
                                                }
                                                #endregion
                                                break;
                                            }
                                        case 2:
                                            {
                                                #region by bc
                                                try
                                                {
                                                    string _bcvalue = SrchTbox.Text.Trim('C', ' ');
                                                    allowToShow = BCSearcher(_bcvalue, true);
                                                }
                                                catch (FormatException)
                                                {
                                                    SrchTbox.Focus();
                                                    SrchTbox.SelectAll();
                                                }
                                                #endregion
                                                break;
                                            }
                                    }
                                }
                                #endregion

                                if (splitContainer1.Panel2Collapsed && allowToShow)
                                {
                                    вікноТоварівToolStripMenuItem.PerformClick();
                                    splitContainer1.Panel2.Tag = new object();
                                    articleDGV.Select();
                                }

                                articleDGV.Update();
                                //Debug.Write("EndAdd");
                            }

                            break;
                        }
                        #endregion
                    case 0x16:
                        #region CONTROL + ENTER
                        {
                            if (inventChq || Cheque.Rows.Count == 0)
                                break;//r

                            if (!(ADMIN_STATE || UserConfig.Properties[23]))
                            {
                                //if (admin.ShowDialog() != DialogResult.OK)
                                MMessageBox.Show(this, "Закриття чеку заблоковано", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
                                break;//r
                            }

                            // if we use legal printer
                            if (Program.Service.UseEKKR)
                            {
                                // we close legal cheque
                                CloseCheque(true);
                            }
                            else
                            {
                                // if we don't use legal printer and
                                // if we allow to close normal cheque or admin mode is active
                                if (UserConfig.Properties[6])
                                {
                                    // we close normal cheque
                                    CloseCheque(false);
                                }
                                else
                                    MMessageBox.Show(this, "Закриття чеку заблоковано", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
                            }

                            break;
                        }
                        #endregion
                    case 0x17:
                        #region CONTROL + SHIFT + ENTER
                        {
                            if (inventChq)
                                break;//r

                            if (Cheque.Rows.Count == 0 && UserConfig.Properties[12])
                            {
                                string nextChqNom = string.Empty;
                                object[] localData = CoreLib.NonFxChqsInfo(0, ref nextChqNom);
                                DDM_Status.Text = string.Format("За {1} продано {0} чек(ів) на суму {2:F" + AppConfig.APP_MoneyDecimals + "}", localData[0], localData[1], CoreLib.GetDouble(localData[2].ToString()));
                                break;//r
                            }

                            if (Cheque.Rows.Count == 0)// || !Program.Service.UseEKKR)
                                break;//r

                            if (!(ADMIN_STATE || (UserConfig.Properties[23] && UserConfig.Properties[6]) ))
                            {
                                MMessageBox.Show(this, "Закриття чеку заблоковано", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
                                break;
                            }

                            if (AppConfig.Content_Common_PromptMsgOnIllegal &&
                                DialogResult.Yes != MMessageBox.Show(this, "Закрити чек без фіксації оплати",
                                Application.ProductName,
                                MessageBoxButtons.YesNo,
                                MessageBoxIcon.Question,
                                MessageBoxDefaultButton.Button1))
                                break;//r
                            /*
                            if (!(ADMIN_STATE || (UserConfig.Properties[23] && UserConfig.Properties[6])))
                                if (admin.ShowDialog() != DialogResult.OK)
                                    break;//r
                            */
                            CloseCheque(false);
                            break;
                        }
                        #endregion
                    case 0x18:
                        #region F5
                        {
                            if (!AppConfig.APP_SrchTypesAccess[0])
                            {
                                MMessageBox.Show(this, "Пошук по назві не дозволений", Application.ProductName,
                                    MessageBoxButtons.OK, MessageBoxIcon.Error);
                                break;//r
                            }

                            if (currSrchType != 0)
                                SearchFilter(false, 0, true);
                            else
                            {
                                SrchTbox.Focus();
                                SrchTbox.Select(SrchTbox.Text.Length, 0);
                            }
                            break;
                        }
                        #endregion
                    case 0x19:
                        #region F6
                        {
                            if (!AppConfig.APP_SrchTypesAccess[1])
                            {
                                MMessageBox.Show(this, "Пошук по коду не дозволений", Application.ProductName,
                                    MessageBoxButtons.OK, MessageBoxIcon.Error);
                                break;//r
                            }

                            if (currSrchType != 1)
                                SearchFilter(false, 1, true);
                            else
                            {
                                SrchTbox.Focus();
                                SrchTbox.Select(SrchTbox.Text.Length, 0);
                            }
                            break;
                        }
                        #endregion
                    case 0x1A:
                        #region F7
                        {
                            //winapi.WinAPI.OutputDebugString("F7");
                            if (!AppConfig.APP_SrchTypesAccess[2])
                            {
                                MMessageBox.Show(this, "Пошук по штрих-коду не дозволений", Application.ProductName,
                                    MessageBoxButtons.OK, MessageBoxIcon.Error);
                                break;//r
                            }

                            if (currSrchType != 2)
                                SearchFilter(false, 2, true);
                            else
                            {
                                SrchTbox.Focus();
                                SrchTbox.Select(0, SrchTbox.Text.Length);
                            }
                            break;
                        }
                        #endregion
                    case 0x1B:
                        #region F8
                        {
                            if (Cheque.ExtendedProperties.Contains("BILL"))
                                MMessageBox.Show(this, "Відкритий рахунок №" + " " + Cheque.ExtendedProperties["NOM"], Application.ProductName,
                                    MessageBoxButtons.OK, MessageBoxIcon.Information);
                            break;
                        }
                        #endregion
                    case 0x1C:
                        #region F9
                        {
                            string infoText = string.Empty;
                            UserSchema us = new UserSchema();
                            infoText += UserConfig.UserID;
                            infoText += "\r\n\r\n--------------------------------------------------\r\n\r\n";
                            for (int i = 0; i < UserSchema.ITEMS_COUNT; i++)
                                infoText += us.SchemaItems[i] + " : " + (UserConfig.Properties[i] ? "Так" : "Ні") + "\r\n";
                            MMessageBox.Show(infoText, UserConfig.UserID);
                            break;
                        }
                        #endregion
                    case 0x1D:
                        #region ESCAPE
                        {
                            SearchFilter(false, AppConfig.APP_SearchType, true);
                            break;
                        }
                        #endregion
                    case 0x1E:
                        #region CONTROL + Q
                        {
                            if (inventChq)
                                break;//r

                            nakladna = !nakladna;

                            if (nakladna)
                                CashLbl.Image = Properties.Resources.naklad;
                            else
                                CashLbl.Image = null;
                            break;
                        }
                        #endregion
                    case 0x1F:
                        #region CONTROL
                        {
                            if (chequeDGV.CurrentCell != null && chequeDGV.CurrentCell.IsInEditMode)
                                chequeDGV.EndEdit();
                            break;
                        }
                        #endregion
                }
                #endregion
                //winapi.Funcs.OutputDebugString("W");
            }

            if (m.Msg == (int)CoreLib.MyMsgs.WM_UPDATE)
            {
                if (_fl_canUpdate)
                    this.timer1_Tick(this.timer1, EventArgs.Empty);
            }
        }