Ejemplo n.º 1
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)
                { }
            }
        }
Ejemplo n.º 2
0
        private DTO.LIST_QD_SCHEMAInfo GetDataFromForm(DTO.LIST_QD_SCHEMAInfo inf)
        {
            inf.CONN_ID      = _db;
            inf.DEFAULT_CONN = ddlQD.Text;
            inf.DESCRIPTN    = txtDescription.Text;
            inf.LOOK_UP      = txtLookup.Text;
            inf.UPDATED      = DateTime.Today.Year * 10000 + DateTime.Today.Month * 100 + DateTime.Today.Day;
            //if (inf.FIELD_TEXT != "")
            //{
            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"], XmlEncode(jrow["lookup"].ToString()));
            }
            from = tmp;

            inf.FIELD_TEXT = field;
            inf.FROM_TEXT  = Form_QD.StringToBase64(from);

            inf.SCHEMA_ID     = txtCode.Text;
            inf.SCHEMA_STATUS = ckbUse.Checked ? "Y" : "N";
            inf.DAG           = Group.Text;
            return(inf);
        }