Beispiel #1
0
        private void button4_Click(object sender, EventArgs e)
        {
            Querytemplate curTemplate = this.listBox1.SelectedItem as Querytemplate;

            if (curTemplate != null)
            {
                queryTaemplate.Remove(curTemplate);
                queryTaemplate.Save();
            }
        }
        private void applyTemplate(object sender, EventArgs e)
        {
            Querytemplate curTemplate = this.listBox1.SelectedItem as Querytemplate;

            if (curTemplate != null)
            {
                C1FlexGrid  flex = this.c1FlexGrid1;
                XmlDocument doc  = new XmlDocument();
                doc.LoadXml(curTemplate.XMLTEXT);

                foreach (Row r in flex.Rows)
                {
                    if (r.Index > 0)
                    {
                        r.Clear(ClearFlags.Content);
                    }
                }

                int row = 1;
                foreach (XmlNode item in doc.ChildNodes[0])
                {
                    int col = 0;
                    foreach (XmlNode subitem in item.ChildNodes)
                    {
                        flex[row, col] = subitem.InnerText;
                        col++;
                    }
                    row++;
                }

                for (int iRow = 1; iRow < this.c1FlexGrid1.Rows.Count; iRow++)
                {
                    string fieldName = getCellString(iRow, 2);
                    if (fieldName != "")
                    {
                        foreach (var item in queryEntity)
                        {
                            if (item.FieldDispaly == fieldName)
                            {
                                CellStyle style = this.c1FlexGrid1.Styles[item.FieldType];
                                this.c1FlexGrid1.SetCellStyle(iRow, 4, style);
                                CellStyle style2 = this.c1FlexGrid1.Styles[item.FieldType + "_RelationOp"];
                                this.c1FlexGrid1.SetCellStyle(iRow, 3, style2);
                                break;
                            }
                        }
                    }
                    else
                    {
                        this.c1FlexGrid1[iRow, 3] = null;
                        this.c1FlexGrid1[iRow, 4] = null;
                    }
                }
            }
        }
Beispiel #3
0
        private void button3_Click(object sender, EventArgs e)
        {
            Querytemplate curTemplate = this.listBox1.SelectedItem as Querytemplate;

            if (curTemplate != null)
            {
                curTemplate.XMLTEXT = GetQueryXml();
                curTemplate.Save();
                MessageBox.Show("保存完成");
            }
        }
        private void saveTemplate(object sender, EventArgs e)
        {
            NameDialog dialog = new NameDialog();

            if (dialog.ShowDialog() == DialogResult.OK && dialog.Result != "")
            {
                Querytemplate tem = new Querytemplate();
                tem.ENTITYNAME   = queryEntity.QueryEntityName;
                tem.TEMPLATENAME = dialog.Result;
                tem.XMLTEXT      = GetQueryXml();
                queryTaemplate.Add(tem);
                queryTaemplate.Save();
            }
        }