/// <summary> /// 执行Insert操作 /// </summary> /// <param name="mySql"></param> /// <returns></returns> public int Insert(string mySql) { try { return(dataAccess.Execute_NonQuery(mySql)); } catch (Exception ex) { ILog.WriteErrorLog(ex.Message); return(0); } }
/// <summary> /// 添加 /// </summary> /// <param name="info"></param> /// <returns></returns> public int AddNoticePic(NoticePicInfo info) { string mySql = string.Empty; try { mySql = "INSERT INTO t_cfg_noticepic(id,picname,picdisc,priurl,lrr,lrsj,NAME,wfxw) VALUES('" + info.Id + "','" + info.PicName + "','" + info.DicDisc + "','" + info.PicUrl + "','" + info.Lrr + "','" + info.Lrsj + "','" + info.Name + "','" + info.Wfxw + "');"; return(dataAccess.Execute_NonQuery(mySql)); } catch (Exception ex) { ILog.WriteErrorLog(mySql + ex.Message); return(0); } }
public int insertEngineroom(System.Collections.Hashtable hs) { string mySql = string.Empty; try { mySql = "insert into T_DEV_ENGINEROOM (ID,ENGINEROOM_ID,ENGINEROOM_NAME,ENGINEROOM_TYPE,ENGINEROOM_DRAND,ENGINEROOM_IP,ENGINEROOM_TIME,DEPARTMENT,USERNAME,PASSWORD,PROCESSOR,"; mySql += "PROCESSORCOUNT,MEMORYSPACE,MEMORYSLOTS,MEMORYTYPE,NETWORKCONTROLLER,HARDDISK,HARDDISK_TYPE,POWERSUPPLY_TYPE,PROCESSORCACHE,INFRASTRUCTURE_MANAGEMENT,DRIVE_TYPE,SHAPE,WARRANTY) values ("; mySql = mySql + "'" + hs["ID"].ToString() + "',"; mySql = mySql + "'" + hs["ENGINEROOM_ID"].ToString() + "',"; mySql = mySql + "'" + hs["ENGINEROOM_NAME"].ToString() + "',"; mySql = mySql + "'" + hs["ENGINEROOM_TYPE"].ToString() + "',"; mySql = mySql + "'" + hs["ENGINEROOM_DRAND"].ToString() + "',"; mySql = mySql + "'" + hs["ENGINEROOM_IP"].ToString() + "',"; mySql = mySql + "to_date('" + hs["ENGINEROOM_TIME"].ToString() + "','yyyy-mm-dd hh24:mi:ss'),"; mySql = mySql + "'" + hs["DEPARTMENT"].ToString() + "',"; mySql = mySql + "'" + hs["USERNAME"].ToString() + "',"; mySql = mySql + "'" + hs["PASSWORD"].ToString() + "',"; mySql = mySql + "'" + hs["PROCESSOR"].ToString() + "',"; mySql = mySql + "'" + hs["PROCESSORCOUNT"].ToString() + "',"; mySql = mySql + "'" + hs["MEMORYSPACE"].ToString() + "',"; mySql = mySql + "'" + hs["MEMORYSLOTS"].ToString() + "',"; mySql = mySql + "'" + hs["MEMORYTYPE"].ToString() + "',"; mySql = mySql + "'" + hs["NETWORKCONTROLLER"].ToString() + "',"; mySql = mySql + "'" + hs["HARDDISK"].ToString() + "',"; mySql = mySql + "'" + hs["HARDDISK_TYPE"].ToString() + "',"; mySql = mySql + "'" + hs["POWERSUPPLY_TYPE"].ToString() + "',"; mySql = mySql + "'" + hs["PROCESSORCACHE"].ToString() + "',"; mySql = mySql + "'" + hs["INFRASTRUCTURE_MANAGEMENT"].ToString() + "',"; mySql = mySql + "'" + hs["DRIVE_TYPE"].ToString() + "',"; mySql = mySql + "'" + hs["SHAPE"].ToString() + "',"; mySql = mySql + "'" + hs["WARRANTY"].ToString() + "'"; mySql = mySql + " )"; return(dataAccess.Execute_NonQuery(mySql)); } catch (Exception ex) { ILog.WriteErrorLog(mySql + ex.Message); return(-1); } }
/// <summary> /// 删除用户信息 /// </summary> /// <param name="hs"></param> /// <returns></returns> public int DeleteSerUserInfo(System.Collections.Hashtable hs) { string mySql = string.Empty; try { mySql = "delete from t_ser_person where usercode='" + hs["usercode"].ToString() + "'"; int res = dataAccess.Execute_NonQuery(mySql); mySql = "delete from t_ser_register where usercode='" + hs["usercode"].ToString() + "'"; return(dataAccess.Execute_NonQuery(mySql)); } catch (Exception ex) { ILog.WriteErrorLog(mySql + ex.Message); return(-1); } }
/// <summary> /// 布控 /// </summary> /// <param name="stationid">卡口列表</param> /// <param name="hphm">号牌号码</param> /// <param name="cllx">车辆类型</param> /// <param name="bdyy">布控原因</param> /// <param name="yxsj">有效时间</param> /// <param name="sjly"></param> /// <param name="bkry">布控人员姓名</param> /// <param name="lxdh">布控联系人电话</param> ///<param name="cpmh">车牌模糊</param> /// <returns></returns> public string SetDispatch(List <string> stationid, string hphm, string cllx, string bdyy, string yxsj, string sjly, string mdlx, string bkry, string lxdh, string cpmh, string bklx) { StringBuilder strSql = new StringBuilder(); try { string xh = GetRecordID(19); string kkid = "", kkidmc = ""; foreach (string str in stationid) { kkid += (kkid == "" ? "" : ",") + str; DataSet ds = GetStation("station_id='" + str + "'"); if (ds != null && ds.Tables[0].Rows.Count > 0) { kkidmc += (kkidmc == "" ? "" : ",") + ds.Tables[0].Rows[0]["station_name"].ToString(); } } strSql.Append("delete FROM t_tgs_info_blacklist WHERE hphm='" + hphm + "' AND hpzl= '" + cllx + "'"); dataAccess.Execute_NonQuery(strSql.ToString()); string gxsj = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); switch (dataAccess.DataBaseType.ToUpper()) { case "MYSQL": gxsj = "'" + gxsj + "'"; yxsj = "'" + yxsj + "'"; break; case "ORACLE": gxsj = "to_date('" + gxsj + "','yyyy-mm-dd hh24:mi:ss')"; yxsj = "to_date('" + yxsj + "','yyyy-mm-dd hh24:mi:ss')"; break; } strSql.Clear(); strSql.Append("INSERT into t_tgs_info_blacklist (xh,hphm,hpzl,sjyy,sjly,BKKK,BKKKMC,yxsj,gxsj, mdlx, bdbj,bkr,bkdh,cpmh,bklx) VALUES('"); strSql.Append(xh + "','" + hphm + "','" + cllx + "','" + bdyy + "','" + sjly + "','" + kkid + "','" + kkidmc + "'," + yxsj + "," + gxsj + ",'" + mdlx + "' ,'1','" + bkry + "','" + lxdh + "','" + cpmh + "','" + bklx + "')"); int rows = dataAccess.Execute_NonQuery(strSql.ToString()); if (rows > 0) { return(xh); } else { return(""); } } catch (Exception ex) { ILog.WriteErrorLog(strSql + ex.Message); return(""); } }
/// <summary> /// 插入业务日志 /// </summary> /// <param name="pname"></param> /// <param name="sevent"></param> /// <param name="ipaddress"></param> /// <returns></returns> public int InsertLogBusiness(string lid, string pname, string ipaddress, string sevent, string systemid) { string mySql = string.Empty; try { mySql = "insert into t_log_business (lcode,pname,entertime,quittime,ipaddress,event,recordtime,systemid) values("; mySql = mySql + "'" + lid.ToString() + "',"; mySql = mySql + "'" + pname + "',"; mySql = mySql + "now(),"; mySql = mySql + "now(),"; mySql = mySql + "'" + sevent + "',"; mySql = mySql + "now(),"; mySql = mySql + "'" + systemid + "')"; return(dataAccess.Execute_NonQuery(mySql)); } catch (Exception ex) { ILog.WriteErrorLog(mySql + ex.Message); return(-1); } }
public int insertFacility_SignageMark(System.Collections.Hashtable hs) { string mySql = string.Empty; try { mySql = "insert into T_DEV_FACILITIES (id,facilities_id,facilities_name,facilities_type,department,facilities_mode,facilities_time,deviceuse,facilities_even,mark_form,"; mySql = mySql + " mark_type,mark_width,mark_hight,mark_fwidth,mark_fhight,intersection_number,intersection_location,mark_color,mark_function,mark_drawing,base_specification,manufacturer) values ("; mySql = mySql + "'" + hs["id"].ToString() + "',"; mySql = mySql + "'" + hs["facilities_id"].ToString() + "',"; mySql = mySql + "'" + hs["facilities_name"].ToString() + "',"; mySql = mySql + "'" + hs["facilities_type"].ToString() + "',"; mySql = mySql + "'" + hs["department"].ToString() + "',"; mySql = mySql + "'" + hs["facilities_mode"].ToString() + "',"; mySql = mySql + "to_date('" + hs["facilities_time"].ToString() + "','yyyy-mm-dd hh24:mi:ss'),"; mySql = mySql + "'" + hs["deviceuse"].ToString() + "',"; mySql = mySql + "'" + hs["facilities_even"].ToString() + "',"; mySql = mySql + "'" + hs["mark_form"].ToString() + "',"; mySql = mySql + "'" + hs["mark_type"].ToString() + "',"; mySql = mySql + "'" + hs["mark_width"].ToString() + "',"; mySql = mySql + "'" + hs["mark_hight"].ToString() + "',"; mySql = mySql + "'" + hs["mark_fwidth"].ToString() + "',"; mySql = mySql + "'" + hs["mark_fhight"].ToString() + "',"; mySql = mySql + "'" + hs["intersection_number"].ToString() + "',"; mySql = mySql + "'" + hs["intersection_location"].ToString() + "',"; mySql = mySql + "'" + hs["mark_color"].ToString() + "',"; mySql = mySql + "'" + hs["mark_function"].ToString() + "',"; mySql = mySql + "'" + hs["mark_drawing"].ToString() + "',"; mySql = mySql + "'" + hs["base_specification"].ToString() + "',"; mySql = mySql + "'" + hs["manufacturer"].ToString() + "'"; mySql = mySql + " )"; return(dataAccess.Execute_NonQuery(mySql)); } catch (Exception ex) { ILog.WriteErrorLog(mySql + ex.Message); return(-1); } }
/// <summary> /// 插入到套牌车库(新表) /// </summary> /// <param name="hs"></param> /// <returns></returns> public int UpdateSuspicionInfoNew(System.Collections.Hashtable hs) { string mySql = string.Empty; try { if (GeHphmExist("t_tgs_suspect", hs["hphm"].ToString(), hs["hpzl"].ToString()) <= 0) { mySql = "insert into t_tgs_suspect (bkbh,hphm,hpzl,csys,clpp,bkjb,bklx,bkr,bksxrq,bkqsrq,bkrdw,bkbj) values("; mySql = mySql + "'" + hs["bkbh"].ToString() + "',"; mySql = mySql + "'" + hs["hphm"].ToString() + "',"; mySql = mySql + "'" + Common.GetHashtableValue(hs, "hpzl", "02") + "',"; mySql = mySql + "'" + Common.GetHashtableValue(hs, "csys", "") + "',"; mySql = mySql + "'" + hs["clpp"].ToString() + "',"; mySql = mySql + "'2',"; mySql = mySql + "'" + hs["bklx"].ToString() + "',"; mySql = mySql + "'" + hs["bkr"].ToString() + "',"; mySql = mySql + "STR_TO_DATE('" + System.DateTime.Now.AddYears(10).ToString("yyyy-MM-dd HH:mm:ss") + "','%Y-%m-%d %H:%i:%s'),"; mySql = mySql + "now() ,'" + hs["bkrdw"].ToString() + "',"; mySql = mySql + " '3')"; return(dataAccess.Execute_NonQuery(mySql)); } else { mySql = "update t_tgs_suspect set "; mySql = mySql + Common.GetHashtableStr(hs, "hpzl", "hpzl"); mySql = mySql + Common.GetHashtableStr(hs, "csys", "csys"); mySql = mySql + Common.GetHashtableStr(hs, "bklx", "bklx"); mySql = mySql + "hphm='" + hs["hphm"].ToString() + "',"; mySql = mySql + "bkr='" + hs["bkr"].ToString() + "',"; mySql = mySql + "clpp='" + hs["clpp"].ToString() + "',"; mySql = mySql + "bkrdw='" + hs["bkrdw"].ToString() + "',"; mySql = mySql + "bksxrq=STR_TO_DATE('" + System.DateTime.Now.AddYears(10).ToString("yyyy-MM-dd HH:mm:ss") + "','%Y-%m-%d %H:%i:%s'),"; mySql = mySql + "bkqsrq=now()"; mySql = mySql + " where hphm='" + hs["hphm"].ToString() + "' and hpzl='" + hs["hpzl"].ToString() + "'"; return(dataAccess.Execute_NonQuery(mySql)); } } catch (Exception ex) { ILog.WriteErrorLog(mySql + ex.Message); return(-1); } }
/// <summary> /// /// </summary> /// <param name="hs"></param> /// <returns></returns> public int AddSysCode(System.Collections.Hashtable hs) { string mySql = string.Empty; try { mySql = "insert into t_sys_code (codetype, code,codedesc,remark,isuse) values("; mySql = mySql + "'" + hs["codetype"].ToString() + "',"; mySql = mySql + "'" + hs["code"].ToString() + "',"; mySql = mySql + "'" + hs["codedesc"].ToString() + "',"; mySql = mySql + "'" + hs["remark"].ToString() + "',"; mySql = mySql + "'" + hs["isuse"].ToString() + "' )"; return(dataAccess.Execute_NonQuery(mySql)); } catch (Exception ex) { ILog.WriteErrorLog(mySql + ex.Message); return(-1); } }
public int DeleteDeviceStation(System.Collections.Hashtable hs) { string mySql = string.Empty; try { mySql = "delete from t_cfg_station_device where station_id='" + hs["station_id"].ToString() + "' and device_id='" + hs["device_id"].ToString() + "'"; return(dataAccess.Execute_NonQuery(mySql)); } catch (Exception ex) { ILog.WriteErrorLog(mySql + ex.Message); return(-1); } }
/// <summary> /// 更新标注点信息 /// </summary> /// <param name="hs"></param> /// <returns></returns> public int UpdatePointInfo(System.Collections.Hashtable hs) { string mySql = string.Empty; try { if (GeXhExist("t_gis_device_mark", "markid", hs["markid"].ToString()) > 0) { mySql = "update t_gis_device_mark set "; mySql = mySql + Common.GetHashtableStr(hs, "markname", "markname"); mySql = mySql + Common.GetHashtableStr(hs, "relationid", "relationid"); mySql = mySql + Common.GetHashtableStr(hs, "marktype", "marktype"); mySql = mySql + "xpoint='" + hs["xpoint"].ToString() + "',"; mySql = mySql + "ypoint='" + hs["ypoint"].ToString() + "'"; mySql = mySql + " where markid='" + hs["markid"].ToString() + "'"; } else { mySql = "insert into t_gis_device_mark (markid,markname,marktype,relationid,xpoint,ypoint) values("; mySql = mySql + "'" + hs["markid"].ToString() + "',"; mySql = mySql + "'" + hs["markname"].ToString() + "',"; mySql = mySql + "'" + hs["marktype"].ToString() + "',"; mySql = mySql + "'" + hs["relationid"].ToString() + "',"; mySql = mySql + "'" + hs["xpoint"].ToString() + "',"; mySql = mySql + "'" + hs["ypoint"].ToString() + "')"; } return(dataAccess.Execute_NonQuery(mySql)); } catch (Exception ex) { ILog.WriteErrorLog(mySql + ex.Message); return(-1); } }
/// <summary> /// 增加一条道路数据 /// </summary> public bool Add(MyNet.DataAccess.Model.RoadInfo model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into T_GIS_ROAD(ROADID,DLBH,DLMC,DLLX,SSXQ,GXSJ,ISMARK) values ("); strSql.Append("'" + model.ROADID + "','" + model.DLBH + "','" + model.DLMC + "','" + model.DLLX + "','" + model.SSXQ + "',str_to_date('" + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','%Y-%m-%d %H:%i:%s'),'" + model.ISMARK + "')"); int rows = dataAccess.Execute_NonQuery(strSql.ToString()); if (rows > 0) { if (model.XYZPOINT != null && model.XYZPOINT.Count > 0) { return(AddXyz(model.XYZPOINT, model.ROADID)); } return(true); } else { return(false); } }