Example #1
0
        private void EditButton_Click(object sender, EventArgs e)
        {
            HPS.BLL.TrafficTypeBLL.BLLTrafficType_TFactory TrafficTypeFactory = new HPS.BLL.TrafficTypeBLL.BLLTrafficType_TFactory();
            string condition = "[TrafficType_T].[TrafficType_nvc]='" + TrafficTypeGridView.CurrentRow.Cells[colTrafficType_nvc.Name].Value + "'";
            List <HPS.BLL.TrafficTypeBLL.BLLTrafficType_T> lst = TrafficTypeFactory.GetAllByCondition(condition);
            int flag = 0;

            foreach (HPS.BLL.TrafficTypeBLL.BLLTrafficType_T item in lst)
            {
                if (item.TrafficTypeID_int == 1 || item.TrafficTypeID_int == 2)
                {
                    flag = 1;
                }
            }
            if (flag != 1)
            {
                HPS.BLL.TrafficTypeBLL.BLLTrafficType_TKeys TrafficTypeKey = new HPS.BLL.TrafficTypeBLL.BLLTrafficType_TKeys();
                TrafficTypeKey.TrafficTypeID_int = (Int32?)this.TrafficTypeGridView.CurrentRow.Cells["colTrafficTypeID_int"].Value;
                TrafficTypeEntityForm TrafficType = new TrafficTypeEntityForm(BaseEntityForm1.enmState.Edit, (DataTable)this.TrafficTypeGridView.DataSource, TrafficTypeKey);
                TrafficType.ShowDialog();
            }
        }
Example #2
0
        private void NewButton_Click(object sender, EventArgs e)
        {
            TrafficTypeEntityForm TrafficType = new TrafficTypeEntityForm((DataTable)this.TrafficTypeGridView.DataSource);

            TrafficType.ShowDialog();
        }