Exemplo n.º 1
0
        private void btn_Pro_Imp_Save_Click(object sender, EventArgs e)
        {
            int i;
            int d = dt.Rows.Count;

            dt.Columns.RemoveAt(dt.Columns.Count - 1);
            dt.Columns.RemoveAt(dt.Columns.Count - 1);
            dt.Columns.Add("stock_id", typeof(int));
            int max = StoreProcedure.fn_get_stock_max();

            for (i = 0; i < d; i++)
            {
                dt.Rows[i]["stock_id"] = max;
                max++;
            }
            DateTime imp_date = DateTime.Parse(dtp_Pro_Imp_Day.Text);

            StoreProcedure.sp_insert_product(dt, imp_date.ToString("yyyy-MM-dd"));
            this.Close();
            Thread th = new Thread(openProduct);

            th.SetApartmentState(ApartmentState.STA);
            th.Start();
        }
Exemplo n.º 2
0
 private void btn_Expense_Year_Click(object sender, EventArgs e)
 {
     dgv_Expense.DataSource = StoreProcedure.sp_get_expense("yearly");
 }
Exemplo n.º 3
0
 private void btn_Reg_Pat_Save_Click(object sender, EventArgs e)
 {
     txtRandomNumber.Text = string.Format("{0}{1}", txtId.Text, rnd.Next(1000, 9999).ToString());
     StoreProcedure.spd_insert_patDoc(int.Parse(txtId.Text), txtRandomNumber.Text, txtId.Text.Length);
     //MessageBox.Show(string.Format("{0}  {1}",txtRandomNumber.Text.Substring(0,txtId.Text.Length), txtRandomNumber.Text.Substring(txtId.Text.Length)));
 }