Exemplo n.º 1
0
        private void btn_add_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            frm_units frm = new frm_units();

            DataRow[] row;
            row = dt_units.Select("min_unit='1'");
            frm_units.buyprice  = Convert.ToDecimal(row[0]["buy_price"].ToString());
            frm_units.sellprice = Convert.ToDecimal(row[0]["sell_price"].ToString());
            frm.ShowDialog();
        }
Exemplo n.º 2
0
        private void repositoryItemButtonEdit2_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            if (gridView2.SelectedRowsCount == 0)
            {
                return;
            }
            int       row        = gridView2.FocusedRowHandle;
            string    currentrow = gridView2.GetRowCellValue(row, "min_unit").ToString();
            frm_units frm        = new frm_units();

            frm.retrndata(currentrow);
            frm.ShowDialog();
        }
Exemplo n.º 3
0
        private void btn_edit_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            if (gridView2.SelectedRowsCount == 0)
            {
                return;
            }

            int       min_unit   = int.Parse(gridView2.GetFocusedRowCellValue("min_unit").ToString());
            int       row        = gridView2.FocusedRowHandle;
            string    currentrow = gridView2.GetRowCellValue(row, "min_unit").ToString();
            frm_units frm        = new frm_units();

            frm.retrndata(currentrow);
            if (min_unit == 1)
            {
                frm.min_unit = true;
            }
            else
            {
                frm.min_unit = false;
            }

            frm.ShowDialog();
        }