public bool SaveData(object obj, string prameter) { string updataStr = "select * from TopoMSAEEPROMSet where ID=" + moduleTypeID; try { { if (mydt.Rows.Count != 1) { return(false); } else { string contentText = ""; switch (PageData) { case 0: { for (byte j = 0; j < e2romDataList.Length; j++) { contentText += e2romDataList[j].ConfigContentText; } mydt.Rows[0]["Data0"] = contentText; mydt.Rows[0]["CRCData0"] = alg.CRC8(alg.strToHexByte(contentText)); break; } } int result = pDataIO.UpdateWithProc("TopoMSAEEPROMSet", mydt, updataStr, logTracingString); if (result > 0) { mydt.AcceptChanges(); } else { pDataIO.AlertMsgShow("Update data fail!"); } for (byte i = 0; i < e2romDataList.Length; i++) { e2romDataList[i].EnableContentText = false; } return(true); } } } catch (System.Exception ex) { throw ex; } }
public bool DeleteData(object obj, string prameter) { //Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "<script>if(confirm('Are you sure you want to delete?')){DeleteData1();}else{}</script>"); bool isSelected = false; string deletStr = "select * from TopoPNSpecsParams where PID=" + moduleTypeID; try { for (int i = 0; i < topASCXPNSpcesList.Length; i++) { ASCXTopPNSpecsList cb = (ASCXTopPNSpecsList)topPNSpecsList.FindControl(topASCXPNSpcesList[i].ID); if (cb != null) { if (cb.BeSelected == true) { mydt.Rows[i].Delete(); isSelected = true; } } else { Response.Write("<script>alert('can not find user control!');</script>"); return(false); } } if (isSelected == false) { //Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "<script>alert('Did not choose any one!');return false;</script>"); this.Page.RegisterStartupScript("", "<script>alert('Did not choose any one!');</script>"); return(false); } int result = pDataIO.UpdateWithProc("TopoPNSpecsParams", mydt, deletStr, logTracingString); if (result > 0) { mydt.AcceptChanges(); } else { pDataIO.AlertMsgShow("Update data fail!"); } Response.Redirect(Request.Url.ToString()); return(true); } catch (System.Exception ex) { pDataIO.WriteErrorLogs(ex.ToString()); throw ex; } }
public bool SaveData(object obj, string prameter) { string updataStr = "select * from TopoTestPlan where ID=" + moduleTypeID; try { for (byte i = 0; i < testTestplanSelfInfor.Length; i++) { mydt.Rows[i]["ItemName"] = testTestplanSelfInfor[i].TBItemNameText; mydt.Rows[i]["SWVersion"] = testTestplanSelfInfor[i].TBSWVersionText; mydt.Rows[i]["HwVersion"] = testTestplanSelfInfor[i].TBHwVersionText; mydt.Rows[i]["USBPort"] = testTestplanSelfInfor[i].TBUSBPortText; mydt.Rows[i]["IsChipInitialize"] = testTestplanSelfInfor[i].DDIsChipIniSelectedIndex; mydt.Rows[i]["IgnoreFlag"] = testTestplanSelfInfor[i].DDIgnoreFlagSelectedIndex; mydt.Rows[i]["IsEEPROMInitialize"] = testTestplanSelfInfor[i].DDIsEEPROMIniSelectedIndex; mydt.Rows[i]["SNCheck"] = testTestplanSelfInfor[i].DDCheckSNCoefSelectedIndex; mydt.Rows[i]["IgnoreBackupCoef"] = testTestplanSelfInfor[i].DDIgnoreBackupCoefSelectedIndex; mydt.Rows[i]["ItemDescription"] = testTestplanSelfInfor[i].TBDescriptionText; } int result = pDataIO.UpdateWithProc("TopoTestPlan", mydt, updataStr, logTracingString); if (result > 0) { mydt.AcceptChanges(); } else { pDataIO.AlertMsgShow("Update data fail!"); } for (byte i = 0; i < testTestplanSelfInfor.Length; i++) { testTestplanSelfInfor[i].EnableDDIgnoreBackupCoef = false; testTestplanSelfInfor[i].EnableDDIsEEPROMIni = false; testTestplanSelfInfor[i].EnableDDIsChipIni = false; testTestplanSelfInfor[i].EnableTBUSBPort = false; testTestplanSelfInfor[i].EnableTBHwVersion = false; testTestplanSelfInfor[i].EnableTBSWVersion = false; testTestplanSelfInfor[i].EnableTBItemName = false; testTestplanSelfInfor[i].EnableDDIgnoreFlag = false; testTestplanSelfInfor[i].EnableDDSNCheck = false; testTestplanSelfInfor[i].EnableTBDescription = false; } return(true); } catch (System.Exception ex) { throw ex; } }
public bool SaveData(object obj, string prameter) { try { int addCount = 0; for (int i = 0; i < ControlList.Length; i++) { if (ControlList[i] != null && ControlList[i].BeSelected == true) //原没有项需新增 { long currEqID = pDataIO.GetLastInsertData("GlobalTestModelRelation") + 1; DataRow eqNewDr = mydt.NewRow(); eqNewDr["ID"] = currEqID; eqNewDr["PID"] = ModelListDt.Rows[i]["ID"].ToString(); eqNewDr["ConflictID"] = ModelID; mydt.Rows.Add(eqNewDr); addCount++; } } int result = -1; if (Session["DB"].ToString().ToUpper() == "ATSDB") { result = pDataIO.UpdateWithProc("GlobalTestModelRelation", mydt, queryStr, logTracingString, "ATS_V2"); } else if (Session["DB"].ToString().ToUpper() == "ATSDEBUGDB") { result = pDataIO.UpdateWithProc("GlobalTestModelRelation", mydt, queryStr, logTracingString, "ATS_VXDEBUG"); } if (result > 0) { mydt.AcceptChanges(); } else { pDataIO.AlertMsgShow("数据更新失败!"); } Response.Redirect("~/WebFiles/MaintainInfo/AppModel/ModelRelationList.aspx?uId=" + ModelID); return(true); } catch (System.Exception ex) { pDataIO.WriteErrorLogs(ex.ToString()); throw ex; } }
public bool DeleteData(object obj, string prameter) { //Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "<script>if(confirm('Are you sure you want to delete?')){DeleteData1();}else{}</script>"); bool isSelected = false; string deletStr = "select * from GlobalMSADefintionInf where PID=" + moduleTypeID + "ORDER BY SlaveAddress,Page,StartAddress,Channel"; try { for (int i = 0; i < GlobleMSADefine.Length; i++) { ASCXChipSetContrl cb = (ASCXChipSetContrl)GlobalMSADefinList.FindControl(GlobleMSADefine[i].ID); if (cb != null) { if (cb.BeSelected == true) { mydt.Rows[i].Delete(); isSelected = true; } } else { Response.Write("<script>alert('can not find user control!');</script>"); return(false); } } if (isSelected == false) { //Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "<script>alert('Did not choose any one!');return false;</script>"); this.Page.RegisterStartupScript("", "<script>alert('Did not choose any one!');</script>"); return(false); } int result = pDataIO.UpdateWithProc("GlobalMSADefintionInf", mydt, deletStr, logTracingString); if (result > 0) { mydt.AcceptChanges(); } else { pDataIO.AlertMsgShow("Update data fail!"); } Response.Redirect(Request.Url.ToString()); return(true); } catch (System.Exception ex) { throw ex; } }
public bool SaveData(object obj, string prameter) { string updataStr = "select * from TopoManufactureConfigInit where ID=" + moduleTypeID; try { for (byte i = 2; i < MConfigInitSelfInfor.Length; i++) { if (rowCount != 1) { return(false); } else { mydt.Rows[0][mydt.Columns[i].ColumnName] = MConfigInitSelfInfor[i].ConfigFiledValue; } } int result = -1; if (Session["DB"].ToString().ToUpper() == "ATSDB") { result = pDataIO.UpdateWithProc("TopoManufactureConfigInit", mydt, updataStr, logTracingString, "ATS_V2"); } else if (Session["DB"].ToString().ToUpper() == "ATSDEBUGDB") { result = pDataIO.UpdateWithProc("TopoManufactureConfigInit", mydt, updataStr, logTracingString, "ATS_VXDEBUG"); } if (result > 0) { mydt.AcceptChanges(); } else { pDataIO.AlertMsgShow("数据更新失败!"); } for (byte i = 2; i < MConfigInitSelfInfor.Length; i++) { MConfigInitSelfInfor[i].EnableFiledValue = false; } return(true); } catch (System.Exception ex) { throw ex; } }
public bool SaveData(object obj, string prameter) { string updataStr = "select * from TopoManufactureConfigInit where ID=" + moduleTypeID; DataTable inserTable = pDataIO.GetDataTable(updataStr, "TopoTestPlan"); DataRow dr = inserTable.NewRow(); try { dr[0] = -1; dr[1] = moduleTypeID; for (byte i = 2; i < MConfigInitSelfInfor.Length; i++) { dr[i] = MConfigInitSelfInfor[i].ConfigFiledValue; } inserTable.Rows.Add(dr); int result = -1; if (Session["DB"].ToString().ToUpper() == "ATSDB") { result = pDataIO.UpdateWithProc("TopoManufactureConfigInit", inserTable, updataStr, logTracingString, "ATS_V2"); } else if (Session["DB"].ToString().ToUpper() == "ATSDEBUGDB") { result = pDataIO.UpdateWithProc("TopoManufactureConfigInit", inserTable, updataStr, logTracingString, "ATS_VXDEBUG"); } if (result > 0) { inserTable.AcceptChanges(); Response.Redirect("~/WebFiles/Production_ATS/TestPlan/ManufaConfigInit.aspx?uId=" + moduleTypeID.Trim()); } else { pDataIO.AlertMsgShow("数据更新失败!", Request.Url.ToString()); } return(true); } catch (System.Exception ex) { throw ex; } }
public bool SaveData(object obj, string prameter) { try { for (int i = 0; i < mydt.Rows.Count; i++) { Label lb = (Label)tableFC.FindControl("SEQ" + Convert.ToString(mydt.Rows[i]["ID"])); if (lb != null) { mydt.Rows[i]["SEQ"] = lb.Text; } } //150527 ---------------------更新方式变更>>Start int result = -1; if (Session["DB"].ToString().ToUpper() == "ATSDB") { result = pDataIO.UpdateWithProc("ReportHeaderSpecs", mydt, queryStr, logTracingString, "ATS_V2"); } else if (Session["DB"].ToString().ToUpper() == "ATSDEBUGDB") { result = pDataIO.UpdateWithProc("ReportHeaderSpecs", mydt, queryStr, logTracingString, "ATS_VXDEBUG"); } if (result > 0) { mydt.AcceptChanges(); Response.Redirect(Request.Url.ToString(), true); return(true); } else { pDataIO.AlertMsgShow("数据更新失败!", Request.Url.ToString()); return(false); } //150527 ---------------------更新方式变更<<End } catch (System.Exception ex) { pDataIO.WriteErrorLogs(ex.ToString()); throw ex; } }
public bool SaveData(object obj, string prameter) { try { DataSet EqDS = new DataSet(); string strEqInfo = "select * from TopoEquipment where id =" + EquipID; string strEqParam = "select * from TopoEquipmentParameter where pid =" + EquipID; DataTable eqDt = pDataIO.GetDataTable(strEqInfo, "TopoEquipment"); DataTable eqParamsDt = pDataIO.GetDataTable(strEqParam, "TopoEquipmentParameter"); DataTable GlobalEqDt = pDataIO.GetDataTable("select * from GlobalAllEquipmentList", "GlobalAllEquipmentList"); DataTable GlobalEqParamsDt = pDataIO.GetDataTable("select * from GlobalAllEquipmentParamterList", "GlobalAllEquipmentParamterList"); EqDS.Tables.Add(eqDt); EqDS.Tables.Add(eqParamsDt); EqDS.Relations.Add("EqRelation", eqDt.Columns["ID"], eqParamsDt.Columns["pID"]); if (eqDt.Rows.Count == 1) { #region //已经获取到当前设备的信息 string EqGid = eqDt.Rows[0]["GID"].ToString(); eqDt.Rows[0]["Role"] = EqControl.TxtDdlRole; #region EqParams string paramsPid = eqDt.Rows[0]["ID"].ToString(); for (int i = 0; i < ControlList.Length; i++) { //若为新增的参数则需要Add if (ControlList[i] != null) { string myGid = ControlList[i].myControlID; //string myGid = pCommCtrl.getDTColumnInfo(GlobalEqParamsDt, "ID", "PID=" + EqGid + " and ID ='" + ControlList[i].myControlID + "'"); if (ControlList[i].ID.ToString().Contains("EquipParam_New_")) { DataRow dr = eqParamsDt.NewRow(); dr["pid"] = paramsPid; dr["Gid"] = myGid; dr["ItemValue"] = ControlList[i].pTxtItemValue; eqParamsDt.Rows.Add(dr); } else { for (int j = 0; j < eqParamsDt.Rows.Count; j++) { if (eqParamsDt.Rows[j]["GID"].ToString().ToLower().Trim() == myGid) { eqParamsDt.Rows[j]["ItemValue"] = ControlList[i].pTxtItemValue; } } } } } //150527 ---------------------更新方式变更>>Start int result = pDataIO.UpdateWithProc("TopoEquipment", eqDt, eqParamsDt, logTracingString); if (result > 0) { eqDt.AcceptChanges(); eqParamsDt.AcceptChanges(); Response.Redirect("~/WebFiles/TestPlan/Terry/EquipmentList.aspx?uId=" + TestPlanID, false); } else { pDataIO.AlertMsgShow("Update data fail!", Request.Url.ToString()); } //150527 ---------------------更新方式变更<<End #endregion } #endregion else if (AddNew && ddlItemName.Text.Length > 0) { #region //New string EqGid = pCommCtrl.getDTColumnInfo(GlobalEqDt, "ID", "ShowName='" + ddlItemName.Text + "'"); string MaxSeq = pDataIO.getDbCmdExecuteScalar("select max(SEQ) from TopoEquipment where PID =" + TestPlanID).ToString(); long currEqID = pDataIO.GetLastInsertData("TopoEquipment") + 1; long currEqParamID = pDataIO.GetLastInsertData("TopoEquipmentParameter") + 1; int myNewSeq = 1; if (MaxSeq.Length > 0) { myNewSeq = Convert.ToInt32(MaxSeq) + 1; } DataRow eqNewDr = eqDt.NewRow(); eqNewDr["ID"] = currEqID; eqNewDr["PID"] = TestPlanID; eqNewDr["GID"] = EqGid; eqNewDr["SEQ"] = myNewSeq; if (ddlRole.SelectedValue == "NA") { eqNewDr["Role"] = "0"; } else if (ddlRole.SelectedValue == "TX") { eqNewDr["Role"] = "1"; } else if (ddlRole.SelectedValue == "RX") { eqNewDr["Role"] = "2"; } else { eqNewDr["Role"] = "0"; } eqDt.Rows.Add(eqNewDr); //-->Create NewEqParamsDt rows for (int i = 0; i < ControlList.Length; i++) { string myGid = ControlList[i].myControlID; //string myGid = pCommCtrl.getDTColumnInfo(GlobalEqParamsDt, "ID", "PID=" + EqGid + " and ID ='" + ControlList[i].myControlID + "'"); DataRow dr = eqParamsDt.NewRow(); dr["id"] = currEqParamID; dr["pid"] = currEqID; dr["Gid"] = myGid; dr["ItemValue"] = ControlList[i].pTxtItemValue; eqParamsDt.Rows.Add(dr); currEqParamID++; } //150527 ---------------------更新方式变更>>Start int result = pDataIO.UpdateWithProc("TopoEquipment", eqDt, eqParamsDt, logTracingString); if (result > 0) { eqDt.AcceptChanges(); eqParamsDt.AcceptChanges(); Response.Redirect("~/WebFiles/TestPlan/Terry/EquipmentList.aspx?uId=" + TestPlanID, false); } else { pDataIO.AlertMsgShow("Update data fail!", Request.Url.ToString()); } //150527 ---------------------更新方式变更<<End #endregion } else { ClientScript.RegisterStartupScript(GetType(), "Message", "<Script>alert('Error!Can not find any Result,Current item has been deleted!~')</Script>"); } return(true); } catch (System.Exception ex) { pDataIO.WriteErrorLogs(ex.ToString()); throw ex; } }
public bool SaveData(object obj, string prameter) { try { if (mydt.Rows.Count == 1) { #region //已经获取到当前信息 mydt.Rows[0]["TypeID"] = ControlList[0].DdlTypeName.SelectedValue; mydt.Rows[0]["ItemName"] = ControlList[0].TxtItemName; mydt.Rows[0]["ItemDescription"] = ControlList[0].TxtItemDescription; mydt.Rows[0]["IgnoreFlag"] = ControlList[0].DdlIgnoreFlag; //150527 ---------------------更新方式变更>>Start int result = -1; if (Session["DB"].ToString().ToUpper() == "ATSDB") { result = pDataIO.UpdateWithProc("GlobalManufactureCoefficientsGroup", mydt, queryStr, logTracingString, "ATS_V2"); } else if (Session["DB"].ToString().ToUpper() == "ATSDEBUGDB") { result = pDataIO.UpdateWithProc("GlobalManufactureCoefficientsGroup", mydt, queryStr, logTracingString, "ATS_VXDEBUG"); } if (result > 0) { mydt.AcceptChanges(); Response.Redirect("~/WebFiles/MaintainInfo/MCoefGroup/GlobalMCoefList.aspx?uId=" + TypeID, true); } else { pDataIO.AlertMsgShow("数据更新失败!", Request.Url.ToString()); } //150527 ---------------------更新方式变更<<End #endregion } else if (AddNew && mydt.Rows.Count == 0) { #region //New long currEqID = pDataIO.GetLastInsertData("GlobalManufactureCoefficientsGroup") + 1; DataRow eqNewDr = mydt.NewRow(); eqNewDr["ID"] = currEqID; eqNewDr["TypeID"] = ControlList[0].DdlTypeName.SelectedValue; eqNewDr["ItemName"] = ControlList[0].TxtItemName; eqNewDr["ItemDescription"] = ControlList[0].TxtItemDescription; eqNewDr["IgnoreFlag"] = false; mydt.Rows.Add(eqNewDr); //150527 ---------------------更新方式变更>>Start int result = -1; if (Session["DB"].ToString().ToUpper() == "ATSDB") { result = pDataIO.UpdateWithProc("GlobalManufactureCoefficientsGroup", mydt, queryStr, logTracingString, "ATS_V2"); } else if (Session["DB"].ToString().ToUpper() == "ATSDEBUGDB") { result = pDataIO.UpdateWithProc("GlobalManufactureCoefficientsGroup", mydt, queryStr, logTracingString, "ATS_VXDEBUG"); } if (result > 0) { MCoefID = result.ToString(); mydt.AcceptChanges(); Response.Redirect("~/WebFiles/MaintainInfo/MCoefGroup/CurrMCoefParamInfo.aspx?AddNew=true&MCoefID=" + MCoefID, true); } else { pDataIO.AlertMsgShow("数据更新失败!", Request.Url.ToString()); } //150527 ---------------------更新方式变更<<End #endregion } else { ClientScript.RegisterStartupScript(GetType(), "Message", "<Script>alert('Error!当前项已被删除!')</Script>", false); } return(true); } catch (System.Exception ex) { pDataIO.WriteErrorLogs(ex.ToString()); throw ex; } }
public bool SaveData(object obj, string prameter) { try { DataSet ModelDS = new DataSet(); string strModelInfo = "select * from topoTestModel where id =" + ModelID; string strModelParam = "select * from TopoTestParameter where pid =" + ModelID; DataTable ModelDt = pDataIO.GetDataTable(strModelInfo, "topoTestModel"); DataTable ModelParamsDt = pDataIO.GetDataTable(strModelParam, "TopoTestParameter"); DataTable GlobalModelDt = pDataIO.GetDataTable("select * from GlobalAllTestModelList", "GlobalAllTestModelList"); DataTable GlobalModelParamsDt = pDataIO.GetDataTable("select * from GlobalTestModelParamterList", "GlobalTestModelParamterList"); ModelDS.Tables.Add(ModelDt); ModelDS.Tables.Add(ModelParamsDt); ModelDS.Relations.Add("ModelRelation", ModelDt.Columns["ID"], ModelParamsDt.Columns["pID"]); if (ModelDt.Rows.Count == 1) { #region //已经获取到当前设备的信息 string ModelGid = ModelDt.Rows[0]["GID"].ToString(); ModelDt.Rows[0]["IgnoreFlag"] = ModelControl.DdlIgnoreFlag; ModelDt.Rows[0]["FailBreak"] = ModelControl.DdlFailBreak; #region Params string paramsPid = ModelDt.Rows[0]["ID"].ToString(); for (int i = 0; i < ControlList.Length; i++) { //若为新增的参数则需要Add if (ControlList[i] != null) { string myGid = ControlList[i].myControlID.ToString().Split('_')[1]; //string myGid = pCommCtrl.getDTColumnInfo(GlobalModelParamsDt, "ID", "PID=" + ModelGid + " and ItemName ='" + ControlList[i].TxtItemName.Replace("[NewParam]", "") + "'"); if (ControlList[i].ID.ToString().Contains("ModelParam_New_")) { DataRow dr = ModelParamsDt.NewRow(); dr["pid"] = paramsPid; dr["Gid"] = myGid; dr["ItemValue"] = ControlList[i].TxtItemValue; ModelParamsDt.Rows.Add(dr); } else { for (int j = 0; j < ModelParamsDt.Rows.Count; j++) { if (ModelParamsDt.Rows[j]["GID"].ToString().ToLower().Trim() == myGid) { ModelParamsDt.Rows[j]["ItemValue"] = ControlList[i].TxtItemValue; } } } } } //150527 ---------------------更新方式变更>>Start int result = pDataIO.UpdateWithProc("topoTestModel", ModelDt, ModelParamsDt, logTracingString); if (result > 0) { ModelDt.AcceptChanges(); ModelParamsDt.AcceptChanges(); Response.Redirect("~/WebFiles/Production_ATS/TestPlan/ModelList.aspx?uId=" + CtrlID, false); } else { pDataIO.AlertMsgShow("数据更新失败!", Request.Url.ToString()); } //150527 ---------------------更新方式变更<<End #endregion } #endregion else if (AddNew && ddlItemName.Text.Length > 0) { #region //New string ModelGid = pCommCtrl.getDTColumnInfo(GlobalModelDt, "ID", "ShowName='" + ddlItemName.Text + "'"); string MaxSeq = pDataIO.getDbCmdExecuteScalar("select max(SEQ) from topoTestModel where PID =" + CtrlID).ToString(); long currModelID = pDataIO.GetLastInsertData("topoTestModel") + 1; long currModelParamID = pDataIO.GetLastInsertData("TopoTestParameter") + 1; int myNewSeq = 1; if (MaxSeq.Length > 0) { myNewSeq = Convert.ToInt32(MaxSeq) + 1; } DataRow ModelNewDr = ModelDt.NewRow(); ModelNewDr["ID"] = currModelID; ModelNewDr["PID"] = CtrlID; ModelNewDr["GID"] = ModelGid; ModelNewDr["SEQ"] = myNewSeq; ModelNewDr["IgnoreFlag"] = ddlIgnoreFlag.Text; ModelNewDr["FailBreak"] = ddlFailBreak.Text; ModelDt.Rows.Add(ModelNewDr); //-->Create NewEqParamsDt rows for (int i = 0; i < ControlList.Length; i++) { string myGid = ControlList[i].myControlID.ToString().Split('_')[1]; //string myGid = pCommCtrl.getDTColumnInfo(GlobalModelParamsDt, "ID", "PID=" + ModelGid + " and ItemName ='" + ControlList[i].TxtItemName.Replace("[NewParam]", "") + "'"); DataRow dr = ModelParamsDt.NewRow(); dr["id"] = currModelParamID; dr["pid"] = currModelID; dr["Gid"] = myGid; dr["ItemValue"] = ControlList[i].TxtItemValue; ModelParamsDt.Rows.Add(dr); currModelParamID++; } //150527 ---------------------更新方式变更>>Start int result = pDataIO.UpdateWithProc("topoTestModel", ModelDt, ModelParamsDt, logTracingString); if (result > 0) { ModelDt.AcceptChanges(); ModelParamsDt.AcceptChanges(); Response.Redirect("~/WebFiles/Production_ATS/TestPlan/ModelList.aspx?uId=" + CtrlID, false); } else { pDataIO.AlertMsgShow("数据更新失败!", Request.Url.ToString()); } //150527 ---------------------更新方式变更<<End #endregion } else if (AddNew && ddlItemName.Text.Length == 0) { ClientScript.RegisterStartupScript(GetType(), "Message", "<Script>alert('请选择测试模型!')</Script>"); } else { //ClientScript.RegisterStartupScript(GetType(),"Message", "<Script>alert('Error!Can not find any Result,Current item has been deleted!~')</Script>"); ClientScript.RegisterStartupScript(GetType(), "Message", "<Script>alert('Error!当前项已被删除!')</Script>"); } return(true); } catch (System.Exception ex) { pDataIO.WriteErrorLogs(ex.ToString()); throw ex; } }
public bool DeleteData(object obj, string prameter) { //Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "<script>if(confirm('Are you sure you want to delete?')){DeleteData1();}else{}</script>"); bool isSelected = false; string deletStr = "select * from GlobalProductionName where IgnoreFlag='False'and PID=" + moduleTypeID; try { for (int i = 0; i < prductionPNList.Length; i++) { ASCXProducPNList cb = (ASCXProducPNList)PRPNList.FindControl(prductionPNList[i].ID); if (cb != null) { if (cb.BeSelected == true) { mydt.Rows[i]["IgnoreFlag"] = true; isSelected = true; } } else { Response.Write("<script>alert('can not find user control!');</script>"); return(false); } } if (isSelected == false) { //Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "<script>alert('请至少选择一个!');return false;</script>"); this.Page.RegisterStartupScript("", "<script>alert('请至少选择一个!');</script>"); return(false); } int result = -1; if (Session["DB"].ToString().ToUpper() == "ATSDB") { result = pDataIO.UpdateWithProc("GlobalProductionName", mydt, deletStr, logTracingString, "ATS_V2"); } else if (Session["DB"].ToString().ToUpper() == "ATSDEBUGDB") { result = pDataIO.UpdateWithProc("GlobalProductionName", mydt, deletStr, logTracingString, "ATS_VXDEBUG"); } if (result > 0) { mydt.AcceptChanges(); DataTable dt = pDataIO.GetDataTable("select newtable.num from (select ROW_NUMBER() OVER (ORDER BY GlobalProductionType.ID ASC) AS num,GlobalProductionType.ID from GlobalProductionType where GlobalProductionType.IgnoreFlag='false') as newtable where newtable.ID=" + moduleTypeID, "GlobalProductionTypeNum"); Session["TreeNodeExpand"] = Convert.ToInt32(dt.Rows[0]["num"]) - 1; Session["iframe_src"] = "WebFiles/Production_ATS/Production/ProductionPNList.aspx?uId=" + moduleTypeID; ScriptManager.RegisterStartupScript(this, typeof(Page), "", "window.parent.RefreshTreeNode();", true); } else { pDataIO.AlertMsgShow("数据更新失败!"); Response.Redirect(Request.Url.ToString()); } //Response.Redirect(Request.Url.ToString()); return(true); } catch (System.Exception ex) { pDataIO.WriteErrorLogs(ex.ToString()); throw ex; } }
public bool SaveData(object obj, string prameter) { string updataStr = "select * from GlobalProductionName where ID=" + moduleTypeID; try { if (AddNew) { DataTable inserTable = pDataIO.GetDataTable(updataStr, "GlobalProductionName"); DataRow dr = inserTable.NewRow(); { dr[0] = -1; dr[1] = moduleTypeID; dr[2] = pnSelf.Colum2TextConfig; dr[3] = pnSelf.Colum3TextConfig; dr[4] = pnSelf.Colum4TextConfig; dr[5] = pnSelf.Colum5TextConfig; dr[6] = pnSelf.Colum6TextConfig; dr[7] = MCoefsIDMap[pnSelf.ConfigSeletedIndexDD7]; dr[8] = false; dr[9] = pnSelf.ConfigSeletedIndexDD8; dr[10] = pnSelf.ConfigSeletedIndexDD10; dr[11] = pnSelf.ConfigSeletedIndexDD11; dr[12] = pnSelf.ConfigSeletedIndexDD12; dr[13] = pnSelf.ConfigSeletedIndexDD13; dr[14] = pnSelf.ConfigSeletedIndexDD14; dr[15] = pnSelf.Colum15TextConfig; dr[16] = pnSelf.Colum16TextConfig; dr[17] = pnSelf.Colum17TextConfig; dr[18] = pnSelf.Colum18TextConfig; dr[19] = pnSelf.DropDownTextSelected; dr[20] = pnSelf.Colum20TextConfig; } inserTable.Rows.Add(dr); int result = pDataIO.UpdateWithProc("GlobalProductionName", inserTable, updataStr, logTracingString); if (result > 0) { inserTable.AcceptChanges(); Response.Redirect("~/WebFiles/Production/ProductionPNList.aspx?uId=" + moduleTypeID.Trim()); } else { //pDataIO.AlertMsgShow("Update data fail!",Request.Url.ToString()); pnSelf.Colum2TextConfig = ""; pDataIO.AlertMsgShow("Update data fail!"); } } else { for (byte i = 0; i < pnSelfInforList.Length; i++) { mydt.Rows[i]["PN"] = pnSelfInforList[i].Colum2TextConfig; mydt.Rows[i]["ItemName"] = pnSelfInforList[i].Colum3TextConfig; mydt.Rows[i]["Channels"] = pnSelfInforList[i].Colum4TextConfig; mydt.Rows[i]["Voltages"] = pnSelfInforList[i].Colum5TextConfig; mydt.Rows[i]["Tsensors"] = pnSelfInforList[i].Colum6TextConfig; mydt.Rows[i]["MCoefsID"] = MCoefsIDMap[pnSelfInforList[i].ConfigSeletedIndexDD7]; mydt.Rows[i]["OldDriver"] = pnSelfInforList[i].ConfigSeletedIndexDD8; mydt.Rows[i]["TEC_Present"] = pnSelfInforList[i].ConfigSeletedIndexDD10; mydt.Rows[i]["Couple_Type"] = pnSelfInforList[i].ConfigSeletedIndexDD11; mydt.Rows[i]["APC_Type"] = pnSelfInforList[i].ConfigSeletedIndexDD12; mydt.Rows[i]["BER"] = pnSelfInforList[i].ConfigSeletedIndexDD13; mydt.Rows[i]["MaxRate"] = pnSelfInforList[i].ConfigSeletedIndexDD14; mydt.Rows[i]["Publish_PN"] = pnSelfInforList[i].Colum15TextConfig; mydt.Rows[i]["NickName"] = pnSelfInforList[i].Colum16TextConfig; mydt.Rows[i]["IbiasFormula"] = pnSelfInforList[i].Colum17TextConfig; mydt.Rows[i]["IModFormula"] = pnSelfInforList[i].Colum18TextConfig; mydt.Rows[i]["UsingCelsiusTemp"] = pnSelfInforList[i].DropDownTextSelected; mydt.Rows[i]["RxOverLoadDBm"] = pnSelfInforList[i].Colum20TextConfig; } int result = pDataIO.UpdateWithProc("GlobalProductionName", mydt, updataStr, logTracingString); if (result > 0) { mydt.AcceptChanges(); } else { pDataIO.AlertMsgShow("Update data fail!"); } for (byte i = 0; i < pnSelfInforList.Length; i++) { pnSelfInforList[i].EnableColum8Text = false; pnSelfInforList[i].EnableColum7Text = false; pnSelfInforList[i].EnableColum6Text = false; pnSelfInforList[i].EnableColum5Text = false; pnSelfInforList[i].EnableColum4Text = false; pnSelfInforList[i].EnableColum3Text = false; pnSelfInforList[i].EnableColum2Text = false; pnSelfInforList[i].EnableColum10Text = false; pnSelfInforList[i].EnableColum11Text = false; pnSelfInforList[i].EnableColum12Text = false; pnSelfInforList[i].EnableColum13Text = false; pnSelfInforList[i].EnableColum14Text = false; pnSelfInforList[i].EnableColum15Text = false; pnSelfInforList[i].EnableColum16Text = false; pnSelfInforList[i].EnableColum17Text = false; pnSelfInforList[i].EnableColum18Text = false; pnSelfInforList[i].EnableColum19Text = false; pnSelfInforList[i].EnableColum20Text = false; } } return(true); } catch (System.Exception ex) { pDataIO.WriteErrorLogs(ex.ToString()); throw ex; } }
public bool SaveData(object obj, string prameter) { string updataStr = "select * from GlobalProductionName where ID=" + moduleTypeID; try { bool refreshFlag = false; if (AddNew) { refreshFlag = true; DataTable inserTable = pDataIO.GetDataTable(updataStr, "GlobalProductionName"); DataRow dr = inserTable.NewRow(); { dr[0] = -1; dr[1] = moduleTypeID; dr[2] = pnSelf.Colum2TextConfig; dr[3] = pnSelf.Colum3TextConfig; dr[4] = pnSelf.Colum4TextConfig; dr[5] = pnSelf.Colum5TextConfig; dr[6] = pnSelf.Colum6TextConfig; dr[7] = MCoefsIDMap[pnSelf.ConfigSeletedIndexDD7]; dr[8] = false; dr[9] = pnSelf.ConfigSeletedIndexDD8; dr[10] = pnSelf.ConfigSeletedIndexDD10; dr[11] = pnSelf.ConfigSeletedIndexDD11; dr[12] = pnSelf.ConfigSeletedIndexDD12; dr[13] = pnSelf.ConfigSeletedIndexDD13; dr[14] = pnSelf.ConfigSeletedIndexDD14; dr[15] = pnSelf.Colum15TextConfig; dr[16] = pnSelf.Colum16TextConfig; dr[17] = pnSelf.Colum17TextConfig; dr[18] = pnSelf.Colum18TextConfig; dr[19] = pnSelf.DropDownTextSelected; dr[20] = pnSelf.Colum20TextConfig; dr[21] = pnSelf.DropDown21TextSelected; } inserTable.Rows.Add(dr); int result = -1; if (Session["DB"].ToString().ToUpper() == "ATSDB") { result = pDataIO.UpdateWithProc("GlobalProductionName", inserTable, updataStr, logTracingString, "ATS_V2"); } else if (Session["DB"].ToString().ToUpper() == "ATSDEBUGDB") { result = pDataIO.UpdateWithProc("GlobalProductionName", inserTable, updataStr, logTracingString, "ATS_VXDEBUG"); } if (result > 0) { inserTable.AcceptChanges(); //Response.Redirect("~/WebFiles/Production_ATS/Production/ProductionPNList.aspx?uId=" + moduleTypeID.Trim()); DataTable dt = pDataIO.GetDataTable("select newtable.num from (select ROW_NUMBER() OVER (ORDER BY GlobalProductionType.ID ASC) AS num,GlobalProductionType.ID from GlobalProductionType where GlobalProductionType.IgnoreFlag='false') as newtable where newtable.ID=" + moduleTypeID, "GlobalProductionTypeNum"); Session["TreeNodeExpand"] = Convert.ToInt32(dt.Rows[0]["num"]) - 1; dt = pDataIO.GetDataTable("select newtable.num,newtable.ID from (select ROW_NUMBER() OVER (ORDER BY GlobalProductionName.wsFlag ASC) AS num,GlobalProductionName.* from GlobalProductionName where IgnoreFlag='false' and PID =" + moduleTypeID + ") as newtable where newtable.PN ='" + pnSelf.Colum2TextConfig + "'", "GlobalProductionNameNum"); Session["TreeNodeExpand"] = Session["TreeNodeExpand"].ToString() + "+" + (Convert.ToInt32(dt.Rows[0]["num"]) - 1).ToString(); Session["iframe_src"] = "WebFiles/Production_ATS/Production/PNSelfInfor.aspx?AddNew=false&uId=" + Convert.ToInt32(dt.Rows[0]["ID"]); ScriptManager.RegisterStartupScript(this, typeof(Page), "", "window.parent.RefreshTreeNode();", true); } else { //pDataIO.AlertMsgShow("数据更新失败!",Request.Url.ToString()); pnSelf.Colum2TextConfig = ""; pDataIO.AlertMsgShow("数据更新失败!"); } } else { for (byte i = 0; i < pnSelfInforList.Length; i++) { if (mydt.Rows[i]["PN"].ToString() != pnSelfInforList[i].Colum2TextConfig || Convert.ToInt32(mydt.Rows[i]["wsFlag"]) != pnSelfInforList[i].DropDown21TextSelected) { refreshFlag = true; } else { refreshFlag = false; } mydt.Rows[i]["PN"] = pnSelfInforList[i].Colum2TextConfig; mydt.Rows[i]["ItemName"] = pnSelfInforList[i].Colum3TextConfig; mydt.Rows[i]["Channels"] = pnSelfInforList[i].Colum4TextConfig; mydt.Rows[i]["Voltages"] = pnSelfInforList[i].Colum5TextConfig; mydt.Rows[i]["Tsensors"] = pnSelfInforList[i].Colum6TextConfig; mydt.Rows[i]["MCoefsID"] = MCoefsIDMap[pnSelfInforList[i].ConfigSeletedIndexDD7]; mydt.Rows[i]["OldDriver"] = pnSelfInforList[i].ConfigSeletedIndexDD8; mydt.Rows[i]["TEC_Present"] = pnSelfInforList[i].ConfigSeletedIndexDD10; mydt.Rows[i]["Couple_Type"] = pnSelfInforList[i].ConfigSeletedIndexDD11; mydt.Rows[i]["APC_Type"] = pnSelfInforList[i].ConfigSeletedIndexDD12; mydt.Rows[i]["BER"] = pnSelfInforList[i].ConfigSeletedIndexDD13; mydt.Rows[i]["MaxRate"] = pnSelfInforList[i].ConfigSeletedIndexDD14; mydt.Rows[i]["Publish_PN"] = pnSelfInforList[i].Colum15TextConfig; mydt.Rows[i]["NickName"] = pnSelfInforList[i].Colum16TextConfig; mydt.Rows[i]["IbiasFormula"] = pnSelfInforList[i].Colum17TextConfig; mydt.Rows[i]["IModFormula"] = pnSelfInforList[i].Colum18TextConfig; mydt.Rows[i]["UsingCelsiusTemp"] = pnSelfInforList[i].DropDownTextSelected; mydt.Rows[i]["RxOverLoadDBm"] = pnSelfInforList[i].Colum20TextConfig; mydt.Rows[i]["wsFlag"] = pnSelfInforList[i].DropDown21TextSelected; } int result = -1; if (Session["DB"].ToString().ToUpper() == "ATSDB") { result = pDataIO.UpdateWithProc("GlobalProductionName", mydt, updataStr, logTracingString, "ATS_V2"); } else if (Session["DB"].ToString().ToUpper() == "ATSDEBUGDB") { result = pDataIO.UpdateWithProc("GlobalProductionName", mydt, updataStr, logTracingString, "ATS_VXDEBUG"); } if (result > 0) { mydt.AcceptChanges(); if (refreshFlag) { DataTable dt = pDataIO.GetDataTable("select PID from GlobalProductionName where ID=" + moduleTypeID, "GlobalProductionName"); int typeID = Convert.ToInt32(dt.Rows[0]["PID"]); dt = pDataIO.GetDataTable("select newtable.num from (select ROW_NUMBER() OVER (ORDER BY GlobalProductionType.ID ASC) AS num,GlobalProductionType.ID from GlobalProductionType where GlobalProductionType.IgnoreFlag='false') as newtable where newtable.ID=" + typeID, "GlobalProductionTypeNum"); Session["TreeNodeExpand"] = Convert.ToInt32(dt.Rows[0]["num"]) - 1; dt = pDataIO.GetDataTable("select newtable.num,newtable.ID from (select ROW_NUMBER() OVER (ORDER BY GlobalProductionName.wsFlag ASC) AS num,GlobalProductionName.* from GlobalProductionName where IgnoreFlag='false' and PID =" + typeID + ") as newtable where newtable.PN ='" + pnSelfInforList[0].Colum2TextConfig + "'", "GlobalProductionNameNum"); Session["TreeNodeExpand"] = Session["TreeNodeExpand"].ToString() + "+" + (Convert.ToInt32(dt.Rows[0]["num"]) - 1).ToString(); Session["iframe_src"] = "WebFiles/Production_ATS/Production/PNSelfInfor.aspx?AddNew=false&uId=" + moduleTypeID; ScriptManager.RegisterStartupScript(this, typeof(Page), "", "window.parent.RefreshTreeNode();", true); } } else { pDataIO.AlertMsgShow("数据更新失败!"); } for (byte i = 0; i < pnSelfInforList.Length; i++) { pnSelfInforList[i].EnableColum8Text = false; pnSelfInforList[i].EnableColum7Text = false; pnSelfInforList[i].EnableColum6Text = false; pnSelfInforList[i].EnableColum5Text = false; pnSelfInforList[i].EnableColum4Text = false; pnSelfInforList[i].EnableColum3Text = false; pnSelfInforList[i].EnableColum2Text = false; pnSelfInforList[i].EnableColum10Text = false; pnSelfInforList[i].EnableColum11Text = false; pnSelfInforList[i].EnableColum12Text = false; pnSelfInforList[i].EnableColum13Text = false; pnSelfInforList[i].EnableColum14Text = false; pnSelfInforList[i].EnableColum15Text = false; pnSelfInforList[i].EnableColum16Text = false; pnSelfInforList[i].EnableColum17Text = false; pnSelfInforList[i].EnableColum18Text = false; pnSelfInforList[i].EnableColum19Text = false; pnSelfInforList[i].EnableColum20Text = false; pnSelfInforList[i].EnableColum21Text = false; } } return(true); } catch (System.Exception ex) { pDataIO.WriteErrorLogs(ex.ToString()); throw ex; } }
public bool SaveData(object obj, string prameter) { //string updataStr = "select * from GlobalProductionType where ID=" + moduleTypeID; string updataStr = "select * from TopoPNSpecsParams"; //ConfigOptionButtonsVisible(); try { if (AddNew) { //ConfigRangeValidator(PNSpecInfor); if (!IsRangeValidator()) { return(false); } DataTable inserTable = pDataIO.GetDataTable(updataStr, "TopoPNSpecsParams"); DataRow dr = inserTable.NewRow(); dr[0] = -1; dr[1] = moduleTypeID; dr[2] = GlobalPNSpecIDMap[PNSpecInfor.ConfigSeletedIndex]; dr[3] = PNSpecInfor.Colum3TextConfig; dr[4] = PNSpecInfor.Colum4TextConfig; dr[5] = PNSpecInfor.Colum5TextConfig; dr[6] = PNChannelsIDMap[(byte)PNSpecInfor.ConfigSeletedIndexChannel]; inserTable.Rows.Add(dr); int result = -1; if (Session["DB"].ToString().ToUpper() == "ATSDB") { result = pDataIO.UpdateWithProc("TopoPNSpecsParams", inserTable, updataStr, logTracingString, "ATS_V2"); } else if (Session["DB"].ToString().ToUpper() == "ATSDEBUGDB") { result = pDataIO.UpdateWithProc("TopoPNSpecsParams", inserTable, updataStr, logTracingString, "ATS_VXDEBUG"); } if (result > 0) { inserTable.AcceptChanges(); Response.Redirect("~/WebFiles/Production_ATS/TestPlan/TopPNSpecList.aspx?uId=" + moduleTypeID.Trim()); } else { pDataIO.AlertMsgShow("数据更新失败!", Request.Url.ToString()); } return(true); } else { //ConfigRangeValidator(PNSpecSelfInforList[0]); if (!IsRangeValidator()) { PNSpecSelfInforList[0].EnableColum2Text = false; PNSpecSelfInforList[0].EnableColum3Text = false; PNSpecSelfInforList[0].EnableColum4Text = false; PNSpecSelfInforList[0].EnableColum5Text = false; PNSpecSelfInforList[0].EnableColum7Text = false; return(false); } if (rowCount != 1) { return(false); } else { for (byte j = 0; j < PNSpecSelfInforList.Length; j++) { mydt.Rows[0]["SID"] = GlobalPNSpecIDMap[PNSpecSelfInforList[j].ConfigSeletedIndex]; mydt.Rows[0]["Typical"] = PNSpecSelfInforList[j].Colum3TextConfig; mydt.Rows[0]["SpecMin"] = PNSpecSelfInforList[j].Colum4TextConfig; mydt.Rows[0]["SpecMax"] = PNSpecSelfInforList[j].Colum5TextConfig; mydt.Rows[0]["Channel"] = PNChannelsIDMap[(byte)PNSpecSelfInforList[j].ConfigSeletedIndexChannel];; } } int result = -1; if (Session["DB"].ToString().ToUpper() == "ATSDB") { result = pDataIO.UpdateWithProc("TopoPNSpecsParams", mydt, updataStr, logTracingString, "ATS_V2"); } else if (Session["DB"].ToString().ToUpper() == "ATSDEBUGDB") { result = pDataIO.UpdateWithProc("TopoPNSpecsParams", mydt, updataStr, logTracingString, "ATS_VXDEBUG"); } if (result > 0) { mydt.AcceptChanges(); } else { pDataIO.AlertMsgShow("数据更新失败!"); } for (byte i = 0; i < PNSpecSelfInforList.Length; i++) { PNSpecSelfInforList[i].EnableColum2Text = false; PNSpecSelfInforList[i].EnableColum3Text = false; PNSpecSelfInforList[i].EnableColum4Text = false; PNSpecSelfInforList[i].EnableColum5Text = false; PNSpecSelfInforList[i].EnableColum7Text = false; } return(true); } } catch (System.Exception ex) { pDataIO.WriteErrorLogs(ex.ToString()); throw ex; } }
public bool SaveData(object obj, string prameter) { string updataStr = "select * from PNChipMap where ID=" + moduleTypeID; try { if (AddNew) { DataTable inserTable = pDataIO.GetDataTable(updataStr, "PNChipMap"); DataRow dr = inserTable.NewRow(); dr[0] = -1; dr[1] = moduleTypeID; dr[2] = ChipIDMap[pnchipSelf.Colum1TextSelected]; dr[3] = pnchipSelf.Colum2TextSelected; dr[4] = pnchipSelf.Colum3TextSelected; inserTable.Rows.Add(dr); int result = -1; if (Session["DB"].ToString().ToUpper() == "ATSDB") { result = pDataIO.UpdateWithProc("PNChipMap", inserTable, updataStr, logTracingString, "ATS_V2"); } else if (Session["DB"].ToString().ToUpper() == "ATSDEBUGDB") { result = pDataIO.UpdateWithProc("PNChipMap", inserTable, updataStr, logTracingString, "ATS_VXDEBUG"); } if (result > 0) { inserTable.AcceptChanges(); Response.Redirect("~/WebFiles/Production_ATS/Production/PNChipList.aspx?uId=" + moduleTypeID.Trim()); } else { pDataIO.AlertMsgShow("数据更新失败!", Request.Url.ToString()); } return(true); } else { if (rowCount != 1) { return(false); } else { for (byte j = 0; j < PNChipSelfInforList.Length; j++) { mydt.Rows[0]["ChipID"] = ChipIDMap[PNChipSelfInforList[j].Colum1TextSelected]; mydt.Rows[0]["ChipRoleID"] = PNChipSelfInforList[j].Colum2TextSelected; mydt.Rows[0]["ChipDirection"] = PNChipSelfInforList[j].Colum3TextSelected; } int result = -1; if (Session["DB"].ToString().ToUpper() == "ATSDB") { result = pDataIO.UpdateWithProc("PNChipMap", mydt, updataStr, logTracingString, "ATS_V2"); } else if (Session["DB"].ToString().ToUpper() == "ATSDEBUGDB") { result = pDataIO.UpdateWithProc("PNChipMap", mydt, updataStr, logTracingString, "ATS_VXDEBUG"); } if (result > 0) { mydt.AcceptChanges(); } else { pDataIO.AlertMsgShow("数据更新失败!"); } for (byte i = 0; i < PNChipSelfInforList.Length; i++) { PNChipSelfInforList[i].EnableColum2Text = false; PNChipSelfInforList[i].EnableColum3Text = false; PNChipSelfInforList[i].EnableColum1Text = false; } return(true); } } } catch (System.Exception ex) { throw ex; } }
public bool SaveData(object obj, string prameter) { string updataStr = "select * from TopoMSAEEPROMSet where ID=" + moduleTypeID; try { if (AddNew) { DataTable inserTable = pDataIO.GetDataTable(updataStr, "TopoMSAEEPROMSet"); DataRow dr = inserTable.NewRow(); dr[0] = -1; dr[1] = moduleTypeID; dr[2] = e2romIControl.Colum2TextConfig; dr[3] = ""; dr[4] = 0; dr[5] = ""; dr[6] = 0; dr[7] = ""; dr[8] = 0; dr[9] = ""; dr[10] = 0; inserTable.Rows.Add(dr); int result = pDataIO.UpdateWithProc("TopoMSAEEPROMSet", inserTable, updataStr, logTracingString); if (result > 0) { inserTable.AcceptChanges(); Response.Redirect("~/WebFiles/Production/TopEEROMList.aspx?uId=" + moduleTypeID.Trim()); } else { pDataIO.AlertMsgShow("Update data fail!", Request.Url.ToString()); } return(true); } else { if (rowCount != 1) { return(false); } else { for (byte j = 0; j < e2romIniSelfInforlist.Length; j++) { mydt.Rows[0]["ItemName"] = e2romIniSelfInforlist[j].Colum2TextConfig; } int result = pDataIO.UpdateWithProc("TopoMSAEEPROMSet", mydt, updataStr, logTracingString); if (result > 0) { mydt.AcceptChanges(); } else { pDataIO.AlertMsgShow("Update data fail!"); } for (byte i = 0; i < e2romIniSelfInforlist.Length; i++) { e2romIniSelfInforlist[i].EnableColum2Text = false; } return(true); } } } catch (System.Exception ex) { throw ex; } }
public bool SaveData(object obj, string prameter) { try { if (mydt.Rows.Count == 1) { #region //已经获取到当前设备的信息 mydt.Rows[0]["ItemName"] = ControlList[0].TxtItemName; mydt.Rows[0]["ShowName"] = ControlList[0].TxtShowName; mydt.Rows[0]["ItemType"] = ChangeItemTypeIndextoName(ControlList[0].GSItemTypeDropDownList); mydt.Rows[0]["ItemValue"] = ControlList[0].TxtItemValue; mydt.Rows[0]["NeedSelect"] = ControlList[0].TxtddlNeedCheckParams; mydt.Rows[0]["Optionalparams"] = ControlList[0].TxtOptionalparams; mydt.Rows[0]["ItemDescription"] = ControlList[0].TxtItemDescription; //150527 ---------------------更新方式变更>>Start int result = -1; if (Session["DB"].ToString().ToUpper() == "ATSDB") { result = pDataIO.UpdateWithProc("GlobalTestModelParamterList", mydt, queryStr, logTracingString, "ATS_V2"); } else if (Session["DB"].ToString().ToUpper() == "ATSDEBUGDB") { result = pDataIO.UpdateWithProc("GlobalTestModelParamterList", mydt, queryStr, logTracingString, "ATS_VXDEBUG"); } if (result > 0) { mydt.AcceptChanges(); Response.Redirect("~/WebFiles/MaintainInfo/APPModel/GlobalModelParamsList.aspx?uId=" + ModelID, false); } else { pDataIO.AlertMsgShow("数据更新失败!", Request.Url.ToString()); } //150527 ---------------------更新方式变更<<End #endregion } else if (AddNew && mydt.Rows.Count == 0) { #region //New long currParamID = pDataIO.GetLastInsertData("GlobalTestModelParamterList") + 1; DataRow eqNewDr = mydt.NewRow(); eqNewDr["ID"] = currParamID; eqNewDr["PID"] = ModelID; eqNewDr["ItemName"] = ControlList[0].TxtItemName; eqNewDr["ShowName"] = ControlList[0].TxtShowName; eqNewDr["ItemType"] = ChangeItemTypeIndextoName(ControlList[0].GSItemTypeDropDownList); eqNewDr["ItemValue"] = ControlList[0].TxtItemValue; eqNewDr["NeedSelect"] = ControlList[0].TxtddlNeedCheckParams; eqNewDr["Optionalparams"] = ControlList[0].TxtOptionalparams; eqNewDr["ItemDescription"] = ControlList[0].TxtItemDescription; mydt.Rows.Add(eqNewDr); //150527 ---------------------更新方式变更>>Start int result = -1; if (Session["DB"].ToString().ToUpper() == "ATSDB") { result = pDataIO.UpdateWithProc("GlobalTestModelParamterList", mydt, queryStr, logTracingString, "ATS_V2"); } else if (Session["DB"].ToString().ToUpper() == "ATSDEBUGDB") { result = pDataIO.UpdateWithProc("GlobalTestModelParamterList", mydt, queryStr, logTracingString, "ATS_VXDEBUG"); } if (result > 0) { mydt.AcceptChanges(); Response.Redirect("~/WebFiles/MaintainInfo/APPModel/GlobalModelParamsList.aspx?uId=" + ModelID, false); } else { pDataIO.AlertMsgShow("数据更新失败!", Request.Url.ToString()); } //150527 ---------------------更新方式变更<<End #endregion } else { ClientScript.RegisterStartupScript(GetType(), "Message", "<Script>alert('Error!当前项已被删除!')</Script>"); } return(true); } catch (System.Exception ex) { pDataIO.WriteErrorLogs(ex.ToString()); throw ex; } }
public bool SaveData(object obj, string prameter) { try { int addCount = 0; for (int i = 0; i < ControlList.Length; i++) { if (ControlList[i] != null && ControlList[i].TrBackgroundColor.Contains("F2F2F2") && ControlList[i].BeSelected == false) //原有项需删除 { for (int j = 0; j < mydt.Rows.Count; j++) { if (mydt.Rows[j].RowState != DataRowState.Deleted) { if ((mydt.Rows[j]["SpecID"].ToString()).ToLower() == ControlList[i].ID.ToLower()) { mydt.Rows[j].Delete(); break; } } } } else if (ControlList[i] != null && ControlList[i].TrBackgroundColor.Contains("White") && ControlList[i].BeSelected == true) //原没有项需新增 { long currEqID = pDataIO.GetLastInsertData("ReportHeaderSpecs") + 1; DataRow eqNewDr = mydt.NewRow(); eqNewDr["ID"] = currEqID; eqNewDr["PID"] = ReportHeaderID; eqNewDr["SpecID"] = ControlList[i].ID; string MaxSeq = pDataIO.getDbCmdExecuteScalar("select max(Seq) from ReportHeaderSpecs where PID =" + ReportHeaderID).ToString(); int myNewSeq = 1; if (MaxSeq.Length > 0) { myNewSeq = Convert.ToInt32(MaxSeq) + 1; } eqNewDr["Seq"] = myNewSeq + addCount; mydt.Rows.Add(eqNewDr); addCount++; } } int result = -1; if (Session["DB"].ToString().ToUpper() == "ATSDB") { result = pDataIO.UpdateWithProc("ReportHeaderSpecs", mydt, queryStr, logTracingString, "ATS_V2"); } else if (Session["DB"].ToString().ToUpper() == "ATSDEBUGDB") { result = pDataIO.UpdateWithProc("ReportHeaderSpecs", mydt, queryStr, logTracingString, "ATS_VXDEBUG"); } if (result > 0) { mydt.AcceptChanges(); } else { pDataIO.AlertMsgShow("数据更新失败!"); } Response.Redirect("~/WebFiles/MaintainInfo/ReportHeader/ReportHeaderSpecsList.aspx?uId=" + ReportHeaderID); return(true); } catch (System.Exception ex) { pDataIO.WriteErrorLogs(ex.ToString()); throw ex; } }
public bool SaveData(object obj, string prameter) { try { if (mydt.Rows.Count == 1) { #region //已经获取到当前设备的信息 mydt.Rows[0]["ItemName"] = ControlList[0].TxtItemName; mydt.Rows[0]["ItemType"] = ControlList[0].TxtItemType; mydt.Rows[0]["Channel"] = ControlList[0].TxtDdlChannel; mydt.Rows[0]["Page"] = ControlList[0].TxtPage; mydt.Rows[0]["StartAddress"] = ControlList[0].TxtStartAddress; mydt.Rows[0]["Length"] = ControlList[0].TxtLength; mydt.Rows[0]["Format"] = ControlList[0].TxtDdlFormat; mydt.Rows[0]["AmplifyCoeff"] = ControlList[0].TxtAmplify; //150527 ---------------------更新方式变更>>Start int result = -1; if (Session["DB"].ToString().ToUpper() == "ATSDB") { result = pDataIO.UpdateWithProc("GlobalManufactureCoefficients", mydt, queryStr, logTracingString, "ATS_V2"); } else if (Session["DB"].ToString().ToUpper() == "ATSDEBUGDB") { result = pDataIO.UpdateWithProc("GlobalManufactureCoefficients", mydt, queryStr, logTracingString, "ATS_VXDEBUG"); } if (result > 0) { mydt.AcceptChanges(); Response.Redirect("~/WebFiles/MaintainInfo/MCoefGroup/GlobalMCoefParamsList.aspx?uId=" + MCoefID, true); } else { pDataIO.AlertMsgShow("数据更新失败!", Request.Url.ToString()); } //150527 ---------------------更新方式变更<<End #endregion } else if (AddNew && mydt.Rows.Count == 0) { #region //New long currParamID = pDataIO.GetLastInsertData("GlobalManufactureCoefficients") + 1; DataRow eqNewDr = mydt.NewRow(); eqNewDr["ID"] = currParamID; eqNewDr["PID"] = MCoefID; eqNewDr["ItemName"] = ControlList[0].TxtItemName; eqNewDr["ItemType"] = ControlList[0].TxtItemType; eqNewDr["Channel"] = ControlList[0].TxtDdlChannel; eqNewDr["Page"] = ControlList[0].TxtPage; eqNewDr["StartAddress"] = ControlList[0].TxtStartAddress; eqNewDr["Length"] = ControlList[0].TxtLength; eqNewDr["Format"] = ControlList[0].TxtDdlFormat; eqNewDr["AmplifyCoeff"] = ControlList[0].TxtAmplify; mydt.Rows.Add(eqNewDr); //150527 ---------------------更新方式变更>>Start int result = -1; if (Session["DB"].ToString().ToUpper() == "ATSDB") { result = pDataIO.UpdateWithProc("GlobalManufactureCoefficients", mydt, queryStr, logTracingString, "ATS_V2"); } else if (Session["DB"].ToString().ToUpper() == "ATSDEBUGDB") { result = pDataIO.UpdateWithProc("GlobalManufactureCoefficients", mydt, queryStr, logTracingString, "ATS_VXDEBUG"); } if (result > 0) { mydt.AcceptChanges(); Response.Redirect("~/WebFiles/MaintainInfo/MCoefGroup/GlobalMCoefParamsList.aspx?uId=" + MCoefID, true); } else { pDataIO.AlertMsgShow("数据更新失败!", Request.Url.ToString()); } //150527 ---------------------更新方式变更<<End #endregion } else { ClientScript.RegisterStartupScript(GetType(), "Message", "<Script>alert('Error!当前项已被删除!')</Script>", false); } return(true); } catch (System.Exception ex) { pDataIO.WriteErrorLogs(ex.ToString()); throw ex; } }
public bool SaveData(object obj, string prameter) { string updataStr = "select * from ChannelMap where ID=" + moduleTypeID; try { if (AddNew) { DataTable inserTable = pDataIO.GetDataTable(updataStr, "ChannelMap"); DataRow dr = inserTable.NewRow(); dr[0] = -1; dr[1] = moduleTypeID; dr[2] = channelMap.ConfigColum1Text; dr[3] = channelMap.ConfigColum2Text; dr[4] = channelMap.ConfigColum3Text; inserTable.Rows.Add(dr); int result = pDataIO.UpdateWithProc("ChannelMap", inserTable, updataStr, logTracingString); if (result > 0) { inserTable.AcceptChanges(); Response.Redirect("~/WebFiles/Production/ChannelMapList.aspx?uId=" + moduleTypeID.Trim()); } else { pDataIO.AlertMsgShow("Update data fail!", Request.Url.ToString()); } return(true); } else { if (rowCount != 1) { return(false); } else { for (byte j = 0; j < ChannelMapSelfInforlist.Length; j++) { mydt.Rows[0]["ModuleLine"] = ChannelMapSelfInforlist[j].ConfigColum1Text; mydt.Rows[0]["ChipLine"] = ChannelMapSelfInforlist[j].ConfigColum2Text; mydt.Rows[0]["DebugLine"] = ChannelMapSelfInforlist[j].ConfigColum3Text; } int result = pDataIO.UpdateWithProc("ChannelMap", mydt, updataStr, logTracingString); if (result > 0) { mydt.AcceptChanges(); } else { pDataIO.AlertMsgShow("Update data fail!"); } for (byte i = 0; i < ChannelMapSelfInforlist.Length; i++) { ChannelMapSelfInforlist[i].EnableColum2Text = false; ChannelMapSelfInforlist[i].EnableColum1Text = false; ChannelMapSelfInforlist[i].EnableColum3Text = false; } return(true); } } } catch (System.Exception ex) { throw ex; } }
public bool SaveData(object obj, string prameter) { try { DataTable dtPN = new DataTable(); DataTable dtPlan = new DataTable(); #region Save PNAction for (int i = 0; i < PNActionList.Length; i++) { if (PNActionList[i].CheckBoxAddPlanSelected == true) { PNAction.Rows[i]["AddPlan"] = "true"; } else { PNAction.Rows[i]["AddPlan"] = "false"; } if (PNActionList[i].CheckBoxEditSelected == true) { PNAction.Rows[i]["ModifyPN"] = "true"; } else { PNAction.Rows[i]["ModifyPN"] = "false"; } } string updataStr = "select * from UserPNAction where UserID=" + userID; dtPN = pDataIO.GetDataTable(updataStr, "UserPNAction"); for (int i = 0; i < PNAction.Rows.Count; i++) { DataRow[] drs = dtPN.Select("PNID=" + PNAction.Rows[i]["ID"]); if (drs.Length == 1) { if (PNAction.Rows[i]["AddPlan"].ToString() == "true" | PNAction.Rows[i]["ModifyPN"].ToString() == "true") { if (PNAction.Rows[i]["AddPlan", DataRowVersion.Original].ToString() != PNAction.Rows[i]["AddPlan", DataRowVersion.Current].ToString()) { drs[0]["AddPlan"] = PNAction.Rows[i]["AddPlan"]; } if (PNAction.Rows[i]["ModifyPN", DataRowVersion.Original].ToString() != PNAction.Rows[i]["ModifyPN", DataRowVersion.Current].ToString()) { drs[0]["ModifyPN"] = PNAction.Rows[i]["ModifyPN"]; } } else { drs[0].Delete(); } } else { if (PNAction.Rows[i]["AddPlan"].ToString() == "true" | PNAction.Rows[i]["ModifyPN"].ToString() == "true") { DataRow dr = dtPN.NewRow(); dr["ID"] = PNAction.Rows[i]["ActionID"]; dr["UserID"] = userID; dr["PNID"] = PNAction.Rows[i]["ID"]; dr["AddPlan"] = PNAction.Rows[i]["AddPlan"]; dr["ModifyPN"] = PNAction.Rows[i]["ModifyPN"]; dtPN.Rows.Add(dr); } } } int result; if (dtPN.Rows.Count > 0) { result = pDataIO.UpdateWithProc("UserPNAction", dtPN, updataStr, logTracingString); if (result > 0) { dtPN.AcceptChanges(); } else { pDataIO.AlertMsgShow("Update data fail!"); } } for (int i = 0; i < PNActionList.Length; i++) { PNActionList[i].RadioEnable(false); } #endregion #region Save PlanAction for (int i = 0; i < GridView1.Rows.Count; i++) { CheckBox cbEdit = (CheckBox)GridView1.Rows[i].FindControl("CheckBoxEdit"); CheckBox cbDelete = (CheckBox)GridView1.Rows[i].FindControl("CheckBoxDelete"); CheckBox cbRun = (CheckBox)GridView1.Rows[i].FindControl("CheckBoxRun"); if (cbEdit.Checked == true) { PlanAction.Rows[i]["Edit"] = "true"; } else { PlanAction.Rows[i]["Edit"] = "false"; } if (cbDelete.Checked == true) { PlanAction.Rows[i]["Delete"] = "true"; } else { PlanAction.Rows[i]["Delete"] = "false"; } if (cbRun.Checked == true) { PlanAction.Rows[i]["Run"] = "true"; } else { PlanAction.Rows[i]["Run"] = "false"; } } if (GridView1.Rows.Count > 0) { updataStr = "select * from UserPlanAction where UserID=" + userID; dtPlan = pDataIO.GetDataTable(updataStr, "UserPlanAction"); for (int i = 0; i < PlanAction.Rows.Count; i++) { DataRow[] drs = dtPlan.Select("PlanID=" + PlanAction.Rows[i]["PlanID"]); if (drs.Length == 1) { if (PlanAction.Rows[i]["Edit"].ToString() == "true" | PlanAction.Rows[i]["Delete"].ToString() == "true" | PlanAction.Rows[i]["Run"].ToString() == "true") { if (PlanAction.Rows[i]["Edit", DataRowVersion.Original].ToString() != PlanAction.Rows[i]["Edit", DataRowVersion.Current].ToString()) { drs[0]["ModifyPlan"] = PlanAction.Rows[i]["Edit"]; } if (PlanAction.Rows[i]["Delete", DataRowVersion.Original].ToString() != PlanAction.Rows[i]["Delete", DataRowVersion.Current].ToString()) { drs[0]["DeletePlan"] = PlanAction.Rows[i]["Delete"]; } if (PlanAction.Rows[i]["Run", DataRowVersion.Original].ToString() != PlanAction.Rows[i]["Run", DataRowVersion.Current].ToString()) { drs[0]["RunPlan"] = PlanAction.Rows[i]["Run"]; } } else { drs[0].Delete(); } } else { if (PlanAction.Rows[i]["Edit"].ToString() == "true" | PlanAction.Rows[i]["Delete"].ToString() == "true" | PlanAction.Rows[i]["Run"].ToString() == "true") { DataRow dr = dtPlan.NewRow(); dr["ID"] = PlanAction.Rows[i]["ActionID"]; dr["UserID"] = userID; dr["PlanID"] = PlanAction.Rows[i]["PlanID"]; dr["ModifyPlan"] = PlanAction.Rows[i]["Edit"]; dr["DeletePlan"] = PlanAction.Rows[i]["Delete"]; dr["RunPlan"] = PlanAction.Rows[i]["Run"]; dtPlan.Rows.Add(dr); } } } if (dtPlan.Rows.Count > 0) { result = pDataIO.UpdateWithProc("UserPlanAction", dtPlan, updataStr, logTracingString); if (result > 0) { dtPlan.AcceptChanges(); } else { pDataIO.AlertMsgShow("Update data fail!"); } } for (int i = 0; i < GridView1.Rows.Count; i++) { GridView1.Rows[i].Cells[3].Enabled = false; GridView1.Rows[i].Cells[4].Enabled = false; GridView1.Rows[i].Cells[5].Enabled = false; } } #endregion ConfigOptionButtonsVisible(false); Session["SaveButtonVisible"] = false; return(true); } catch (System.Exception ex) { throw ex; } }
public bool SaveData(object obj, string prameter) { string updataStr = "select * from GlobalManufactureChipsetControl where ID=" + moduleTypeID; try { if (AddNew) { DataTable inserTable = pDataIO.GetDataTable(updataStr, "GlobalManufactureChipsetControl"); DataRow dr = inserTable.NewRow(); dr[0] = -1; dr[1] = moduleTypeID; dr[2] = chipsetControl.Colum2TextConfig; dr[3] = chipsetControl.Colum3TextConfig; dr[4] = chipsetControl.Colum4TextConfig; dr[5] = chipsetControl.Colum5TextSelected; dr[6] = chipsetControl.Colum6TextConfig; dr[7] = chipsetControl.Colum7TextConfig; dr[8] = chipsetControl.Colum8TextSelected; inserTable.Rows.Add(dr); int result = pDataIO.UpdateWithProc("GlobalManufactureChipsetControl", inserTable, updataStr, logTracingString); if (result > 0) { inserTable.AcceptChanges(); Response.Redirect("~/WebFiles/Production/ChipSetControlList.aspx?uId=" + moduleTypeID.Trim()); } else { pDataIO.AlertMsgShow("Update data fail!", Request.Url.ToString()); } return(true); } else { if (rowCount != 1) { return(false); } else { for (byte j = 0; j < ChipsetControlSelfInforlist.Length; j++) { mydt.Rows[0]["ItemName"] = ChipsetControlSelfInforlist[j].Colum2TextConfig; mydt.Rows[0]["ModuleLine"] = ChipsetControlSelfInforlist[j].Colum3TextConfig; mydt.Rows[0]["ChipLine"] = ChipsetControlSelfInforlist[j].Colum4TextConfig; mydt.Rows[0]["DriveType"] = ChipsetControlSelfInforlist[j].Colum5TextSelected; mydt.Rows[0]["RegisterAddress"] = ChipsetControlSelfInforlist[j].Colum6TextConfig; mydt.Rows[0]["Length"] = ChipsetControlSelfInforlist[j].Colum7TextConfig; mydt.Rows[0]["Endianness"] = ChipsetControlSelfInforlist[j].Colum8TextSelected; } int result = pDataIO.UpdateWithProc("GlobalManufactureChipsetControl", mydt, updataStr, logTracingString); if (result > 0) { mydt.AcceptChanges(); } else { pDataIO.AlertMsgShow("Update data fail!"); } for (byte i = 0; i < ChipsetControlSelfInforlist.Length; i++) { ChipsetControlSelfInforlist[i].EnableColum2Text = false; ChipsetControlSelfInforlist[i].EnableColum3Text = false; ChipsetControlSelfInforlist[i].EnableColum4Text = false; ChipsetControlSelfInforlist[i].EnableColum5Text = false; ChipsetControlSelfInforlist[i].EnableColum6Text = false; ChipsetControlSelfInforlist[i].EnableColum7Text = false; ChipsetControlSelfInforlist[i].EnableColum8Text = false; } return(true); } } } catch (System.Exception ex) { throw ex; } }
public bool DeleteData(object obj, string prameter) { int row = 0; try { for (int i = 0; i < ControlList.Length; i++) { if (ControlList[i] != null && ControlList[i].chkIDMCoefChecked == true) { for (int j = 0; j < mydt.Rows.Count; j++) { if (mydt.Rows[j].RowState != DataRowState.Deleted) { if (mydt.Rows[j]["id"].ToString() == ControlList[i].ID) { mydt.Rows[j]["IgnoreFlag"] = true; row++; break; } } } } } if (row == 0) { ClientScript.RegisterStartupScript(GetType(), "Message", "<script>alert('请至少选择一个!');</script>", false); return(false); } //150527 ---------------------更新方式变更>>Start int result = -1; if (Session["DB"].ToString().ToUpper() == "ATSDB") { result = pDataIO.UpdateWithProc("GlobalManufactureCoefficientsGroup", mydt, queryStr, logTracingString, "ATS_V2"); } else if (Session["DB"].ToString().ToUpper() == "ATSDEBUGDB") { result = pDataIO.UpdateWithProc("GlobalManufactureCoefficientsGroup", mydt, queryStr, logTracingString, "ATS_VXDEBUG"); } if (result > 0) { mydt.AcceptChanges(); } else { pDataIO.AlertMsgShow("数据更新失败!"); } //150527 ---------------------更新方式变更<<End //pDataIO.UpdateDataTable(queryStr, mydt); Response.Redirect(Request.Url.ToString(), true); return(true); } catch (System.Exception ex) { pDataIO.WriteErrorLogs(ex.ToString()); throw ex; } }
public bool DeleteData(object obj, string prameter) { //Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "<script>if(confirm('Are you sure you want to delete?')){DeleteData1();}else{}</script>"); bool isSelected = false; bool deleteAction = false; string noAuthorityIDStr = ""; string deletStr = "select * from TopoTestPlan where IgnoreFlag='False'and PID=" + moduleTypeID; try { for (int i = 0; i < testTestplanList.Length; i++) { ASCXTestPlanList cb = (ASCXTestPlanList)TestPlanList.FindControl(testTestplanList[i].ID); if (cb != null) { if (cb.BeSelected == true) { //mydt.Rows[i].Delete(); if (deleteFunctionAuthority) { mydt.Rows[i]["IgnoreFlag"] = true; isSelected = true; deleteAction = true; } else { if (GetTestPlanDeleteAuthority(testTestplanList[i].ID)) { mydt.Rows[i]["IgnoreFlag"] = true; isSelected = true; deleteAction = true; } else { isSelected = true; noAuthorityIDStr += testTestplanList[i].TestplanSelfText + ";"; } } } } else { Response.Write("<script>alert('can not find user control!');</script>"); return(false); } } if (isSelected == false) { //Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "<script>alert('请至少选择一个!');return false;</script>"); this.Page.RegisterStartupScript("", "<script>alert('请至少选择一个!');</script>"); //Response.Write("<script>alert('请至少选择一个!');</script>"); return(false); } if (deleteAction) { int result = -1; if (Session["DB"].ToString().ToUpper() == "ATSDB") { result = pDataIO.UpdateWithProc("TopoTestPlan", mydt, deletStr, logTracingString, "ATS_V2"); } else if (Session["DB"].ToString().ToUpper() == "ATSDEBUGDB") { result = pDataIO.UpdateWithProc("TopoTestPlan", mydt, deletStr, logTracingString, "ATS_VXDEBUG"); } if (result > 0) { mydt.AcceptChanges(); } else { pDataIO.AlertMsgShow("数据更新失败!"); } } if (noAuthorityIDStr != "") { noAuthorityIDStr += "你没有操作权限!"; noAuthorityIDStr = noAuthorityIDStr.Replace("'", @"""").Replace("\r", "").Replace("\n", "\\n").Replace("\t", "\\t"); string tempurl = Request.Url.ToString(); string myscript = @"alert('" + noAuthorityIDStr + "');window.location.href='" + tempurl + "';"; Page.ClientScript.RegisterStartupScript(this.GetType(), "myscript", myscript, true); } else { DataTable dt = pDataIO.GetDataTable("select PID from GlobalProductionName where ID=" + moduleTypeID, "GlobalProductionName"); int typeID = Convert.ToInt32(dt.Rows[0]["PID"]); dt = pDataIO.GetDataTable("select newtable.num from (select ROW_NUMBER() OVER (ORDER BY GlobalProductionType.ID ASC) AS num,GlobalProductionType.ID from GlobalProductionType where GlobalProductionType.IgnoreFlag='false') as newtable where newtable.ID=" + typeID, "GlobalProductionTypeNum"); Session["TreeNodeExpand"] = Convert.ToInt32(dt.Rows[0]["num"]) - 1; dt = pDataIO.GetDataTable("select newtable.num,newtable.ID from (select ROW_NUMBER() OVER (ORDER BY GlobalProductionName.ID ASC) AS num,GlobalProductionName.* from GlobalProductionName where IgnoreFlag='false' and PID =" + typeID + ") as newtable where newtable.ID =" + moduleTypeID, "GlobalProductionNameNum"); Session["TreeNodeExpand"] = Session["TreeNodeExpand"].ToString() + "+" + (Convert.ToInt32(dt.Rows[0]["num"]) - 1).ToString(); Session["TreeNodeExpand"] = Session["TreeNodeExpand"].ToString() + "+1"; Session["iframe_src"] = "WebFiles/Production_ATS/TestPlan/TestPlanList.aspx?uId=" + moduleTypeID; ScriptManager.RegisterStartupScript(this, typeof(Page), "", "window.parent.RefreshTreeNode();", true); //Response.Redirect(Request.Url.ToString()); } return(true); } catch (System.Exception ex) { pDataIO.WriteErrorLogs(ex.ToString()); throw ex; } }
public bool DeleteData(object obj, string prameter) { //Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "<script>if(confirm('Are you sure you want to delete?')){DeleteData1();}else{}</script>"); bool isSelected = false; bool deleteAction = false; string noAuthorityIDStr = ""; string deletStr = "select * from TopoTestPlan where IgnoreFlag='False'and PID=" + moduleTypeID; try { for (int i = 0; i < testTestplanList.Length; i++) { ASCXTestPlanList cb = (ASCXTestPlanList)TestPlanList.FindControl(testTestplanList[i].ID); if (cb != null) { if (cb.BeSelected == true) { //mydt.Rows[i].Delete(); if (deleteFunctionAuthority) { mydt.Rows[i]["IgnoreFlag"] = true; isSelected = true; deleteAction = true; } else { if (GetTestPlanDeleteAuthority(testTestplanList[i].ID)) { mydt.Rows[i]["IgnoreFlag"] = true; isSelected = true; deleteAction = true; } else { isSelected = true; noAuthorityIDStr += testTestplanList[i].TestplanSelfText + ";"; } } } } else { Response.Write("<script>alert('can not find user control!');</script>"); return(false); } } if (isSelected == false) { //Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "<script>alert('Did not choose any one!');return false;</script>"); this.Page.RegisterStartupScript("", "<script>alert('Did not choose any one!');</script>"); //Response.Write("<script>alert('Did not choose any one!');</script>"); return(false); } if (deleteAction) { int result = pDataIO.UpdateWithProc("TopoTestPlan", mydt, deletStr, logTracingString); if (result > 0) { mydt.AcceptChanges(); } else { pDataIO.AlertMsgShow("Update data fail!"); } } if (noAuthorityIDStr != "") { noAuthorityIDStr += "you have no authority!"; noAuthorityIDStr = noAuthorityIDStr.Replace("'", @"""").Replace("\r", "").Replace("\n", "\\n").Replace("\t", "\\t"); string tempurl = Request.Url.ToString(); string myscript = @"alert('" + noAuthorityIDStr + "');window.location.href='" + tempurl + "';"; Page.ClientScript.RegisterStartupScript(this.GetType(), "myscript", myscript, true); } else { Response.Redirect(Request.Url.ToString()); } return(true); } catch (System.Exception ex) { pDataIO.WriteErrorLogs(ex.ToString()); throw ex; } }
public bool SaveData(object obj, string prameter) { try { if (mydt.Rows.Count == 1) { #region //已经获取到当前设备的信息 mydt.Rows[0]["ItemName"] = ControlList[0].TxtItemName; mydt.Rows[0]["Description"] = ControlList[0].TxtItemDescription; //150527 ---------------------更新方式变更>>Start int result = -1; if (Session["DB"].ToString().ToUpper() == "ATSDB") { result = pDataIO.UpdateWithProc("ReportHeader", mydt, queryStr, logTracingString, "ATS_V2"); } else if (Session["DB"].ToString().ToUpper() == "ATSDEBUGDB") { result = pDataIO.UpdateWithProc("ReportHeader", mydt, queryStr, logTracingString, "ATS_VXDEBUG"); } if (result > 0) { mydt.AcceptChanges(); Response.Redirect("~/WebFiles/MaintainInfo/ReportHeader/ReportHeaderList.aspx?", true); } else { pDataIO.AlertMsgShow("数据更新失败!", Request.Url.ToString()); } //150527 ---------------------更新方式变更<<End #endregion } else if (AddNew && mydt.Rows.Count == 0) { #region //New long currEqID = pDataIO.GetLastInsertData("ReportHeader") + 1; DataRow eqNewDr = mydt.NewRow(); eqNewDr["ID"] = currEqID; eqNewDr["ItemName"] = ControlList[0].TxtItemName; eqNewDr["Description"] = ControlList[0].TxtItemDescription; mydt.Rows.Add(eqNewDr); //150527 ---------------------更新方式变更>>Start int result = -1; if (Session["DB"].ToString().ToUpper() == "ATSDB") { result = pDataIO.UpdateWithProc("ReportHeader", mydt, queryStr, logTracingString, "ATS_V2"); } else if (Session["DB"].ToString().ToUpper() == "ATSDEBUGDB") { result = pDataIO.UpdateWithProc("ReportHeader", mydt, queryStr, logTracingString, "ATS_VXDEBUG"); } if (result > 0) { mydt.AcceptChanges(); Response.Redirect("~/WebFiles/MaintainInfo/ReportHeader/ReportHeaderList.aspx?", true); } else { pDataIO.AlertMsgShow("数据更新失败!", Request.Url.ToString()); } //150527 ---------------------更新方式变更<<End #endregion } else { ClientScript.RegisterStartupScript(GetType(), "Message", "<Script>alert('Error!当前项已被删除!')</Script>", false); } return(true); } catch (System.Exception ex) { pDataIO.WriteErrorLogs(ex.ToString()); throw ex; } }
public bool SaveData(object obj, string prameter) { //string updataStr = "select * from GlobalProductionType where ID=" + moduleTypeID; string updataStr = "select * from GlobalProductionType"; try { if (AddNew) { DataTable inserTable = pDataIO.GetDataTable(updataStr, "GlobalProductionType"); DataRow dr = inserTable.NewRow(); dr[0] = -1; dr[1] = MConfigInit.Colum2TextConfig; dr[2] = MsaIDMap[MConfigInit.ConfigSeletedIndex]; dr[3] = false; inserTable.Rows.Add(dr); int result = pDataIO.UpdateWithProc("GlobalProductionType", inserTable, updataStr, logTracingString); if (result > 0) { inserTable.AcceptChanges(); if (funcItemName == "ProductionTypeInfor") { Response.Redirect("~/WebFiles/Production/ProductionModuleTypeList.aspx?BlockType=" + Session["BlockType"]); } } else { pDataIO.AlertMsgShow("Update data fail!", Request.Url.ToString()); } return(true); } else { if (rowCount != 1) { return(false); } else { for (byte j = 0; j < MConfigInitSelfInfor.Length; j++) { mydt.Rows[0]["ItemName"] = MConfigInitSelfInfor[j].Colum2TextConfig; mydt.Rows[0]["MSAID"] = MsaIDMap[MConfigInitSelfInfor[j].ConfigSeletedIndex]; } } int result = pDataIO.UpdateWithProc("GlobalProductionType", mydt, updataStr, logTracingString); if (result > 0) { mydt.AcceptChanges(); } else { pDataIO.AlertMsgShow("Update data fail!"); } for (byte i = 0; i < MConfigInitSelfInfor.Length; i++) { MConfigInitSelfInfor[i].EnableColum2Text = false; MConfigInitSelfInfor[i].EnableColum3Text = false; } return(true); } } catch (System.Exception ex) { pDataIO.WriteErrorLogs(ex.ToString()); throw ex; } }
public bool SaveData(object obj, string prameter) { try { if (mydt.Rows.Count == 1) { #region //已经获取到当前信息 mydt.Rows[0]["PID"] = ControlList[0].DdlAppName.SelectedValue; mydt.Rows[0]["ItemName"] = ControlList[0].TxtItemName; mydt.Rows[0]["ShowName"] = ControlList[0].TxtShowName; mydt.Rows[0]["ItemDescription"] = ControlList[0].TxtItemDescription; //150527 ---------------------更新方式变更>>Start int result = pDataIO.UpdateWithProc("GlobalAllTestModelList", mydt, queryStr, logTracingString); if (result > 0) { mydt.AcceptChanges(); Response.Redirect("~/WebFiles/APPModel/GlobalModelList.aspx?BlockType=" + Session["BlockType"], true); } else { pDataIO.AlertMsgShow("Update data fail!", Request.Url.ToString()); } //150527 ---------------------更新方式变更<<End #endregion } else if (AddNew && mydt.Rows.Count == 0) { #region //New long currEqID = pDataIO.GetLastInsertData("GlobalAllTestModelList") + 1; DataRow eqNewDr = mydt.NewRow(); eqNewDr["ID"] = currEqID; eqNewDr["PID"] = ControlList[0].DdlAppName.SelectedValue; eqNewDr["ItemName"] = ControlList[0].TxtItemName; eqNewDr["ShowName"] = ControlList[0].TxtShowName; eqNewDr["ItemDescription"] = ControlList[0].TxtItemDescription; mydt.Rows.Add(eqNewDr); //150527 ---------------------更新方式变更>>Start int result = pDataIO.UpdateWithProc("GlobalAllTestModelList", mydt, queryStr, logTracingString); if (result > 0) { mydt.AcceptChanges(); ModelID = result.ToString(); Response.Redirect("~/WebFiles/APPModel/CurrModelParamInfo.aspx?AddNew=true&ModelID=" + ModelID, true); } else { pDataIO.AlertMsgShow("Update data fail!", Request.Url.ToString()); } //150527 ---------------------更新方式变更<<End #endregion } else { ClientScript.RegisterStartupScript(GetType(), "Message", "<Script>alert('Error!Can not find any Result,Current item has been deleted!~')</Script>"); } return(true); } catch (System.Exception ex) { pDataIO.WriteErrorLogs(ex.ToString()); throw ex; } }
public bool DeleteData(object obj, string prameter) { //Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "<script>if(confirm('Are you sure you want to delete?')){DeleteData1();}else{}</script>"); int row = 0; bool isSelected = false; string deletStr = "select * from GlobalMSA where IgnoreFlag='false'"; try { for (int i = 0; i < testModuleTypeSelfInfor.Length; i++) { ASCXMSAModuleTypeList cb = (ASCXMSAModuleTypeList)msamodutype.FindControl(testModuleTypeSelfInfor[i].ID); if (cb != null) { if (cb.BeSelected == true) { row++; isSelected = true; mydt.Rows[i]["IgnoreFlag"] = true; } } else { Response.Write("<script>alert('can not find user control!');</script>"); return(false); } } if (isSelected == false) { //Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "<script>alert('请至少选择一个!');return false;</script>"); this.Page.RegisterStartupScript("", "<script>alert('请至少选择一个!');</script>"); //Response.Write("<script>alert('请至少选择一个!');</script>"); return(false); } int result = -1; if (Session["DB"].ToString().ToUpper() == "ATSDB") { result = pDataIO.UpdateWithProc("GlobalMSA", mydt, deletStr, logTracingString, "ATS_V2"); } else if (Session["DB"].ToString().ToUpper() == "ATSDEBUGDB") { result = pDataIO.UpdateWithProc("GlobalMSA", mydt, deletStr, logTracingString, "ATS_VXDEBUG"); } if (result > 0) { mydt.AcceptChanges(); } else { pDataIO.AlertMsgShow("数据更新失败!"); } Response.Redirect(Request.Url.ToString()); return(true); } catch (System.Exception ex) { pDataIO.WriteErrorLogs(ex.ToString()); throw ex; } }