public void delecte(string id, string codeid, string sqr, string sqdw) { try { int i = deviceManager.DeleteOperation(id); if (i > 0) { GridDataBind(GetWhere()); DataTable da = deviceManager.GetOperation(" 1=1 AND device_id='" + codeid + "' "); SroPenation.DataSource = da; SroPenation.DataBind(); logManager.InsertLogRunning(uName, GetLangStr("", "删除:设备[") + sbName + "]" + GetLangStr("", ";申请人[") + sqr + GetLangStr("", "];申请单位[") + sqdw + "]", nowIp, "3"); Notice(GetLangStr("DeviceOperation70", "信息提示"), GetLangStr("DeviceOperation73", "删除成功")); DataTable dt = deviceManager.GetOperation(" 1=1 AND device_id='shebei" + tyeid + "' "); SroPenation.DataSource = dt; } else { Notice(GetLangStr("DeviceOperation70", "信息提示"), GetLangStr("DeviceOperation45", "删除失败")); } } catch (Exception ex) { ILog.WriteErrorLog(ex); logManager.InsertLogError("DeviceOperation.aspx-delecte", ex.Message + ";" + ex.StackTrace, "delecte has an exception"); } }
/// <summary> /// 选中行事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// <returns></returns> protected void SelectLed(object sender, DirectEventArgs e) { try { PagingToolbar2.PageSize = 5; //页容量为5 PagingToolbar2.PageIndex = 1; //显示第一页数据 data = e.ExtraParams["id"]; sbName = e.ExtraParams["sbName"]; string id = data.ToString(); DataTable da = deviceManager.GetOperation(" 1=1 AND device_id='shebei" + id + "' "); SroPenation.DataSource = da; SroPenation.DataBind(); tyeid = id; if (Session["yunweitable"] != null) { Session["yunweitable"] = null; } Session["yunweitable"] = da; int pageIndex = PagingToolbar1.PageIndex; GridDataBind(GetWhere(), pageIndex); } catch (Exception ex) { ILog.WriteErrorLog(ex); logManager.InsertLogError("DeviceOperation.aspx-SelectLed", ex.Message + ";" + ex.StackTrace, "SelectLed has an exception"); } }
public void updatedeviceqw() { try { string id = yuweiId; string decice_id = this.hidder1.Value.ToString(); string kssj = DateTime.Parse(lrsj).ToString("yyyy-MM-dd HH:mm:ss"); string jssj = DateTime.Parse(shsj).ToString("yyyy-MM-dd HH:mm:ss"); Hashtable hs = new Hashtable(); hs.Add("id", id); hs.Add("openration_people", this.txt_upde_lrpeople.Text.ToString()); hs.Add("openration_time", kssj); hs.Add("openration_event", this.txt_upde_lrshuoming.Text.ToString()); hs.Add("openration_type", this.com_upte_lrtype.Value); hs.Add("openration_unit", this.com_upte_lrdanwei.Value); hs.Add("openration_auditor", this.txt_upde_shpeople.Text.ToString()); hs.Add("openration_opinion", this.txt_upde_shyijian.Text.ToString()); hs.Add("openration_revtime", jssj); if (deviceManager.uptateOperation(hs) > 0) { StoreDeviceManager.DataSource = (DataTable)Session["datatable"]; StoreDeviceManager.DataBind(); DataTable da = deviceManager.GetOperation(" 1=1 AND device_id='" + decice_id + "' "); SroPenation.DataSource = da; SroPenation.DataBind(); Window3.Hide(); string ywfss = com_upte_lrtype.SelectedItem.Text; string sqdws = com_upte_lrdanwei.SelectedItem.Text; string sqrs = txt_upde_lrpeople.Text; string lrsjs = start1time; string lrsms = txt_upde_lrshuoming.Text; string shrs = txt_upde_shpeople.Text; string shsjs = end1time; string shyjs = txt_upde_shyijian.Text; string lbname = ""; lbname += Bll.Common.AssembleRunLog(ywfs, ywfss, GetLangStr("DeviceOperation58", "运维方式"), "1"); lbname += Bll.Common.AssembleRunLog(sqdw, sqdws, GetLangStr("DeviceOperation28", "申请单位"), "1"); lbname += Bll.Common.AssembleRunLog(sqr, sqrs, GetLangStr("DeviceOperation27", "申请人"), "1"); lbname += Bll.Common.AssembleRunLog(lrsj, lrsjs, GetLangStr("DeviceOperation29", "录入时间"), "1"); lbname += Bll.Common.AssembleRunLog(lrsm, lrsms, GetLangStr("DeviceOperation39", "录入说明"), "1"); lbname += Bll.Common.AssembleRunLog(shr, shrs, GetLangStr("DeviceOperation40", "审核人"), "1"); lbname += Bll.Common.AssembleRunLog(shsj, shsjs, GetLangStr("DeviceOperation41", "审核时间"), "1"); lbname += Bll.Common.AssembleRunLog(shyj, shyjs, GetLangStr("DeviceOperation42", "审核意见"), "1"); DataRow[] dr = dtname.Select("col0='" + sbid + "'"); string sbne = dr[0]["col2"].ToString(); logManager.InsertLogRunning(uName, GetLangStr("DeviceOperation67", "修改;[") + sbne + "]" + lbname, nowIp, "2"); Notice(GetLangStr("DeviceOperation70", "信息提示"), GetLangStr("DeviceOperation75", "修改成功")); } qingkongupdate(); } catch (Exception ex) { ILog.WriteErrorLog(ex); logManager.InsertLogError("DeviceOperation.aspx-updatedeviceqw", ex.Message + ";" + ex.StackTrace, "updatedeviceqw has an exception"); } }
public void update(string code) { try { //页面没数据 StoreDeviceManager.DataSource = (DataTable)Session["datatable"]; StoreDeviceManager.DataBind(); SroPenation.DataSource = (DataTable)Session["yunweitable"]; SroPenation.DataBind(); DataTable da = deviceManager.GetSelectOperation(" id='" + code + "'"); this.com_upte_lrtype.Value = da.Rows[0]["col5"].ToString(); this.com_upte_lrdanwei.Value = da.Rows[0]["col6"].ToString(); this.txt_upde_lrpeople.Text = da.Rows[0]["col2"].ToString(); start1time = da.Rows[0]["col3"].ToString(); end1time = da.Rows[0]["col9"].ToString(); string js = "setTime('" + start1time + "','" + end1time + "');"; this.ResourceManager1.RegisterAfterClientInitScript(js); //string[] lurutiem = (da.Rows[0]["col3"].ToString()).Split(' '); //this.date_upde_lrdate.Text = lurutiem[0].ToString(); //this.time_upde_lrtime.Text = lurutiem[1].ToString(); this.txt_upde_lrshuoming.Text = da.Rows[0]["col4"].ToString(); this.txt_upde_shpeople.Text = da.Rows[0]["col7"].ToString(); // string[] shtiem = (da.Rows[0]["col9"].ToString()).Split(' '); //this.date_upde_shdate.Text = shtiem[0].ToString(); //this.time_upde_shtime.Text = shtiem[1].ToString(); this.txt_upde_shyijian.Text = da.Rows[0]["col8"].ToString(); this.hidder1.Value = da.Rows[0]["col1"].ToString(); yuweiId = code; DataRow[] dt = dtyw.Select("col0='" + da.Rows[0]["col5"].ToString() + "'"); ywfs = dt[0]["col1"].ToString(); DataRow[] dt1 = dtyw.Select("col0='" + da.Rows[0]["col6"].ToString() + "'"); sqdw = dt1[0]["col1"].ToString(); sqr = txt_upde_lrpeople.Text; lrsj = start1time; lrsm = txt_upde_lrshuoming.Text; shr = txt_upde_shpeople.Text; shsj = end1time; shyj = txt_upde_shyijian.Text; Window3.Show(); } catch (Exception ex) { ILog.WriteErrorLog(ex); logManager.InsertLogError("DeviceOperation.aspx-update", ex.Message + ";" + ex.StackTrace, "update has an exception"); } }
public void Add_luru(string code) { int pageIndex = PagingToolbar1.PageIndex; GridDataBind(GetWhere(), pageIndex); this.butAdd1.Text = GetLangStr("DeviceOperation72", "添加"); this.hidder.Text = code; //页面没数据 //StoreDataBind(); if (Session["yunweitable"] != null) { SroPenation.DataSource = (DataTable)Session["yunweitable"]; SroPenation.DataBind(); } Window1.Show(); }
public void SelectNode(string code) { try { GridDataBind(" 1=1 and device_type_id='" + code + "'"); DataTable da = deviceManager.GetOperation(" 1=2"); SroPenation.DataSource = da; SroPenation.DataBind(); this.CmbDeviceType.Value = code; } catch (Exception ex) { ILog.WriteErrorLog(ex); logManager.InsertLogError("DeviceOperation.aspx-SelectNode", ex.Message + ";" + ex.StackTrace, "SelectNode has an exception"); } }
public void updatedevice(string code) { try { string id = code; string decice_id = this.hidder1.Value.ToString(); string kssj = DateTime.Parse(starttime).ToString("yyyy-MM-dd HH:mm:ss"); string jssj = DateTime.Parse(endtime).ToString("yyyy-MM-dd HH:mm:ss"); //string lurutime = date_upde_lrdate.SelectedDate.ToString("yyyy-MM-dd") + " " + this.time_upde_lrtime.Text.ToString(); //string shtime = date_upde_shdate.SelectedDate.ToString("yyyy-MM-dd") + " " + this.time_upde_shtime.Text.ToString(); Hashtable hs = new Hashtable(); hs.Add("id", id); hs.Add("openration_people", this.txt_upde_lrpeople.Text.ToString()); hs.Add("openration_time", kssj); hs.Add("openration_event", this.txt_upde_lrshuoming.Text.ToString()); hs.Add("openration_type", this.com_upte_lrtype.Value); hs.Add("openration_unit", this.com_upte_lrdanwei.Value); hs.Add("openration_auditor", this.txt_upde_shpeople.Text.ToString()); hs.Add("openration_opinion", this.txt_upde_shyijian.Text.ToString()); hs.Add("openration_revtime", jssj); if (deviceManager.uptateOperation(hs) > 0) { DataTable da = deviceManager.GetOperation(" 1=1 AND device_id='" + decice_id + "' "); SroPenation.DataSource = da; SroPenation.DataBind(); Window3.Hide(); Notice(GetLangStr("DeviceOperation70", "信息提示"), GetLangStr("DeviceOperation75", "修改成功")); DataTable dt = deviceManager.GetOperation(" 1=1 AND device_id='shebei" + tyeid + "' "); SroPenation.DataSource = dt; } qingkongupdate(); } catch (Exception ex) { ILog.WriteErrorLog(ex); logManager.InsertLogError("DeviceOperation.aspx-updatedevice", ex.Message + ";" + ex.StackTrace, "updatedevice has an exception"); } }
/// <summary> /// 添加运维信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// <returns></returns> protected void ButAdd_Click(object sender, DirectEventArgs e) { try { string ID = Math.Abs(Guid.NewGuid().ToString().GetHashCode()).ToString(); string device_id = "SHEBEI" + hidder.Text; string kssj = DateTime.Parse(starttime).ToString("yyyy-MM-dd HH:mm:ss"); string jssj = DateTime.Parse(endtime).ToString("yyyy-MM-dd HH:mm:ss"); //string lurutime = date_lurutiem.SelectedDate.ToString("yyyy-MM-dd") + " " + this.time_luru.Text.ToString(); //string lurutime = Convert.ToDateTime(date_lurutiem.Text).ToString("yyyy-MM-dd") + " " + this.time_luru.Text.ToString(); //string shtime = Convert.ToDateTime(date_shtime.Text).ToString("yyyy-MM-dd") + " " + this.time_sh.Text.ToString(); Hashtable hs = new Hashtable(); hs.Add("id", ID); hs.Add("device_id", device_id); hs.Add("openration_people", this.txt_lurupeople.Text.ToString()); hs.Add("openration_time", kssj); hs.Add("openration_event", this.txt_shuoming.Text.ToString()); hs.Add("openration_type", this.com_operationtype.Value); hs.Add("openration_unit", this.com_operationdanwei.Value); hs.Add("openration_auditor", this.txt_shpeople.Text.ToString()); hs.Add("openration_opinion", this.txt_shyijian.Text.ToString()); hs.Add("openration_revtime", jssj); if (deviceManager.insertOperation(hs) > 0) { int pageIndex = PagingToolbar1.PageIndex; GridDataBind(GetWhere(), pageIndex); DataTable da = deviceManager.GetOperation(" 1=1 AND device_id='" + device_id + "' "); SroPenation.DataSource = da; SroPenation.DataBind(); Window1.Hide(); string lblname = ""; lblname += Bll.Common.AssembleRunLog("", com_operationtype.SelectedItem.Text, GetLangStr("DeviceOperation34", "维护方式"), "0"); lblname += Bll.Common.AssembleRunLog("", com_operationdanwei.SelectedItem.Text, GetLangStr("DeviceOperation28", "申请单位"), "0"); lblname += Bll.Common.AssembleRunLog("", txt_lurupeople.Text, GetLangStr("DeviceOperation27", "申请人"), "0"); lblname += Bll.Common.AssembleRunLog("", kssj, GetLangStr("DeviceOperation29", "录入时间"), "0"); lblname += Bll.Common.AssembleRunLog("", txt_shuoming.Text, GetLangStr("DeviceOperation39", "录入说明"), "0"); lblname += Bll.Common.AssembleRunLog("", txt_shpeople.Text, GetLangStr("DeviceOperation40", "审核人"), "0"); lblname += Bll.Common.AssembleRunLog("", jssj, GetLangStr("DeviceOperation41", "审核时间"), "0"); lblname += Bll.Common.AssembleRunLog("", txt_shyijian.Text, GetLangStr("DeviceOperation42", "审核意见"), "0"); logManager.InsertLogRunning(uName, GetLangStr("DeviceOperation21", "新增:") + lblname, nowIp, "1"); Notice(GetLangStr("DeviceOperation70", "信息提示"), GetLangStr("DeviceOperation71", "添加成功")); //BuildTree(TreePanel1.Root); //TreePanel1.Render(); //重新加载行事件 DataTable dt = deviceManager.GetOperation(" 1=1 AND device_id='shebei" + tyeid + "' "); SroPenation.DataSource = dt; } qingkongadd(); } catch (Exception ex) { ILog.WriteErrorLog(ex); logManager.InsertLogError("DeviceOperation.aspx-ButAdd_Click", ex.Message + ";" + ex.StackTrace, "ButAdd_Click has an exception"); } }