Esempio n. 1
0
        protected void btnXLineSave_Click(object sender, EventArgs e)
        {
            if (CurveID == "")
            {
                MessageBox.popupClientMessage(this.Page, "请选择具体曲线!", "call();");

                return;
            }

            int    xlinetype   = int.Parse(ddl_CurveType.SelectedValue);
            int    xlinegetype = int.Parse(ddl_CurveGetType.SelectedValue);
            double dout        = 0;
            string xlinexyz    = "";

            if (xlinetype == 0)
            {
                if (!double.TryParse(tbxXLineXYZ.Text, out dout))
                {
                    MessageBox.popupClientMessage(this.Page, "定值格式不正确!无法保存!", "call();");
                    return;
                }
            }
            else if (xlinetype == 1)
            {
                if (dtXLine.Rows.Count < 2)
                {
                    MessageBox.popupClientMessage(this.Page, "区间定义不完整!无法保存!", "call();");
                    return;
                }
            }
            else if (xlinetype == 2)
            {
                if (dtXLine.Rows.Count < 2 && dtXLine.Columns.Count < 2)
                {
                    MessageBox.popupClientMessage(this.Page, "区间定义不完整!无法保存!", "call();");
                    return;
                }
            }

            CurveTagEntity mEntity = CurveTagDal.GetEntity(CurveID);

            mEntity.CurveType     = xlinetype;
            mEntity.CurveGetType  = xlinegetype;
            mEntity.CurveXRealTag = ddl_CurveXRealTag.SelectedValue != "NULLDATA" ? ddl_CurveXRealTag.SelectedValue : "";
            mEntity.CurveYRealTag = ddl_CurveYRealTag.SelectedValue != "NULLDATA" ? ddl_CurveYRealTag.SelectedValue : "";
            mEntity.CurveZRealTag = "";

            xlinexyz = ECTagDal.SetXLineXYZ(xlinetype, dtXLine, dout);

            mEntity.CurveXYZ = xlinexyz;

            CurveTagDal.Update(mEntity);
        }
Esempio n. 2
0
        protected void btnXLineSave_Click(object sender, EventArgs e)
        {
            int    xlinetype   = int.Parse(ddl_ECXLineType.SelectedValue);
            int    xlinegetype = int.Parse(ddl_ECXLineGetType.SelectedValue);
            double dout        = 0;

            string xtag = ddl_ECXLineXRealTag.SelectedValue != "NULLDATA" ? ddl_ECXLineXRealTag.SelectedValue : "";
            string ytag = ddl_ECXLineYRealTag.SelectedValue != "NULLDATA" ? ddl_ECXLineYRealTag.SelectedValue : "";
            string ztag = "";

            string xlinexyz   = "";
            string curvegroup = "";


            if (xlinetype == 0)
            {
                if (!double.TryParse(tbxXLineXYZ.Text, out dout))
                {
                    MessageBox.popupClientMessage(this.Page, "定值格式不正确!无法保存!", "call();");
                    return;
                }
            }
            else if (xlinetype == 1)
            {
                if (dtXLine.Rows.Count < 2)
                {
                    MessageBox.popupClientMessage(this.Page, "区间定义不完整!无法保存!", "call();");
                    return;
                }

                xlinexyz = ECTagDal.SetXLineXYZ(xlinetype, dtXLine, dout);
            }
            else if (xlinetype == 2)
            {
                if (dtXLine.Rows.Count < 2 && dtXLine.Columns.Count < 2)
                {
                    MessageBox.popupClientMessage(this.Page, "区间定义不完整!无法保存!", "call();");
                    return;
                }

                xlinexyz = ECTagDal.SetXLineXYZ(xlinetype, dtXLine, dout);
            }
            // ==3
            else if (xlinetype == 4)
            {
                //
                foreach (ListItem ltm in rblCurveTags.Items)
                {
                    if (ltm.Selected)
                    {
                        curvegroup = ltm.Value;
                        break;
                    }
                }

                DataTable dtc = CurveTagDal.GetCurvesByGroup(curvegroup);
                if (dtc.Rows.Count >= 1)
                {
                    xtag = dtc.Rows[0]["CurveXRealTag"].ToString();
                    ytag = dtc.Rows[0]["CurveYRealTag"].ToString();
                    ztag = "";

                    //借用此字段 存储曲线Group中的CurveType 类型
                    xlinexyz = dtc.Rows[0]["CurveType"].ToString();
                }
            }

            mEntity.ECXLineXRealTag = xtag;
            mEntity.ECXLineYRealTag = ytag;
            mEntity.ECXLineZRealTag = ztag;

            mEntity.ECXLineXYZ   = xlinexyz;
            mEntity.ECCurveGroup = curvegroup;

            ECTagDal.Update(mEntity);

            txtFlag.Value = "0";
        }