123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace LYFZ.CloudServerData.DAL
- {
- public class CloudServerCollection : BaseDataOperate<LYFZ.CloudServerData.Model.CloudServerCollection>
- {
- public CloudServerCollection(LYFZ.CloudServerData.Model.DBConnection dbConn)
- {
- base.DBConn = dbConn;
- }
- /// <summary>
- /// 验证基本信息
- /// </summary>
- /// <param name="enterpriseModel"></param>
- /// <param name="msg"></param>
- /// <returns></returns>
- public bool VerifyBaseInfo(LYFZ.CloudServerData.Model.CloudServerCollection serverCollectionModel, ref string msg)
- {
- if (String.IsNullOrEmpty(serverCollectionModel.CloudServerName))
- {
- msg = "服务器名称不能为空";
- return false;
- }
- if (String.IsNullOrEmpty(serverCollectionModel.DataBaseServerIP))
- {
- msg = "服务器IP不能为空";
- return false;
- }
- if (serverCollectionModel.DataBasePort <= 0 || serverCollectionModel.DataBasePort > 65535)
- {
- msg = "服务器端口必须是“1—65535”之间的整数";
- return false;
- }
- if (String.IsNullOrEmpty(serverCollectionModel.DataBaseUser))
- {
- msg = "数据库登录用户不能为空";
- return false;
- }
- if (String.IsNullOrEmpty(serverCollectionModel.DataBasePass))
- {
- msg = "数据库登录用户密码不能为空";
- return false;
- }
- return true;
- }
- /// <summary>
- /// 验证服务器IP是否存在
- /// </summary>
- /// <param name="enterpriseID"></param>
- /// <param name="msg"></param>
- /// <returns></returns>
- public bool VerifyServerIPExists(string serverIP, ref string msg)
- {
- if (this.Exists("DataBaseServerIP", serverIP))
- {
- msg = "要添加的服务器IP“" + serverIP + "”已经存在,不能重复添加";
- return false;
- }
- return true;
- }
- }
- }
|