コード例 #1
0
        private void menuItem6_Click(object sender, EventArgs e)
        {
            TextEditable textEditable = new TextEditable();

            textEditable.valueEdit = Config.API_URL;
            textEditable.ShowDialog();
            Config.API_URL = textEditable.valueEdit.Trim();
        }
コード例 #2
0
        private void dgCuonList_Click(object sender, EventArgs e)
        {
            try
            {
                int index_column_quant  = 0;
                int index_column_del    = 0;
                int index_column_status = 0;
                foreach (DataColumn item in dtList.Columns)
                {
                    if (item.ColumnName == COL_QUANT)
                    {
                        break;
                    }
                    index_column_quant++;
                }
                foreach (DataColumn item in dtList.Columns)
                {
                    if (item.ColumnName == COL_DEL)
                    {
                        break;
                    }
                    index_column_del++;
                }
                foreach (DataColumn item in dtList.Columns)
                {
                    if (item.ColumnName == COL_STATUS)
                    {
                        break;
                    }
                    index_column_status++;
                }

                DataGridCell row = dgCuonList.CurrentCell;
                //MessageBox.Show(row.ColumnNumber.ToString());
                if (row.ColumnNumber == index_column_del)
                {
                    dtList.Rows[row.RowNumber].Delete();
                    this._ListSpace.RemoveAt(row.RowNumber);
                    dgCuonList.Refresh();
                }
                else if (row.ColumnNumber == index_column_quant)
                {
                    TextEditable textEditable = new TextEditable();
                    textEditable.valueEdit = Convert.ToString(dtList.Rows[row.RowNumber][COL_QUANT]);
                    textEditable.ShowDialog();
                    try
                    {
                        double value = Convert.ToDouble(textEditable.valueEdit);
                        dtList.Rows[row.RowNumber][COL_QUANT]  = value;
                        _ListSpace[row.RowNumber].realQuantity = value;
                        dgCuonList.Refresh();
                    }
                    catch { MessageBox.Show("Wrong format input !"); }
                }
                else if (row.ColumnNumber == index_column_status)
                {
                    if (dtList.Rows[row.RowNumber][COL_STATUS].ToString().Length > 0)
                    {
                        MessageBox.Show("Package/Uid duplicate !");
                    }
                }
            }
            catch { }
        }