Пример #1
0
 private void FrmTransferOut_Load(object sender, EventArgs e)
 {
     if (_type == "QD")
     {
         BUS.LIST_QDControl control = new BUS.LIST_QDControl();
         dt = control.GetTransferOut_LIST_QD(_db, QD_CODE, ref sErr);
     }
     else if (_type == "QDADD")
     {
         BUS.LIST_QD_SCHEMAControl control = new BUS.LIST_QD_SCHEMAControl();
         if (QD_CODE != "")
         {
             DTO.LIST_QD_SCHEMAInfo inf = control.Get(_db, QD_CODE, ref sErr);
             dt = inf.ToDataTable();
             dt.Rows.Add(inf.ToDataRow(dt));
             dt.TableName = "Table";
         }
         else
         {
             dt = control.GetAll(_db, ref sErr);
         }
     }
     else if (_type == "TASK")
     {
         BUS.LIST_TASKControl control = new BUS.LIST_TASKControl();
         if (QD_CODE != "")
         {
             DTO.LIST_TASKInfo inf = control.Get(_db, QD_CODE, ref sErr);
             dt = DTO.LIST_TASKInfo.ToDataTable();
             dt.Rows.Add(inf.ToDataRow(dt));
             dt.TableName = "Table";
         }
         else
         {
             dt = control.GetAll(_db, ref sErr);
         }
     }
     else if (_type == "POD")
     {
         BUS.PODControl control = new BUS.PODControl();
         if (QD_CODE != "")
         {
             DTO.PODInfo inf = control.Get(QD_CODE, ref sErr);
             dt = DTO.PODInfo.ToDataTable();
             dt.Rows.Add(inf.ToDataRow(dt));
             dt.TableName = "Table";
         }
         else
         {
             dt = control.GetAll(ref sErr);
         }
     }
     dtEnd = dt.Copy();
     radGridView1.DataSource = dtEnd;
     radGridView1.RetrieveStructure();
 }
Пример #2
0
        private void btnRefresh_Click(object sender, EventArgs e)
        {
            string sErr = "";

            BUS.LIST_QD_SCHEMAControl ctr = new BUS.LIST_QD_SCHEMAControl();
            DataTable dt = ctr.GetAll(_conn_ID, ref sErr);

            dt.Columns["SCHEMA_ID"].ColumnName = "Code";
            //dgvQDADDView.AutoGenerateColumns = false;
            dgvQDADDView.DataSource = dt;
            //dgvQDADDView.AutoSizeColumns();
            SaveLayout(dgvQDADDView);
        }
Пример #3
0
        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            string sErr = "";

            BUS.LIST_QD_SCHEMAControl ctr = new BUS.LIST_QD_SCHEMAControl();
            DataTable dt = ctr.GetAll(_db, ref sErr);

            foreach (DataRow row in dt.Rows)
            {
                DTO.LIST_QD_SCHEMAInfo inf = new DTO.LIST_QD_SCHEMAInfo(row);
                try
                {
                    if (inf.FROM_TEXT[0] == '<')
                    {
                    }
                    _data.Tables["_TableName"].Rows.Clear();
                    _data.Tables["fromcode"].Rows.Clear();
                    _data = ReadScheme(inf);
                    DataTable dtfield = _data.Tables["_TableName"];
                    string    field   = "<?xml version=\"1.0\" encoding=\"utf-8\" ?><SUN_SCHEMA>{0}</SUN_SCHEMA>";
                    string    tmp     = "";
                    string    from    = "";
                    foreach (DataRow jrow in dtfield.Rows)
                    {
                        tmp += string.Format("<row table=\"{0}\" node=\"{1}\" name=\"{2}\" nodeDesc=\"{3}\" type=\"{4}\" conn_id=\"{5}\"/>", jrow["table"], jrow["node"], jrow["name"], jrow["nodeDesc"], jrow["type"], inf.DEFAULT_CONN);
                    }
                    DataTable dtfrom = _data.Tables["fromcode"];
                    field = string.Format(field, tmp);
                    tmp   = "";
                    foreach (DataRow jrow in dtfrom.Rows)
                    {
                        tmp += string.Format("<row fromcode=\"{0}\" lookup=\"{1}\"/> ", jrow["fromcode"], frmQDADD.XmlEncode(jrow["lookup"].ToString()));
                    }
                    from = tmp;

                    //result = doc.InnerXml;
                    inf.FIELD_TEXT = field;
                    inf.FROM_TEXT  = Form_QD.StringToBase64(from);
                    ctr.Update(inf);
                }
                catch (Exception ex)
                { }
            }
        }
Пример #4
0
        private void frmLookup_Load(object sender, EventArgs e)
        {
            string sErr = "";

            BUS.LIST_QD_SCHEMAControl ctr = new BUS.LIST_QD_SCHEMAControl();
            DataTable dt = ctr.GetAll(_db, ref sErr);

            if (_conn_ID != "")
            {
                dt.DefaultView.RowFilter = "DEFAULT_CONN='" + _conn_ID + "'";
            }
            dt.Columns["SCHEMA_ID"].ColumnName = "Code";
            //dgvQDADDView.AutoGenerateColumns = false;
            string DAField = "DAG";

            if (_user != "TVC")
            {
                sErr = BUS.LIST_DAControl.SetDataAccessGroup(DAField, dt, _user);
            }
            LoadDataGrid(dgvQDADDView, dt);
        }