Exemple #1
0
 public frmValidatedList(string db, string usr, objValidatedList value)
 {
     InitializeComponent();
     _db        = db;
     _usr       = usr;
     _objReturn = value;
 }
Exemple #2
0
 private BUS.IMPORT_SCHEMAControl AddValidatedList(BUS.IMPORT_SCHEMAControl _importCtr, string db, string xml)
 {
     _importCtr.ListV.Clear();
     _importCtr.LKey.Clear();
     _importCtr.DtStruct = BUS.IMPORT_SCHEMAControl.GetStruct(xml);
     foreach (DataRow row in _importCtr.DtStruct.Rows)
     {
         if ((row["Tag"] != DBNull.Value && row["Tag"].ToString() != "") || (row["IsNull"] == DBNull.Value || row["IsNull"].ToString() == "False"))
         {
             if (row["Tag"] != DBNull.Value && row["Tag"].ToString() != "")
             {
                 objValidatedList objVal   = new objValidatedList(row["Tag"]);
                 ValueList        validate = new ValueList();
                 if (row["IsNull"] != DBNull.Value && row["IsNull"].ToString() == "True")
                 {
                     validate.IsNull = true;
                 }
                 else
                 {
                     validate.IsNull = false;
                 }
                 validate.Key     = row["Key"].ToString();
                 validate.Message = objVal.Message;
                 BUS.LIST_QDControl      ctr  = new BUS.LIST_QDControl();
                 DTO.LIST_QDInfo         inf  = ctr.Get_LIST_QD(db, objVal.QD, ref _sErr);
                 QueryBuilder.SQLBuilder sqlB = QueryBuilder.SQLBuilder.LoadSQLBuilderFromDataBase(inf.QD_ID, inf.DTB, inf.ANAL_Q0);
                 sqlB.StrConnectDes = Form_QD._strConnectDes;
                 DataTable dt = sqlB.BuildDataTable(inf.SQL_TEXT);
                 foreach (DataRow aRow in dt.Rows)
                 {
                     if (!validate.Content.Contains(aRow[objVal.Field].ToString().Trim()))
                     {
                         validate.Content.Add(aRow[objVal.Field].ToString().Trim());
                     }
                 }
                 _importCtr.ListV.Add(validate);
             }
             else
             {
                 ValueList validate = new ValueList();
                 //if (row["IsNull"] == DBNull._Value || row["IsNull"].ToString() == "False")
                 validate.IsNull = false;
                 validate.Key    = row["Key"].ToString();
                 _importCtr.ListV.Add(validate);
             }
         }
         if (row["PrimaryKey"].ToString() == "True")
         {
             _importCtr.LKey.Add(row["Key"].ToString());
         }
     }
     return(_importCtr);
 }
Exemple #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (ddlQD.Text != "" && ddlFld.Text != "")
            {
                DialogResult = DialogResult.OK;

                _objReturn = new objValidatedList(ddlQD.Text, ddlFld.Text, txtMessage.Text);
            }
            else
            {
                DialogResult = DialogResult.Cancel;
            }
            Close();
        }
Exemple #4
0
        private void dgvField_MouseUp(object sender, MouseEventArgs e)
        {
            GridEXColumn col    = dgvField.ColumnFromPoint(e.X, e.Y);
            int          rowInx = dgvField.RowPositionFromPoint(e.X, e.Y);

            if (rowInx >= 0 && col != null && col.Key == "Tag")
            {
                objValidatedList obj = null;
                frmValidatedList frm;
                if (dgvField.GetRow(rowInx).Cells[col].Value != DBNull.Value)
                {
                    obj = new objValidatedList(dgvField.GetRow(rowInx).Cells[col].Value);
                    frm = new frmValidatedList(txtdatabase.Text, Form_QD._user, obj);
                }
                else
                {
                    frm = new frmValidatedList(txtdatabase.Text, Form_QD._user);
                }
                if (frm.ShowDialog() == DialogResult.OK)
                {
                    dgvField.GetRow(rowInx).Cells[col].Value = frm.ObjReturn;
                }
            }
        }