Esempio n. 1
0
 private void btnEditStep_Click(object sender, EventArgs e)
 {
     try
     {
         int focus   = TextUtils.ToInt(grvData.FocusedRowHandle);
         int idStock = TextUtils.ToInt(grvData.GetFocusedRowCellValue(colStockID));
         AssemblyStockModel stock = (AssemblyStockModel)AssemblyStockBO.Instance.FindByPK(idStock);
         int id = TextUtils.ToInt(grvData.GetFocusedRowCellValue(colID));
         if (id == 0)
         {
             return;
         }
         StockCDModel model = (StockCDModel)StockCDBO.Instance.FindByPK(id);
         frmCD        frm   = new frmCD();
         frm._Stock   = stock;
         frm._StockCD = model;
         if (frm.ShowDialog() == DialogResult.OK)
         {
             loadStep();
             grvData.FocusedRowHandle = focus;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, TextUtils.Caption, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Esempio n. 2
0
        private void btnAddStep_Click(object sender, EventArgs e)
        {
            frmCD frm = new frmCD();

            frm._AddNew = 1;
            if (frm.ShowDialog() == DialogResult.OK)
            {
                loadStep();
                grvData.FocusedRowHandle = grvData.RowCount - 1;
            }
        }
Esempio n. 3
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            int id = TextUtils.ToInt(treeData.FocusedNode.GetValue(colIDTree));

            if (id == 0)
            {
                return;
            }
            AssemblyStockModel model = (AssemblyStockModel)AssemblyStockBO.Instance.FindByPK(id);
            frmCD frm = new frmCD();

            frm._Stock = model;
            if (frm.ShowDialog() == DialogResult.OK)
            {
                LoadInfoSearch();
                grvData.FocusedRowHandle = grvData.RowCount - 1;
            }
        }
Esempio n. 4
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            int focus = TextUtils.ToInt(grvData.FocusedRowHandle);
            int id    = TextUtils.ToInt(treeData.FocusedNode.GetValue(colIDTree));
            int CDID  = TextUtils.ToInt(grvData.GetFocusedRowCellValue(colID));

            if (id == 0 || CDID == 0)
            {
                return;
            }
            AssemblyStockModel model = (AssemblyStockModel)AssemblyStockBO.Instance.FindByPK(id);

            StockCDModel model1 = (StockCDModel)StockCDBO.Instance.FindByPK(CDID);
            frmCD        frm    = new frmCD();

            frm._Stock   = model;
            frm._StockCD = model1;
            if (frm.ShowDialog() == DialogResult.OK)
            {
                LoadInfoSearch();
                grvData.FocusedRowHandle = focus;
                //grvData.SelectRow(focus);
            }
        }