///
/// 删除车辆信息
///
/// true false
public bool DeleteCarInfoBLL(string CarPlateNumber)
{
Car_InforDAL DeleteCarInfo = new Car_InforDAL();
return DeleteCarInfo.DeleteCarInfoDAL(CarPlateNumber);
}
public bool VilCarOfUser()
{
User_Info user = LoginHandler.CurrentUser;
if (Role_InfoDAL.ExitSupper(user.User_ID.ToString()))
{
return true;
}
else if (Role_InfoDAL.ExitBusiness(user.User_ID.ToString()) || Role_InfoDAL.ExitMaintenance(user.User_ID.ToString()))
{
return true;
}
if (user.Company_ID != 0)
return true;
else return false;
}
public DataTable GetOldCarInfoByCarId(string CarID)
{
Car_InforDAL _Car_InfoDAL = new Car_InforDAL();
return _Car_InfoDAL.GetOldCarInfoByCarId(CarID);
}
public bool GetCarInforByCarPlateNumber(string Car_PlateNumber)
{
Car_InforDAL _Car_InfoDAL = new Car_InforDAL();
return _Car_InfoDAL.GetCarInforByCarPlateNumber(Car_PlateNumber);
}
#endregion
}
}
DAL
namespace DAL
{
public class Car_InforDAL
{
#region
///
/// 直接加载车辆信息
///
/// true false
public DataTable GetCarInfoDAL(string strUserId, string strCarIDs)
{
try
{
string strAddSql = "";
if (Role_InfoDAL.ExitSupper(strUserId))
{
strAddSql = " select a.*,b.Company_Name as Conpany_Name from dbo.Car_Infor a left join Company_Info b on a.Car_CompanyId=b.Company_ID order by UPDATED_DATE desc, CREATED_DATE DESC";
return DBCommon.GetDataTable(strAddSql);
}
else
{
if (strCarIDs == "0")
{
DataTable ds = new DataTable();
return ds;
}
else
{
strAddSql = " select a.*,b.Company_Name as Conpany_Name from dbo.Car_Infor a left join Company_Info b on a.Car_CompanyId=b.Company_ID where a.Car_ID in ('" + strCarIDs + "') order by UPDATED_DATE desc, CREATED_DATE DESC";
return DBCommon.GetDataTable(strAddSql);
}
}
}
catch (Exception ex)
{
throw new ApplicationException(ex.Message);
}
}
///
/// 根据条件获取车辆信息
///
/// true false
public DataTable QueryCarInfoDAL(string strUserId, string strCarIDs, string QueryCarPlateNumber, string QueryCarName)
{
try
{
StringBuilder sb = new StringBuilder();
sb.Append(" select a.*,b.Company_Name as Conpany_Name from dbo.Car_Infor a left join Company_Info b on a.Car_CompanyId=b.Company_ID");
sb.Append(" where 1=1 ");
if (QueryCarPlateNumber != "")
sb.Append(" and a.Car_PlateNumber like '%" + QueryCarPlateNumber + "%'");
if (QueryCarName != "")
sb.Append(" and a.Car_Name like '%" + QueryCarName + "%'");
if (Role_InfoDAL.ExitSupper(strUserId))
{
}
else if (Role_InfoDAL.ExitBusiness(strUserId) || Role_InfoDAL.ExitMaintenance(strUserId))
{
}
else
{
if (strCarIDs == "0")
{
DataTable ds = new DataTable();
return ds;
}
else
{
sb.Append(" and a.Company_ID in ('" + strCarIDs + "')");
}
}
return DBCommon.GetDataTable(sb.ToString());
}
catch (Exception ex)
{
throw new ApplicationException(ex.Message);
}
}
#region
///
/// 当前用户下的下属车辆
///
/// true false
public DataTable GetCarInfoByUserDAL(string strUserId, string strConpanyIDBystrUserId)
{
try
{
string strAddSql = "";
if (Role_InfoDAL.ExitSupper(strUserId))
{
strAddSql = " select Car_ID,Car_Name from Car_Infor order by Car_Name";
return DBCommon.GetDataTable(strAddSql);
}
else if (Role_InfoDAL.ExitBusiness(strUserId) || Role_InfoDAL.ExitMaintenance(strUserId))
{
strAddSql = " select Car_ID,Car_Name from Car_Infor order by Car_Name";
return DBCommon.GetDataTable(strAddSql);
}
else
{
if (strConpanyIDBystrUserId == "0")
{
DataTable ds = new DataTable();
return ds;
}
else
{
strAddSql = "select Car_ID,Car_Name from Car_Infor where Car_ID in ('" + strConpanyIDBystrUserId + "') order by Car_Name";
return DBCommon.GetDataTable(strAddSql);
}
}
}
catch (Exception ex)
{
throw new ApplicationException(ex.Message);
}
}
#endregion
///
/// 查询该车辆是否存在
///
/// true false
public bool SearchTheCarDAL(string CarID, string CarNewPlateNumber)
{
string sql = "select * from Car_Infor where Car_ID<>'" + CarID + "' and Car_PlateNumber='" + CarNewPlateNumber + "'";
return DBCommon.ExecuteNumber(sql) > 0;
}
///
/// 删除车辆信息
///
/// true false
public bool DeleteCarInfoDAL(string CarID)
{
string sql = "delete from Car_Infor where Car_ID='" + CarID + "'";
return DBCommon.ExecuteNonQuery(sql);
}
#endregion
public DataTable GetCarInfoList(string CarIDS)
{
string strSql = "select Car_ID,Car_Name from Car_Infor where Car_ID in ('" + CarIDS + "') order by Car_Name";
return DBCommon.GetDataTable(strSql);
}
public DataTable GetCarInfoById(string CarID)
{
string strSql = "select * from Car_Infor where Car_ID = '" + CarID + "'";
return DBCommon.GetDataTable(strSql);
}
public DataTable GetCarInfoList()
{
string strSql = "select Car_ID,Car_Name from Car_Infor order by Car_Name";
return DBCommon.GetDataTable(strSql);
}
public DataTable GetOldCarInfoByCarId(string CarID)
{
string strSql = "select * from Car_Infor where Car_ID = '" + CarID + "'";
return DBCommon.GetDataTable(strSql);
}
public bool GetCarInforByCarPlateNumber(string Car_PlateNumber)
{
string strSql = "select count(0) from Car_Infor where Car_PlateNumber='" + Car_PlateNumber + "'";
string strCount= DBCommon.GetFirstRowCol(strSql);
if (strCount == "0")
return false;
else
return true;
}
public DataTable GetCompanyInfoListByBusinessMaintenance(string strUserIDsandCarIDs)
{
string strSql = "select Car_ID,Car_Name from Car_Infor where 1=1 ";
if (strUserIDsandCarIDs != "")
{
string[] UserIDandCarIDs = strUserIDsandCarIDs.Split('|');
if (UserIDandCarIDs[1] != null && UserIDandCarIDs[1] != "")
{
strSql += " and Car_ID in ('" + UserIDandCarIDs[1] + "')";
}
}
strSql += " order by Car_Name";
return DBCommon.GetDataTable(strSql);
}
}
}
eclipse中使用maven插件的时候,运行run as maven build的时候报错
-Dmaven.multiModuleProjectDirectory system propery is not set. Check $M2_HOME environment variable and mvn script match.
可以设一个环境变量M2_HOME指
1.建好一个专门放置MySQL的目录
/mysql/db数据库目录
/mysql/data数据库数据文件目录
2.配置用户,添加专门的MySQL管理用户
>groupadd mysql ----添加用户组
>useradd -g mysql mysql ----在mysql用户组中添加一个mysql用户
3.配置,生成并安装MySQL
>cmake -D
好久没有去安装过MYSQL,今天自己在安装完MYSQL过后用navicat for mysql去厕测试链接的时候出现了10061的问题,因为的的MYSQL是最新版本为5.6.24,所以下载的文件夹里没有my.ini文件,所以在网上找了很多方法还是没有找到怎么解决问题,最后看到了一篇百度经验里有这个的介绍,按照其步骤也完成了安装,在这里给大家分享下这个链接的地址
import java.io.UnsupportedEncodingException;
/**
* 转换字符串的编码
*/
public class ChangeCharset {
/** 7位ASCII字符,也叫作ISO646-US、Unicode字符集的基本拉丁块 */
public static final Strin
其实这个没啥技术含量,大湿们不要操笑哦,只是做一个简单的记录,简单用了一下递归算法。
import java.io.File;
/**
* @author Perlin
* @date 2014-6-30
*/
public class PrintDirectory {
public static void printDirectory(File f
linux安装mysql出现libs报冲突解决
安装mysql出现
file /usr/share/mysql/ukrainian/errmsg.sys from install of MySQL-server-5.5.33-1.linux2.6.i386 conflicts with file from package mysql-libs-5.1.61-4.el6.i686
Dear,
I'm pleased to announce that ktap release v0.1, this is the first official
release of ktap project, it is expected that this release is not fully
functional or very stable and we welcome bu