Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (!string.IsNullOrEmpty(Page.Request.QueryString["sourceID"]))
                {
                    hidsourceid.Value = Page.Request.QueryString["sourceID"];
                }
                if (!string.IsNullOrEmpty(Page.Request.QueryString["templateID"]))
                {
                    hidTemplateID.Value = Page.Request.QueryString["templateID"];
                }

                if (!string.IsNullOrEmpty(hidsourceid.Value) && !string.IsNullOrEmpty(hidTemplateID.Value))
                {
                    string           sourceid           = hidsourceid.Value.Trim();
                    BS_DATASOURCEBLL bll                = new BS_DATASOURCEBLL();
                    CMICT.CSP.Model.BS_DATASOURCE model = bll.GetModel(Guid.Parse(sourceid));
                    if (model != null)
                    {
                        dc = new DisplayConfigComponent(model.SourceIP, model.UserName, model.Password, model.DBName);
                    }
                    BindColumnList();
                    BindControltype();
                    BindComparetype();
                    BindInfoIfEdit(hidTemplateID.Value);
                }
            }
        }
Exemplo n.º 2
0
        protected void btnEdit_Click(object sender, EventArgs e)
        {
            try
            {
                trbig.Attributes.Add("style", "display:none;");
                trsmall.Attributes.Add("style", "display:none;");
                BindSourceTemplate("", "");

                string communicationID = hidCommunicationID.Value;
                if (communicationID.Length <= 0)
                {
                    return;
                }

                DataTable dtCommu = dc.GetCommunicationConfigInfoByID(communicationID);

                string sourceTemplateID = "";
                if (dtCommu != null && dtCommu.Rows.Count > 0)
                {
                    sourceTemplateID = Convert.ToString(dtCommu.Rows[0]["SourceTemplateID"]);
                    txtName.Value    = Convert.ToString(dtCommu.Rows[0]["Name"]);
                }

                if (!string.IsNullOrEmpty(sourceTemplateID))
                {
                    ddlSourceTemplate.Items.FindByValue(sourceTemplateID).Selected = true;
                    txtSourceTemplate.Text = sourceTemplateID;
                    CMICT.CSP.Model.BS_DATASOURCE model = bll.GetModel(sourceTemplateID);
                    if (model != null)
                    {
                        CommunicationConfigComponent dcserver = new CommunicationConfigComponent(model.SourceIP, model.UserName, model.Password, model.DBName);
                        DataTable dtSourceColumns             = dcserver.GetSourceDataColumnBytemID(sourceTemplateID, model.ObjectType, model.ObjectName);
                        if (dtSourceColumns != null && dtSourceColumns.Rows.Count > 0)
                        {
                            foreach (DataRow dr in dtSourceColumns.Rows)
                            {
                                dr["TargetColumnName"] = dc.GetTargetColumnNameByColNameAndComid(dr["ColumnName"].ToString(), communicationID);
                            }
                        }
                        //DataTable dtSourceColumns = dc.GetCommunicationDetailByID(communicationID);
                        CommunicationDetailList.DataSource = dtSourceColumns;
                        CommunicationDetailList.DataBind();

                        if (dtSourceColumns != null)
                        {
                            txtSelected.Text = dtSourceColumns.Rows.Count.ToString();
                        }
                    }
                }

                ddlSourceTemplate.Enabled = false;

                ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "showDetail", "showDetail();", true);
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "alertException", "javascript:showMessage('操作发生错误:" + ex.Message.Replace("'", "").Replace("\"", "") + "!',8);", true);
            }
        }
Exemplo n.º 3
0
        //根据sourceid获取数据源信息
        protected void BindColumnList()
        {
            string           sourceid = hidsourceid.Value.Trim();
            BS_DATASOURCEBLL blld     = new BS_DATASOURCEBLL();

            CMICT.CSP.Model.BS_DATASOURCE model = blld.GetModel(Guid.Parse(sourceid));
            string templateid = hidTemplateID.Value.Trim();

            if (model != null)
            {
                if (!string.IsNullOrEmpty(templateid))//绑定已经配置的列名与显示名信息
                {
                    DataTable dtt = bll.GetUserQueryColListByTemplateID(Guid.Parse(templateid));
                    if (dtt != null && dtt.Rows.Count > 0)
                    {
                        string configcolinfo = string.Empty;
                        foreach (DataRow drr in dtt.Rows)
                        {
                            configcolinfo += Convert.ToString(drr["name"]) + "|" + Convert.ToString(drr["DisplayName"]) + ";";
                        }
                        hidconfigcolinfo.Value = configcolinfo;
                    }
                }
                DataTable dt = dc.GetColumnListByType(model.ObjectType, model.ObjectName, "");

                //绑定默认筛选条件中列名下拉
                ddlColumnName.DataSource     = dt;
                ddlColumnName.DataTextField  = "name";
                ddlColumnName.DataValueField = "data_type";
                ddlColumnName.DataBind();
                ddlColumnName.Items.Insert(0, new ListItem("请选择", ""));
                ViewState["DfColumnList"] = dt;
                //绑定排序中列名下拉
                ddluqcol.DataSource     = dt;
                ddluqcol.DataTextField  = "name";
                ddluqcol.DataValueField = "name";
                ddluqcol.DataBind();
                ddluqcol.Items.Insert(0, new ListItem("请选择", ""));
                ViewState["ColumnList"] = dt;
                if (model.ObjectType == "PROC")
                {
                    if (dt != null && dt.Rows.Count > 0)
                    {
                        string paralist = string.Empty;
                        foreach (DataRow dr in dt.Rows)
                        {
                            string cname = Convert.ToString(dr["name"]).Trim();
                            if (cname.IndexOf('@') != -1)
                            {
                                paralist += cname + ",";
                            }
                        }
                        hidprocparalist.Value = paralist.TrimEnd(',');
                    }
                }
            }
        }
Exemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (!string.IsNullOrEmpty(Page.Request.QueryString["sourceID"]))
                {
                    hidsourceid.Value = Page.Request.QueryString["sourceID"];
                    string           sourceid           = hidsourceid.Value.Trim();
                    BS_DATASOURCEBLL bll                = new BS_DATASOURCEBLL();
                    CMICT.CSP.Model.BS_DATASOURCE model = bll.GetModel(Guid.Parse(sourceid));
                    if (model != null)
                    {
                        dcserver = new DisplayConfigComponent(model.SourceIP, model.UserName, model.Password, model.DBName);
                        if (model.ObjectType.ToLower() == "proc")
                        {
                            hiddbtype.Value = "proc";
                        }
                    }
                }
                try
                {
                    if (!string.IsNullOrEmpty(Page.Request.QueryString["templateID"]))
                    {
                        hidTemplateID.Value = Page.Request.QueryString["templateID"];


                        BindDisplayType();
                        BindColumnIfEdit(hidTemplateID.Value);
                        BindColumnList();
                        BindCalColumnList();
                        BindDecimal();//绑定小数位数
                    }
                    else
                    {
                        ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "alertnomodel", "layer.alert('未获取到模板信息,请联系管理员!',8);", true);
                    }
                }catch (Exception ex) {
                    BaseComponent.Error("DisplayConfig-pageload:" + ex.Message);
                    ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "alertnomodelerror", "layer.alert('数据源连接失败,请联系管理员!',8);", true);
                }
            }
        }
Exemplo n.º 5
0
        //绑定计算列信息
        protected void BindCalColumnList()
        {
            //if (ddlDisplayType.SelectedValue == "COLUMN" || ddlDisplayType.SelectedValue == "ROW")
            //if (!string.IsNullOrEmpty(ddlDisplayType.SelectedValue))
            //{
            string           sourceid = hidsourceid.Value.Trim();
            BS_DATASOURCEBLL bll      = new BS_DATASOURCEBLL();

            CMICT.CSP.Model.BS_DATASOURCE model = bll.GetModel(Guid.Parse(sourceid));
            if (model != null)
            {
                DataTable dt = dcserver.GetColumnListByTypeOnlyNum(model.ObjectType, model.ObjectName);
                //if (ddlDisplayType.SelectedValue == "COLUMN")
                //{
                rptcallist.DataSource = dt;
                rptcallist.DataBind();
                //}
                //if (ddlDisplayType.SelectedValue == "ROW")
                //{
                //string temid = hidTemplateID.Value.Trim();
                //QueryConfigComponent qcc = new QueryConfigComponent();
                //DataTable gcdt = qcc.GetUserQueryColListByTemplateID(Guid.Parse(temid), 1);
                //if (gcdt != null && gcdt.Rows.Count > 0)
                //{
                //    ddlgroupcalcol.DataSource = dt;
                //    ddlgroupcalcol.DataTextField = "name";
                //    ddlgroupcalcol.DataValueField = "name";
                //    ddlgroupcalcol.DataBind();
                //ddlgroupcalcol.Items.Insert(0, new ListItem("请选择", ""));
                //}
                //绑定计算方式
                DataTable dtt = BaseComponent.GetLookupValuesByType("BS_GROUPY_COMPUTERTYPE");
                ddlcomputertype.DataSource     = dtt;
                ddlcomputertype.DataTextField  = "LOOKUP_VALUE_NAME";
                ddlcomputertype.DataValueField = "LOOKUP_VALUE";
                ddlcomputertype.DataBind();
                ddlcomputertype.Items.Insert(0, new ListItem("请选择", ""));
                // }
            }
            //}
        }
Exemplo n.º 6
0
 protected void ddlSourceTemplate_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         string sourceTemplateID = ddlSourceTemplate.SelectedValue;
         if (!string.IsNullOrEmpty(sourceTemplateID))
         {
             CMICT.CSP.Model.BS_DATASOURCE model = bll.GetModel(sourceTemplateID);
             if (model != null)
             {
                 CommunicationConfigComponent dcserver = new CommunicationConfigComponent(model.SourceIP, model.UserName, model.Password, model.DBName);
                 DataTable dtCommu = dcserver.GetSourceDataColumnBytemID(sourceTemplateID, model.ObjectType, model.ObjectName);
                 CommunicationDetailList.DataSource = dtCommu;
                 CommunicationDetailList.DataBind();
             }
         }
         ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "showDetail", "showDetail();", true);
     }
     catch (Exception ex)
     {
         ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "alertException", "javascript:showMessage('操作发生错误:" + ex.Message.Replace("'", "").Replace("\"", "") + "!',8);", true);
     }
 }
Exemplo n.º 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                string edit = string.Empty;
                if (!string.IsNullOrEmpty(Page.Request.QueryString["type"]))
                {
                    hidisedit.Value = "edit";
                }
                if (!string.IsNullOrEmpty(Page.Request.QueryString["sourceID"]))
                {
                    try
                    {
                        hidsourceid.Value = Page.Request.QueryString["sourceID"];
                        CMICT.CSP.Model.BS_DATASOURCE model = bll.GetModel(Guid.Parse(hidsourceid.Value));
                        if (model != null)
                        {
                            BindBigCategory();
                            CommunicationConfigComponent dcserver = new CommunicationConfigComponent(model.SourceIP, model.UserName, model.Password, model.DBName);
                            if (!string.IsNullOrEmpty(Page.Request.QueryString["templateID"]))
                            {
                                hidTemplateID.Value = Page.Request.QueryString["templateID"];
                                BindCommunicationData();

                                DataTable dtTargetColumns = dcserver.GetSourceDataColumnBytemID(hidTemplateID.Value, model.ObjectType, model.ObjectName);
                                //DataTable dtTargetColumns = dc.GetDataColumnByTemplateID(hidTemplateID.Value);
                                ViewState["TargetColumns"] = dtTargetColumns;
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        BaseComponent.Error("CommunicationConfig-页面加载出错:" + ex.Message);
                    }
                }
            }
        }
Exemplo n.º 8
0
        //根据sourceid获取数据源信息
        protected void BindColumnList()
        {
            string           sourceid = hidsourceid.Value.Trim();
            BS_DATASOURCEBLL bll      = new BS_DATASOURCEBLL();

            CMICT.CSP.Model.BS_DATASOURCE model = bll.GetModel(Guid.Parse(sourceid));
            if (model != null)
            {
                DataTable dt = dcserver.GetColumnListByType(model.ObjectType, model.ObjectName);
                ColumnList.DataSource = dt;
                ColumnList.DataBind();
                //绑定排序中列名下拉
                ddlColumnName.DataSource     = dt;
                ddlColumnName.DataTextField  = "name";
                ddlColumnName.DataValueField = "name";
                ddlColumnName.DataBind();
                ddlColumnName.Items.Insert(0, new ListItem("请选择", ""));
                //if (ddlDisplayType.SelectedValue == "ROW")
                //{
                //    rptgroupcol.DataSource = dt;
                //    rptgroupcol.DataBind();
                //}
            }
        }