コード例 #1
0
    protected void SaveButton_OnClick(object sender, EventArgs e)
    {
        int measureID          = Convert.ToInt32(Request.QueryString["mID"]);
        OrderedDictionary keys = new OrderedDictionary();

        keys.Add("measureID", measureID);

        OrderedDictionary newvalues = new DxDbOps.FormLayoutNewValues((ASPxFormLayout)FormLayout);

        newvalues.Add("measureID", measureID);

        OrderedDictionary oldvalues = (OrderedDictionary)Session["formlayoutoldvalues"];

        bool outcome  = DxDbOps.BuildUpdateSqlCode(keys, newvalues, oldvalues, "tblMeasure", "backend", "dbo");
        bool outcome2 = DxDbOps.BuildUpdateSqlCode(keys, newvalues, oldvalues, "tbl", "data", "def");

        LoadMeasureInfo(measureID);
    }
コード例 #2
0
    protected void LoadMeasureInfo(int measureID)
    {
        SQL_utils sql  = new SQL_utils("backend");
        string    code = String.Format("select a.*, tblname, tblpk, spname, skipstartingrows, importfiletype, textqualifier, firstrowcontainsfldnames from tblmeasure a {0} " +
                                       " left join uwautism_research_data.def.tbl b ON a.measureID = b.measureID where a.measureID={1}"
                                       , Environment.NewLine, measureID);

        DataTable dt = sql.DataTable_from_SQLstring(code);

        string fldcode = String.Format("select count(*) from uwautism_research_data.def.fld where tblpk = (select tblpk from uwautism_research_data.def.tbl where measureID = {0}) ", measureID);
        int    nflds   = sql.IntScalar_from_SQLstring(fldcode);

        btnDict.Visible = (nflds > 0) ? true : false;

        sql.Close();

        FormLayout.DataSource = dt;
        FormLayout.DataBind();

        OrderedDictionary oldvalues = new DxDbOps.FormLayoutNewValues((ASPxFormLayout)FormLayout);

        oldvalues.Add("measureID", measureID);
        Session["formlayoutoldvalues"] = oldvalues;
    }