/// <summary> /// 得到一个对象实体 /// </summary> public Model.staff GetModel(int staff_id) { StringBuilder strSql = new StringBuilder(); strSql.Append("select staff_id,staff_name,staff_sex,staff_identity_card,staff_phone_number,staff_age,staff_hire_date,staff_belong_dep_id from staff "); strSql.Append(" where staff_id=@staff_id "); MySqlParameter[] parameters = { new MySqlParameter("@staff_id", MySqlDbType.Int32, 32) }; parameters[0].Value = staff_id; Model.staff model = new Model.staff(); DataSet ds = DbHelperMySQL.Query(strSql.ToString(), parameters); if (ds.Tables[0].Rows.Count > 0) { return(DataRowToModel(ds.Tables[0].Rows[0])); } else { return(null); } }
/// <summary> /// 得到一个对象实体 /// </summary> public Model.department GetModel(int dep_id) { StringBuilder strSql = new StringBuilder(); strSql.Append("select dep_id,dep_name,dep_principal_name,dep_principal_id from department "); strSql.Append(" where dep_id=@dep_id "); MySqlParameter[] parameters = { new MySqlParameter("@dep_id", MySqlDbType.Int32, 32) }; parameters[0].Value = dep_id; Model.department model = new Model.department(); DataSet ds = DbHelperMySQL.Query(strSql.ToString(), parameters); if (ds.Tables[0].Rows.Count > 0) { return(DataRowToModel(ds.Tables[0].Rows[0])); } else { return(null); } }
/// <summary> /// 得到一个对象实体 /// </summary> public Model.chest_type GetModel(int type_id) { StringBuilder strSql = new StringBuilder(); strSql.Append("select type_id,type_length,type_high,type_wide from chest_type "); strSql.Append(" where type_id=@type_id "); MySqlParameter[] parameters = { new MySqlParameter("@type_id", MySqlDbType.Int32, 32) }; parameters[0].Value = type_id; Model.chest_type model = new Model.chest_type(); DataSet ds = DbHelperMySQL.Query(strSql.ToString(), parameters); if (ds.Tables[0].Rows.Count > 0) { return(DataRowToModel(ds.Tables[0].Rows[0])); } else { return(null); } }
/// <summary> /// 得到一个对象实体 /// </summary> public Model.chest GetModel(int chest_id) { StringBuilder strSql = new StringBuilder(); strSql.Append("select chest_id,chest_name,chest_remain_volume,chest_remain_seat,chest_create_time,chest_type,chest_belong_storage from chest "); strSql.Append(" where chest_id=@chest_id"); MySqlParameter[] parameters = { new MySqlParameter("@chest_id", MySqlDbType.Int32) }; parameters[0].Value = chest_id; Model.chest model = new Model.chest(); DataSet ds = DbHelperMySQL.Query(strSql.ToString(), parameters); if (ds.Tables[0].Rows.Count > 0) { return(DataRowToModel(ds.Tables[0].Rows[0])); } else { return(null); } }
/// <summary> /// 得到一个对象实体 /// </summary> public Model.log_info GetModel(int log_num) { StringBuilder strSql = new StringBuilder(); strSql.Append("select log_num,log_type,log_describe from log_info "); strSql.Append(" where log_num=@log_num "); MySqlParameter[] parameters = { new MySqlParameter("@log_num", MySqlDbType.Int32, 64) }; parameters[0].Value = log_num; Model.log_info model = new Model.log_info(); DataSet ds = DbHelperMySQL.Query(strSql.ToString(), parameters); if (ds.Tables[0].Rows.Count > 0) { return(DataRowToModel(ds.Tables[0].Rows[0])); } else { return(null); } }
/// <summary> /// 得到一个对象实体 /// </summary> public Model.in_storage GetModel(int enter_num) { StringBuilder strSql = new StringBuilder(); strSql.Append("select enter_num,mat_id,mat_name,in_time,sl_id,in_amount,in_weight,in_volume from in_storage "); strSql.Append(" where enter_num=@enter_num "); MySqlParameter[] parameters = { new MySqlParameter("@enter_num", MySqlDbType.Int32, 11) }; parameters[0].Value = enter_num; Model.in_storage model = new Model.in_storage(); DataSet ds = DbHelperMySQL.Query(strSql.ToString(), parameters); if (ds.Tables[0].Rows.Count > 0) { return(DataRowToModel(ds.Tables[0].Rows[0])); } else { return(null); } }
/// <summary> /// 得到一个对象实体 /// </summary> public Model.material_info GetModel(int mat_id) { StringBuilder strSql = new StringBuilder(); strSql.Append("select mat_id,mat_name,mat_father_id,mat_create_time,mat_fengdu,mat_state,mat_colour,mat_smell,mat_type,mat_type_id,mat_purpose,mat_source,mat_suanjianxing,mat_yuansuzhanbi,mat_yuansuliang from material_info "); strSql.Append(" where mat_id=@mat_id "); MySqlParameter[] parameters = { new MySqlParameter("@mat_id", MySqlDbType.Int32, 32) }; parameters[0].Value = mat_id; Model.material_info model = new Model.material_info(); DataSet ds = DbHelperMySQL.Query(strSql.ToString(), parameters); if (ds.Tables[0].Rows.Count > 0) { return(DataRowToModel(ds.Tables[0].Rows[0])); } else { return(null); } }
/// <summary> /// 得到一个对象实体 /// </summary> public Model.storagelocation GetModel(int sl_id) { StringBuilder strSql = new StringBuilder(); strSql.Append("select sl_id,sl_store_type_id,sl_store_min,sl_store_max,sl_store_area,sl_comment,sl_remain_bulk,sl_belong_chest from storagelocation "); strSql.Append(" where sl_id=@sl_id"); MySqlParameter[] parameters = { new MySqlParameter("@sl_id", MySqlDbType.Int32) }; parameters[0].Value = sl_id; Model.storagelocation model = new Model.storagelocation(); DataSet ds = DbHelperMySQL.Query(strSql.ToString(), parameters); if (ds.Tables[0].Rows.Count > 0) { return(DataRowToModel(ds.Tables[0].Rows[0])); } else { return(null); } }
/// <summary> /// 得到一个对象实体 /// </summary> public Model.storage GetModel(int storage_id) { StringBuilder strSql = new StringBuilder(); strSql.Append("select storage_id,storage_name,storage_create_time,storage_area,storage_remain_chest,storage_remain_seat,storage_comment from storage "); strSql.Append(" where storage_id=@storage_id"); MySqlParameter[] parameters = { new MySqlParameter("@storage_id", MySqlDbType.Int32) }; parameters[0].Value = storage_id; Model.storage model = new Model.storage(); DataSet ds = DbHelperMySQL.Query(strSql.ToString(), parameters); if (ds.Tables[0].Rows.Count > 0) { return(DataRowToModel(ds.Tables[0].Rows[0])); } else { return(null); } }
/// <summary> /// 得到一个对象实体 /// </summary> public Model.sr_info GetModel(int sr_id) { StringBuilder strSql = new StringBuilder(); strSql.Append("select sr_id,sr_name,sr_type,sr_resp_name,sr_resp_id,sr_contact_name,sr_contact_phone,sr_place,sr_create_time,sr_update_time from sr_info "); strSql.Append(" where sr_id=@sr_id "); MySqlParameter[] parameters = { new MySqlParameter("@sr_id", MySqlDbType.Int32, 32) }; parameters[0].Value = sr_id; Model.sr_info model = new Model.sr_info(); DataSet ds = DbHelperMySQL.Query(strSql.ToString(), parameters); if (ds.Tables[0].Rows.Count > 0) { return(DataRowToModel(ds.Tables[0].Rows[0])); } else { return(null); } }
/// <summary> /// 得到一个对象实体 /// </summary> public Model.out_storage GetModel(int out_id) { StringBuilder strSql = new StringBuilder(); strSql.Append("select out_id,out_mat_id,out_mat_name,out_account,out_batch_id,out_data,out_staff_id,out_staff_name from out_storage "); strSql.Append(" where out_id=@out_id "); MySqlParameter[] parameters = { new MySqlParameter("@out_id", MySqlDbType.Int32, 128) }; parameters[0].Value = out_id; Model.out_storage model = new Model.out_storage(); DataSet ds = DbHelperMySQL.Query(strSql.ToString(), parameters); if (ds.Tables[0].Rows.Count > 0) { return(DataRowToModel(ds.Tables[0].Rows[0])); } else { return(null); } }