/// <summary> /// 修改警区信息 /// </summary> /// <param name="vid"></param> /// <returns></returns> public int UPdateScenicInfo(ScenicInfo scenicInfo) { string sql = ""; try { sql = "UPDATE ScenicInfo SET SName = @Name,Mobile = @Mobile,Address = @Address,Pid = @Pid,Contact = @Contact WHERE ID = @Id"; SqlParameter[] param = new SqlParameter[] { new SqlParameter("@Id", scenicInfo.ID), new SqlParameter("@Name", scenicInfo.SName), new SqlParameter("@Address", scenicInfo.Address), new SqlParameter("@Pid", scenicInfo.Pid), new SqlParameter("@Contact", scenicInfo.Contact), new SqlParameter("@Mobile", scenicInfo.Mobile) }; return(SqlHelper.ExecuteNonQuery(SqlHelper.DBConnStr, CommandType.Text, sql, param)); } catch (Exception ex) { Logger.ErrorLog(ex, new Dictionary <string, string>() { { "Function", "SystemDAL.UPdateScenicInfo(ScenicInfo scenicInfo)" }, { "SQL", sql } }); throw ex; } }
/// <summary> /// 添加警区 /// </summary> /// <param name="Scenic"></param> /// <returns></returns> public int InsertScenicInfo(ScenicInfo ScenicInfo) { string sql = ""; string strGUID = System.Guid.NewGuid().ToString().ToUpper(); try { sql = "INSERT INTO ScenicInfo(CreateTime,SName,Pid,Address,Mobile,Contact,Valid,Sguid)VALUES(@CreateTime,@Name,@Pid,@Address,@Mobile,@Contact,1,@Sguid)"; SqlParameter[] param = new SqlParameter[] { new SqlParameter("@CreateTime", ScenicInfo.CreateTime), new SqlParameter("@Pid", ScenicInfo.Pid), new SqlParameter("@Address", ScenicInfo.Address), new SqlParameter("@Contact", ScenicInfo.Contact), new SqlParameter("@Name", ScenicInfo.SName), new SqlParameter("@Mobile", ScenicInfo.Mobile), new SqlParameter("@Sguid", strGUID) }; return(SqlHelper.ExecuteNonQuery(SqlHelper.DBConnStr, CommandType.Text, sql, param)); } catch (Exception ex) { Logger.ErrorLog(ex, new Dictionary <string, string>() { { "Function", "SystemDAL.InsertScenicInfo(ScenicInfo ScenicInfo)" }, { "SQL", sql } }); throw ex; } }