예제 #1
0
        public static List <DetectionDeduct> GetDetectionDeducts()
        {
            String     sql        = "SELECT detection_id, detection_max_scale,detection_cur_scale,detection_deduct_value FROM mdtbl_detection_deduct";
            ISqlHelper sql_helper = SqlHelperFactory.GetDefaultSqlHelper();

            return((MdDataTableHelper <DetectionDeduct> .ConvertToModel(sql_helper.ExecuteDataTable(sql))).ToList <DetectionDeduct>());
        }
예제 #2
0
        public static List <BridgeType> GetBridgeTypes()
        {
            string     sql        = "select * from mdtbl_bridge_type";
            ISqlHelper sql_helper = SqlHelperFactory.GetDefaultSqlHelper();

            return((MdDataTableHelper <BridgeType> .ConvertToModel(
                        sql_helper.ExecuteDataTable(sql))).ToList <BridgeType>());
        }
예제 #3
0
        public static List <Project> GetProjectsByCon()
        {
            String sqlCon = "SELECT prj_id,client_id,prj_name,begintime,endtime,prj_describe,prj_contract," +
                            "prj_man,prj_status,check_man,check_date,prj_principal,prj_sign_date,prj_address FROM mdtbl_project";
            ISqlHelper sql_helper = SqlHelperFactory.GetDefaultSqlHelper();

            return((MdDataTableHelper <Project> .ConvertToModel(sql_helper.ExecuteDataTable(sqlCon))).ToList <Project>());
        }
예제 #4
0
        /// <summary>
        /// 获取所有子桥梁信息,只显示未注销桥梁信息,已注销的当删除
        /// </summary>
        /// <returns></returns>
        public static List <ChildBridge> GetChildBridges()
        {
            // String sqlCon = "SELECT bridge_children_id,bri_id,type_id,bridge_children_name,bridge_children_discribe,bridge_pile FROM mdtbl_bridge_children";
            String     sql        = "SELECT bridge_children_id, a.bri_id,type_id,bridge_children_name,bridge_children_discribe,bridge_pile FROM mdtbl_bridge_children a LEFT JOIN mdtbl_bridge_xzsb b on a.bri_id = b.bri_id where b.is_cancel = 1";
            ISqlHelper sql_helper = SqlHelperFactory.GetDefaultSqlHelper();

            return((MdDataTableHelper <ChildBridge> .ConvertToModel(
                        sql_helper.ExecuteDataTable(sql))).ToList <ChildBridge>());
        }
예제 #5
0
        /// <summary>
        /// 根据子桥梁ID或者桥梁名称进行查找
        /// </summary>
        /// <param name="bridgeChildrenId"></param>
        /// <param name="bridgeChildrenName"></param>
        /// <returns></returns>
        public static List <ChildBridge> GetChildBridges(string name, string pileId)
        {
            // String sqlCon = "SELECT bridge_children_id,bri_id,type_id,bridge_children_name,bridge_children_discribe,bridge_pile FROM mdtbl_bridge_children  where 1=1";
            String sql = "SELECT bridge_children_id, a.bri_id,type_id,bridge_children_name, " +
                         "bridge_children_discribe,bridge_pile FROM mdtbl_bridge_children a LEFT JOIN " +
                         "mdtbl_bridge_xzsb b on a.bri_id = b.bri_id where b.is_cancel = 1 ";
            string sql_filter = "";

            //if (!string.IsNullOrWhiteSpace(id))
            //    sql_filter += string.Format("and bridge_children_id = '{0}'  ", id);
            if (!string.IsNullOrWhiteSpace(name))
            {
                sql_filter += string.Format("and bridge_children_name like '%{0}%' ", name);
            }
            if (!string.IsNullOrWhiteSpace(pileId))
            {
                sql_filter += string.Format("and bridge_pile like '%{0}%' ", pileId);
            }
            sql += sql_filter;
            ISqlHelper sql_helper = SqlHelperFactory.GetDefaultSqlHelper();

            return((MdDataTableHelper <ChildBridge> .ConvertToModel(
                        sql_helper.ExecuteDataTable(sql))).ToList <ChildBridge>());
        }
예제 #6
0
        public static List <Project> GetProjects(string name, DateTime?date, string contract, int state_num)
        {
            string sql_filter = "";

            if (!string.IsNullOrWhiteSpace(name))
            {
                sql_filter += string.Format("prj_name like '%{0}%' and ", name);
            }

            if (date.HasValue)
            {
                sql_filter += string.Format("begintime='{0}' and ", date.Value.ToString("yyyy-MM-dd 00:00:00"));
            }

            if (!string.IsNullOrWhiteSpace(contract))
            {
                sql_filter += string.Format("prj_contract like '%{0}%' and ", contract);
            }

            if (state_num > -1)
            {
                sql_filter += string.Format("prj_status='{0}' and ", state_num);
            }

            string sql = "select * from mdtbl_project";

            if (!string.IsNullOrWhiteSpace(sql_filter))
            {
                sql_filter = sql_filter.Substring(0, sql_filter.Length - 5);
                sql       += " where " + sql_filter;
            }

            var dt = SqlHelperFactory.GetDefaultSqlHelper().ExecuteDataTable(sql);

            return(MdDataTableHelper <Project> .ConvertToModel(dt).ToList <Project>());
        }