/// <summary> /// /// </summary> /// <param name="info"></param> /// <returns></returns> public long InsertInfo(ConfigInfo info) { ///名称①、代码②不能重复,必填项 int cnt = dal.GetCounts("[CODE] = N'" + info.Code + "'"); if (cnt > 0) { throw new Exception("MC:0x00000005");///系统配置代码不允许重复 } cnt = dal.GetCounts("[NAME] = N'" + info.Name + "'"); if (cnt > 0) { throw new Exception("MC:0x00000006");///系统配置名称不允许重复 } return(dal.Add(info)); }