/// <summary>
        /// 插入数据
        /// </summary>
        /// <returns></returns>
        bool Insert(string said)
        {
            KPI_SATagEntity mEntity = new KPI_SATagEntity();

            mEntity.SAID      = said;
            mEntity.UnitID    = ddl_UnitID.SelectedValue;
            mEntity.SeqID     = ddl_SeqID.Value.Trim();
            mEntity.KpiID     = ddl_KpiID.SelectedValue;
            mEntity.EngunitID = ddl_EngunitID.Value.Trim();
            mEntity.CycleID   = ddl_CycleID.Value.Trim();

            mEntity.SAIsValid   = int.Parse(ddl_SAIsValid.Value);
            mEntity.SAIsCalc    = int.Parse(ddl_SAIsCalc.Value);
            mEntity.SAIsDisplay = int.Parse(ddl_SAIsDisplay.Value);
            mEntity.SAIsTotal   = int.Parse(ddl_SAIsTotal.Value);

            mEntity.SACode  = txt_SACode.Value.Trim();
            mEntity.SAName  = txt_SAName.Value.Trim();
            mEntity.SADesc  = txt_SADesc.Value.Trim();
            mEntity.SAIndex = int.Parse(txt_SAIndex.Value.Trim());
            mEntity.SAWeb   = ddl_SAWeb.Value;

            //mEntity.SAFilterExp = tbx_SAFilterExp.Text;
            mEntity.SACalcExp = tbx_SACalcExp.Text;

            //
            mEntity.SANote               = txt_SANote.Value.Trim();
            mEntity.SACreateTime         = DateTime.Now.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss");
            mEntity.SAModifyTime         = mEntity.SACreateTime;
            mEntity.SACountExpression    = txtCountExpression.Text.Trim();
            mEntity.SADurationExpression = txtDurationExpression.Text.Trim();


            return(KPI_SATagDal.Insert(mEntity));
        }
Example #2
0
        protected void btnApply_Click(object sender, EventArgs e)
        {
            if (gvTable.Rows.Count <= 0)
            {
                return;
            }

            for (int i = 0; i < gvTable.Rows.Count; i++)
            {
                KPI_SATagEntity csE = new KPI_SATagEntity();
                csE.SAID    = gvTable.Rows[i]["SAID"].ToString();
                csE.SAIndex = i + 1;

                KPI_SATagDal.Update(csE);
            }

            MessageBox.popupClientMessage(this.Page, "排序成功!", "call();");
        }
        /// <summary>
        /// 绑定数据
        /// </summary>
        void BindValues()
        {
            string SAID = ViewState["said"].ToString();

            if (SAID == "")
            {
                return;
            }

            KPI_SATagEntity mEntity = KPI_SATagDal.GetEntity(SAID);

            ddl_UnitID.SelectedValue = mEntity.UnitID;
            ddl_SeqID.Value          = mEntity.SeqID;
            ddl_KpiID.SelectedValue  = mEntity.KpiID;
            ddl_EngunitID.Value      = mEntity.EngunitID;
            ddl_CycleID.Value        = mEntity.CycleID;

            ddl_SAIsValid.Value   = mEntity.SAIsValid.ToString();
            ddl_SAIsCalc.Value    = mEntity.SAIsCalc.ToString();
            ddl_SAIsDisplay.Value = mEntity.SAIsDisplay.ToString();
            ddl_SAIsTotal.Value   = mEntity.SAIsTotal.ToString();
            ddl_SAWeb.Value       = mEntity.SAWeb;

            txt_SACode.Value  = mEntity.SACode;
            txt_SAName.Value  = mEntity.SAName;
            txt_SADesc.Value  = mEntity.SADesc;
            txt_SAIndex.Value = mEntity.SAIndex.ToString();

            //tbx_SAFilterExp.Text = mEntity.SAFilterExp;
            tbx_SACalcExp.Text = mEntity.SACalcExp;

            txt_SANote.Value           = mEntity.SANote;
            txtCountExpression.Text    = mEntity.SACountExpression;
            txtDurationExpression.Text = mEntity.SADurationExpression;

            //BindSecurity();
        }
Example #4
0
        private void BindSAKPI()
        {
            List <KPI_SATagEntity> DataSource;

            using (KPI_SATagDal SATagDal = new KPI_SATagDal()) {
                if (String.IsNullOrEmpty(drpUnits.SelectedValue))
                {
                    DataSource = SATagDal.GetSATags();
                }
                else
                {
                    DataSource = SATagDal.GetSATagList(drpUnits.SelectedValue);
                }
                KPI_SATagEntity item = new KPI_SATagEntity {
                    SAID   = "",
                    SAName = "【所有指标】"
                };
                DataSource.Insert(0, item);
                drpKPI.DataSource     = DataSource;
                drpKPI.DataTextField  = "SAName";
                drpKPI.DataValueField = "SAID";
                drpKPI.DataBind();
            }
        }