protected void btnScoreSave_Click(object sender, EventArgs e) { if (mEntity == null) { MessageBox.popupClientMessage(this.Page, "使用系数前,请先绑定指标实体!", "call();"); return; } string scoreexp = ""; foreach (DataRow dr in dtScore.Rows) { string scoreexpindex = dr["ScoreCalcExp"].ToString(); scoreexpindex += ","; scoreexpindex += dr["ScoreGainExp"].ToString(); scoreexpindex += ","; scoreexpindex += dr["ScoreOptimal"].ToString(); scoreexpindex += ","; scoreexpindex += dr["ScoreAlarm"].ToString(); scoreexpindex += ","; scoreexpindex += dr["ScoreIsValid"].ToString(); scoreexpindex += ";"; scoreexp += scoreexpindex; } mEntity.ECScoreExp = scoreexp; ECTagDal.Update(mEntity); txtFlag.Value = "0"; }
/// <summary> /// 更新数据 /// </summary> /// <returns></returns> bool Update() { string ecid = ViewState["ecid"].ToString(); ECTagEntity mEntity = new ECTagEntity(); mEntity.ECID = ecid; 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.ECIsValid = int.Parse(ddl_ECIsValid.Value); mEntity.ECIsCalc = int.Parse(ddl_ECIsCalc.Value); mEntity.ECIsAsses = int.Parse(ddl_ECIsAsses.Value); mEntity.ECIsZero = int.Parse(ddl_ECIsZero.Value); mEntity.ECIsDisplay = int.Parse(ddl_ECIsDisplay.Value); mEntity.ECIsTotal = int.Parse(ddl_ECIsTotal.Value); mEntity.ECCode = txt_ECCode.Value.Trim(); mEntity.ECName = txt_ECName.Value.Trim(); mEntity.ECDesc = txt_ECDesc.Value.Trim(); //if (txt_ECIndex.Value != "") //{} mEntity.ECIndex = int.Parse(txt_ECIndex.Value); mEntity.ECWeb = ddl_ECWeb.Value; // mEntity.ECDesign = txt_ECDesign.Value; mEntity.ECOptimal = txt_ECOptimal.Value; if (txt_ECMaxValue.Value != "") { mEntity.ECMaxValue = decimal.Parse(txt_ECMaxValue.Value); } if (txt_ECMinValue.Value != "") { mEntity.ECMinValue = decimal.Parse(txt_ECMinValue.Value); } mEntity.ECWeight = decimal.Parse(txt_ECWeight.Value.Trim()); mEntity.ECDenom = decimal.Parse(txt_ECDenom.Value.Trim()); mEntity.ECCalcClass = int.Parse(txt_ECCalcClass.Value.Trim()); mEntity.ECNote = txt_ECNote.Value.Trim(); //mEntity.ECCreateTime = DateTime.Now.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss"); mEntity.ECModifyTime = DateTime.Now.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss"); return(ECTagDal.Update(mEntity)); }
/// <summary> /// 更新数据 /// </summary> /// <returns></returns> bool Update() { string ecid = ViewState["ecid"].ToString(); ECTagEntity mEntity = new ECTagEntity(); mEntity.ECID = ecid; mEntity.ECCalcExp = tbx_ECCalcExp.Text;//.Replace("'", "''"); mEntity.ECCalcDesc = tbx_ECCalcDesc.Text; mEntity.ECModifyTime = DateTime.Now.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss"); return(ECTagDal.Update(mEntity)); }
protected void btnApply_Click(object sender, EventArgs e) { if (gvTable.Rows.Count <= 0) { return; } for (int i = 0; i < gvTable.Rows.Count; i++) { ECTagEntity csE = new ECTagEntity(); csE.ECID = gvTable.Rows[i]["ECID"].ToString(); csE.ECIndex = i + 1; ECTagDal.Update(csE); } MessageBox.popupClientMessage(this.Page, "排序成功!", "call();"); }
/// <summary> /// 更新数据 /// </summary> /// <returns></returns> bool Update() { string ecid = ViewState["ecid"].ToString(); ECTagEntity mEntity = new ECTagEntity(); mEntity.ECID = ecid; mEntity.ECIsSort = cbx_ECIsSort.Checked ? 1 : 0; mEntity.ECType = int.Parse(ddl_ECType.SelectedValue); mEntity.ECSort = int.Parse(ddl_ECSort.Value); mEntity.ECScore = txt_ECScore.Value; mEntity.ECExExp = txt_ECExExp.Value; mEntity.ECExScore = txt_ECExScore.Value; mEntity.ECModifyTime = DateTime.Now.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss"); return(ECTagDal.Update(mEntity)); }
protected void cbx_ECIsSort_CheckedChanged(object sender, EventArgs e) { string ecid = ViewState["ecid"].ToString(); if (ecid == "") { btnApply.Enabled = false; return; } else { btnApply.Enabled = true; } ECTagEntity ect = new ECTagEntity(); ect.ECID = ecid; ect.ECIsSort = cbx_ECIsSort.Checked ? 1 : 0; ECTagDal.Update(ect); }
protected bool ImportFromExcelToModify(DataSet ds) { string strError = ""; try { System.Data.DataTable dt = ds.Tables[0]; int nAll = dt.Rows.Count; int nModify = 0; int nNoExist = 0; foreach (System.Data.DataRow dr in dt.Rows) { if (dr["SelectX"].ToString().ToLower() == "x") { string ECCode = dr["ECCode"].ToString().Trim(); strError = ECCode; //判断是否存在 if (!ECTagDal.CodeExist(ECCode, "")) { //MessageBox.popupClientMessage(this.Page, " 该机组的输出标签已存在!", "call();"); nNoExist += 1; continue; } //main tag string keyid = ECTagDal.GetECIDByCode(ECCode); ECTagEntity mEntity = new ECTagEntity(); mEntity.ECID = keyid; string UnitName = dr["UnitName"].ToString().Trim(); mEntity.UnitID = KPI_UnitDal.GetUnitID(UnitName); string SeqName = dr["SeqName"].ToString().Trim(); mEntity.SeqID = KPI_SeqDal.GetSeqID(SeqName); string KpiName = dr["KpiName"].ToString().Trim(); mEntity.KpiID = KpiDal.GetKpiID(KpiName); string EngunitName = dr["EngunitName"].ToString().Trim(); mEntity.EngunitID = EngunitDal.GetEngunitID(EngunitName); string CycleName = dr["CycleName"].ToString().Trim(); mEntity.CycleID = CycleDal.GetCycleID(CycleName); mEntity.ECCode = dr["ECCode"].ToString().Trim(); mEntity.ECName = dr["ECName"].ToString().Trim(); mEntity.ECDesc = dr["ECDesc"].ToString().Trim(); mEntity.ECIndex = int.Parse(dr["ECIndex"].ToString().Trim()); mEntity.ECWeb = dr["ECWeb"].ToString().Trim(); mEntity.ECIsValid = int.Parse(dr["ECIsValid"].ToString().Trim()); mEntity.ECIsCalc = int.Parse(dr["ECIsCalc"].ToString().Trim()); mEntity.ECIsAsses = int.Parse(dr["ECIsAsses"].ToString().Trim()); mEntity.ECIsZero = int.Parse(dr["ECIsZero"].ToString().Trim()); mEntity.ECIsDisplay = int.Parse(dr["ECIsDisplay"].ToString().Trim()); mEntity.ECIsTotal = int.Parse(dr["ECIsTotal"].ToString().Trim()); mEntity.ECDesign = dr["ECDesign"].ToString().Trim(); mEntity.ECOptimal = dr["ECOptimal"].ToString().Trim(); if (dr["ECMaxValue"].ToString().Trim() != "") { mEntity.ECMaxValue = decimal.Parse(dr["ECMaxValue"].ToString().Trim()); } if (dr["ECMinValue"].ToString().Trim() != "") { mEntity.ECMinValue = decimal.Parse(dr["ECMinValue"].ToString().Trim()); } mEntity.ECWeight = decimal.Parse(dr["ECWeight"].ToString().Trim()); mEntity.ECCalcClass = int.Parse(dr["ECCalcClass"].ToString().Trim()); mEntity.ECFilterExp = dr["ECFilterExp"].ToString().Trim(); mEntity.ECCalcExp = dr["ECCalcExp"].ToString().Trim(); mEntity.ECCalcDesc = dr["ECCalcDesc"].ToString().Trim(); mEntity.ECIsSnapshot = int.Parse(dr["ECIsSnapshot"].ToString().Trim()); mEntity.ECXLineType = int.Parse(dr["ECXLineType"].ToString().Trim()); mEntity.ECXLineGetType = int.Parse(dr["ECXLineGetType"].ToString().Trim()); mEntity.ECXLineXRealTag = dr["ECXLineXRealTag"].ToString().Trim(); mEntity.ECXLineYRealTag = dr["ECXLineYRealTag"].ToString().Trim(); mEntity.ECXLineZRealTag = dr["ECXLineZRealTag"].ToString().Trim(); mEntity.ECXLineXYZ = dr["ECXLineXYZ"].ToString().Trim(); mEntity.ECScoreExp = dr["ECScoreExp"].ToString().Trim(); mEntity.ECCurveGroup = dr["ECCurveGroup"].ToString().Trim(); mEntity.ECIsSort = int.Parse(dr["ECIsSort"].ToString().Trim()); mEntity.ECType = int.Parse(dr["ECType"].ToString().Trim()); mEntity.ECSort = int.Parse(dr["ECSort"].ToString().Trim()); mEntity.ECScore = dr["ECScore"].ToString().Trim(); mEntity.ECExExp = dr["ECExExp"].ToString().Trim(); mEntity.ECExScore = dr["ECExScore"].ToString().Trim(); mEntity.ECNote = dr["ECNote"].ToString().Trim(); mEntity.ECCreateTime = DateTime.Now.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss"); mEntity.ECModifyTime = mEntity.ECCreateTime; ECTagDal.Update(mEntity); nModify += 1; } } string strInfor = "标签点总数为:{0}个, 修改成功:{1}个,不存在标签点: {2}个。"; strInfor = string.Format(strInfor, nAll, nModify, nNoExist); MessageBox.popupClientMessage(this.Page, strInfor, "call();"); return(true); } catch (Exception ee) { // MessageBox.popupClientMessage(this.Page, strError + ": " + ee.Message, "call();"); return(false); } }
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"; }