private void PairMaterial(int row, int planID)
        {
            DataGridView dgv = dgvMatList;

            string parentCode = "";
            //get parent code by searching plain id in mat_plan db
            DataTable dt_Plan = dalPlan.idSearch(planID.ToString());


            foreach (DataRow row_Plan in dt_Plan.Rows)
            {
                parentCode = row_Plan[dalItem.ItemCode].ToString();
            }

            uJoin.join_parent_code = parentCode;

            uJoin.join_child_code = "";

            uJoin.join_qty = 1;
            uJoin.join_max = 1;
            uJoin.join_min = 1;

            frmJoinEdit frm = new frmJoinEdit(uJoin, true);

            frm.StartPosition = FormStartPosition.CenterScreen;
            frm.ShowDialog();//Item Edit
            LoadMatList();

            dgvMatList.FirstDisplayedScrollingRowIndex = row;
            dgvMatList.Rows[row].Selected = true;
        }
Example #2
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            txtSearch.Clear();
            frmJoinEdit frm = new frmJoinEdit();

            frm.StartPosition = FormStartPosition.CenterScreen;
            frm.ShowDialog();//Item Edit
            loadData();
        }
Example #3
0
        private void dgvJoin_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            int row = e.RowIndex;

            currentRowIndex = row;
            DataGridView dgv = dgvJoin;

            uJoin.join_parent_code = dgv.Rows[row].Cells[headerParentCode].Value.ToString();

            uJoin.join_child_code = dgv.Rows[row].Cells[headerChildCode].Value.ToString();

            uJoin.join_qty = Convert.ToSingle(dgv.Rows[row].Cells[headerQty].Value.ToString());
            uJoin.join_max = Convert.ToInt16(dgv.Rows[row].Cells[headerMax].Value.ToString());
            uJoin.join_min = Convert.ToInt16(dgv.Rows[row].Cells[headerMin].Value.ToString());

            txtSearch.Clear();
            frmJoinEdit frm = new frmJoinEdit(uJoin, false);

            frm.StartPosition = FormStartPosition.CenterScreen;
            frm.ShowDialog();//Item Edit
            loadData();
        }