/// <summary>
        /// connection String Process
        /// </summary>
        public static void connect()
        {
            classConnection m = connStringData();
            string          connectionString;

            connectionString = "SERVER=" + m.host + ";" + "DATABASE=" +
                               m.dbname + ";" + "UID=" + m.username + ";" + "PASSWORD="******";";
            conn = new MySqlConnection(connectionString);
            //MessageBox.Show("Success");
        }
        /// <summary>
        /// ConnStringData
        /// </summary>
        /// <returns></returns>
        public static classConnection connStringData()
        {
            classConnection ret = new classConnection();

            ret.host     = ConfigurationManager.AppSettings["connHost"];
            ret.dbname   = ConfigurationManager.AppSettings["conndbName"];
            ret.username = ConfigurationManager.AppSettings["connUsername"];
            ret.password = ConfigurationManager.AppSettings["connPassword"];
            return(ret);
        }
        private void OnBarcodeKeyDown(object sender, System.Windows.Input.KeyEventArgs e)
        {
            if (e.Key == Key.Enter)
            {
                try
                {
                    classConnection con = new classConnection();

                    SqlCommand command = new SqlCommand(@$ "select Item.ItemId,Item.ItemTypeId,Item.Barcode, Item.CommericalName, ItemType.TypeName from Item inner join ItemType 
                                                    on Item.ItemTypeId = ItemType.ItemTypeId where Item.Barcode={inBarcode.Text} ", classConnection.con);
                    classConnection.con.Open();
                    SqlDataReader reader = command.ExecuteReader();
                    if (reader.Read())
                    {
                        if (reader.HasRows)
                        {
                            ItemId     = int.Parse(reader[0].ToString());
                            ItemTypeId = int.Parse(reader[1].ToString());
                            Barcode    = reader[2].ToString();

                            inBarcode.Text = reader[2].ToString();
                            inItem.Text    = reader[3].ToString();
                            inType.Text    = reader[4].ToString();
                        }
                        else
                        {
                            MessageBox.Show("کاڵای بەردەستمان نیە لەم بارکۆدەیا");
                            inBarcode.Text = "";
                        }
                        classConnection.con.Close();
                    }
                    else
                    {
                        MessageBox.Show("هیچ کاڵایەکی نەهێنا");
                        inBarcode.Text = "";
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                    MessageBox.Show("بەهەڵە ئەنجام درا تکایە دووبارە هەوڵ بەەەوە");
                    inBarcode.Text = "";
                }
            }
        }
 private async void Window_Loaded(object sender, RoutedEventArgs e)
 {
     try
     {
         if (_isStore == 1)
         {
             classConnection con     = new classConnection();
             SqlCommand      command = new SqlCommand($"select from ");
             return;
         }
         if (_isAdd)
         {
             buttonDelete.Visibility = Visibility.Collapsed;
         }
         else
         {
             buysUp     = dotNETConnection.ConvertSqlToList <Models.Store.Buy>($"select * from Buy where BuyId={_buyId}");
             ItemId     = buysUp.FirstOrDefault().ItemId;
             ItemTypeId = buysUp.FirstOrDefault().ItemTypeId;
             itemTypes  = dotNETConnection.ConvertSqlToList <Models.ItemType>($"select * from ItemType where ItemTypeId={buysUp.FirstOrDefault().ItemTypeId}");
             Query q = new Query();
             inBuyPrice.Text       = buysUp.FirstOrDefault().BuyPrice.ToString();
             inBarcode.Text        = buysUp.FirstOrDefault().Barcode.ToString();
             inSellPrice.Text      = buysUp.FirstOrDefault().SellPrice.ToString();
             inQuantity.Text       = buysUp.FirstOrDefault().Quantity.ToString();
             inExpire.SelectedDate = buysUp.FirstOrDefault().Expire;
             inType.Text           = itemTypes.FirstOrDefault().TypeName;
             inItem.Text           = await q.GetOne("SELECT ScienceName FROM Item WHERE ItemTypeId=@id AND ItemId=@iid", new string[, ] {
                 { "@id", buysUp.FirstOrDefault().ItemTypeId.ToString() }, { "@iid", buysUp.FirstOrDefault().ItemId.ToString() }
             });
         }
     }
     catch (Exception EX)
     {
         MessageBox.Show(EX.Message);
         MessageBox.Show("هەڵەیەک ڕووی دا تکایە دووبارە هەوڵ بەرەوە");
         this.Close();
     }
 }