Пример #1
0
        //private void Main_Load(object sender, EventArgs e)
        //{

        //    Program.LoggedInUser = new Core.Domain.User { Admin = true, FirstName = "Test", MiddleName = "Mid", LastName = "tester", EmailAddress = "*****@*****.**" }; //TODO: Remove this
        //   // stri

        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                if (InventoryentryService.ApproveNewStock((comboBox1.SelectedItem as ComboboxItem).Value.ToString()) == "0")
                {
                    UserService.UpdateItemStock((comboBox1.SelectedItem as ComboboxItem).Value.ToString(), int.Parse(textBox1.Text));
                    ItemName("c");
                }
                else
                {
                    MessageBox.Show("You have already input new stock");
                }
                Main mm = new Main();
                this.RefreshDgv();
                textBox1.Clear();
            }
            catch { }
            //  this.Close();
            // this.Hide();
        }
Пример #2
0
        public static void InsertInventoryID(string id)
        {
            try
            {
                CloseInventory();
                InventoryentryService.InsertInventoryClosed0();
                using (MySqlConnection con = new MySqlConnection(DatabaseHelper.GetSQLiteConnectionString()))
                {
                    con.Open();
                    string query = "";

                    query = $"INSERT INTO inventory(DateCreated,Deleted,UserId) " +
                            $"VALUES('{DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss")}','0','" + id + "')";
                    MySqlCommand    cmd        = new MySqlCommand(query, con);
                    MySqlDataReader dataReader = cmd.ExecuteReader();



                    con.Close();
                }
            }
            catch { }
        }